Drupal Geospatial Use Case Scenarios

You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

As momentum continues to grow in the development community to improve existing geo-related Drupal modules and build new ones, real-world use-case scenarios are necessary to help keep work focused and relevant.

We need your examples. How would you use geospatial data in Drupal? What are your scenarios? Add your use-cases here to help direct programming and, perhaps, have your example show up on a demo site.

We've seen a number of requests on the Location and Mapping group. To get you started, for the first entry we'll post an example extracted from a recent discussion post on the Location and Mapping Group page (tip of the Geo hat to eink21).

Feel free to post, edit, style this page. Be sure to include your user information if you are willing to be contacted about your scenario.

--------------------- Start Scenario 1 ----------------------------

  • Scenario 1 (submitted byeink21):

    Advertising Geo Site

    Synopsis of my intended site features

    List (i.e. database) of advertising options in various regions of the U.S.

    Examples of types of advertising options that will be included: billboards (no specific address), media companies (specific address), radio stations (coverage area is what matters, i.e. a geographic polygon)

    Users will be able to filter the advertising options, articles, blog entries, and maps via taxonomy vocabularies in the sidebar

    Desired Mapping Core Functions:

    1. Collect user input (options: ask for lat/lon coordinates directly, ask for address, have them click on the map, have them draw a polygon on the map)
    2. (additionally necessary unless the module that does step #1 does this step also): Convert the user input into database-suitable data
    3. Store/retrieve database data
    4. Present the information in a useful way (options: show coordinates, show address, show point on map, show polygons on map, allow proximity or other methods of searching) (Note: although it could be convenient to have user customization/filtering built into the mapping functionality, this is also possible via Views so I’m not including it as a mapping core function).

    --------------------- End Scenario 1 ----------------------------

    --------------------- Start Scenario 2 ----------------------------

    Allow creation / storage / display / searches / Views of areas

    We're already using CCK, Location and GMap to store and display places in Hong Kong, using a CCK node type called 'Place'. They are typically places of historical interest.

    Next I'd like to store details of old paper maps that show Hong Kong. So we'll have a new CCK type PaperMap, and one of its fields will store the region covered by this map. Most commonly the region will be a rectangle oriented North-south, but some may be rotated, as not all paper maps are oriented North-South.

    When creating a new PaperMap node, the user will need to define the region covered. Crudest method will be to use a map to select four points, one for each corner. An easier way will be to have a rectangular selection the user can drag, stretch/shrink, and rotate.

    When the node is displayed, it should show the region as an outline (transparent shaded rectangle even better), overlayed on a digital map.

    I'd like to be able to use Views to build a view showing all selected PaperMap nodes as rectangles overlayed on a digital map (eg Google Map). Clicking within a rectangle opens that PaperMap node.

    There will be a 'region contains point' filter in Views, that lets me build a view of all PaperMap nodes that contain the specified point. So, when I'm looking at a certain place, I can click a link to see a view of all PaperMap's we know of that show this Place.

    One point I'm not clear on is how to handle overlapping paperMaps in the same view. eg worst case is if we present several PaperMaps to the user that cover the same region, but that were drawn in different years, eg 1900, 1930, 1950. Since the region for each is the same, they would appear as a single rectangle on the view. How would the user know there were actually several PaperMaps returned, and then choose the one they want to see? One option could be: when clicking a point contained in more than one PaperMap region, show a pop-up window giving list of the PaperMap nodes to choose from.

    --------------------- End Scenario 2 ----------------------------
    --------------------- Start Scenario 3 ----------------------------

    Legislative Lookup

    One of the things that is possible with the Geo, Geocode and Postal modules is provide a lookup utility for users to find their legislators or candidates for election. Because legislative boundaries do not necessarily fall along any specific boundaries (e.g. zip codes, cities or counties), it's necessary to figure out exactly where a user's address is, and then determine which district that address falls into.

    We were able to accomplish this by:

    1. Importing publicly available boundary information for legislative districts and voting precincts into the Geo Data module
    2. Importing information about political candidates using the Project Vote Smart module
    3. Providing an address lookup form using the Geocode module. User's addresses are geocoded on the fly, and used as filters for views

    Once we got those foundation elements in place, the entire site can be built with CCK, Views, and the Project Vote Smart module. Visitors can enter their addresses, and instantly obtain a list of state and local candidates, and a walking map to their polling place. Best of all, if there's a redistricting, another dataset, or other changes, we only had to re-import the new shape data.

    The site was built with generic aesthetics because it was accessed via iFrames on participating sites. You can check out one version here. (Use any MN address, e.g. our office: 2104 Stevens Ave S, Minneapolis MN 55404)

    We made 100% of our efforts on Geo, Geocode and Project Vote Smart available as Drupal contributions. However, due to time and budget limitations, we opted for a few shortcuts that would make it challenging for others to roll out the same site without programming expertise. We want to fix that! If you have similar needs, and would like to help push these tools to a new level please contact us. (it will probably cost less than the 3rd party service you're paying to do the same thing).
    --------------------- End Scenario 3 ----------------------------
    --------------------- Start Scenario 4 ----------------------------

    Footprints:

    Association made with a Place node indicating user presence.
    The available footprints are past, present, future, and wish.

    Past: user has visited the place
    Present: user is at the place
    Future: user plans to visit a place
    Wish: user has a desire to visit a place

    Activity Log:

    A history of all of the users activity within the application. Draw a mashup of the latest footprints from mutual friends or self.
    --------------------- End Scenario 4 ----------------------------
    --------------------- Start Scenario 5 ----------------------------

    Personal Maps:

    Draw, Customize, Collaborative Edits, Save, Share, and Send Maps
    --------------------- End Scenario 5 ----------------------------
    --------------------- Start Scenario 6 ----------------------------

    view search results

    • Map View: Displays search results on the map.
    • List View: Displays search results in a list
    • Map + List: Displays search results in both List and Map View.
      --------------------- End Scenario 6 ----------------------------
      --------------------- Start Scenario 7 ----------------------------

    Geocoded Tags

    Use Need:
    Citizen Journalism (participatory journalism)/Social Networking site (neighborhood orgs site, environmental org site, etc.)/Community Mapping.
    Use Description:
    Site combines local news stories, blogs, attractions, events, discussions, local business directory, user-organized groups (organic or otherwise) and other "soc net" features. The idea is to geocode all content to allow users the ability to subscribe to districts, cities, topics, places, radii, whatever. For example, I live in the Frogtown neighborhood of St. Paul, MN. Frogtown's geo boundaries can be:

    • Uploaded into the site's db by the site's admin to begin with from existing publicly available data source
    • uploaded by me or another user that has access to a shape file of the neighborhood (or other neighborhoods)
    • Drawn onto a map of St. Paul by me or another user and then stored in the site's db
    • Automatically geocoded by Geo/Geocode modules by cherry-picking the place name Frogtown from a user's post

    Then, Frogtown and any other neighborhoods would be available as categories to tag a post, whether it be a news story, blog post, etc. A user could subscribe to Frogtown as a term and be notified whenever a post was made or updated that was categorized as Frogtown or was located withing X distance (subscriber defined) from the boundaries of Frogtown. Extra points for being able to comment on the post via sending a reply email that would automatically be added as a comment to the thread on the site.

    The key thing here, though, would be the ability to have a post have multiple geo identities attached. Some neighborhoods build identities through culture, age, and heritage. Others base their existence on location, a hill, a seaside or an urban part of town. Each one provides a unique character with a story. For instance, my story may be about water quality on a specific beach on the bank of a river. I'd want to tag my post with the River, the Neighborhood and the City. Each of these tags would carry with it a geocoded shape (or point or line as the case may be). Thus, this post would turn up in a search of posts about or within X distance of River, Neighborhood, City not only one or the other.

    The possibilities are rather extensive with this model and will allow users to obtain content that is more meaningful to them. Tourguide and Greggles have also defined social networking possibilities for bringing people in contact with each other, sparking meetups, events, or conversations etc. with the site identifying like-minded people based on location or expressed interest in a specific location, place or area which will be geocoded and stored on the site.
    --------------------- End Scenario 7 ----------------------------
    --------------------- Start Scenario 8 ----------------------------

    fixmystreet.com

    fixmystreet.com is a uk site that gets people to log problems for their local council to fix. Users enter an address which is geocoded to determine the appropriate council to contact. There is also an iPhone app where you simply upload a picture of the problem and a short description and it geocodes of the exif data.

    Should be simple enough to do a more generic version in drupal using geo. I'd like to apply it to ireland, but a generic version could be used to set it up for any area.
    --------------------- End Scenario 8 ----------------------------

    ----------------------Start Scenario 9 ----------------------------

    I am building a hiking site using these modules.

    The site goal is to provide all the necessary things to select a trail at your level and area and get directions to the trail. I would like it to include a map of the trail route and pictures along the way.

    I will post a link here soon

    ----------------------End Scenario 9 ------------------------------

    ----------------------Start Scenario 10 ----------------------------

    I want to draw polygons on a map, to which users can then upload and attach media (photo, audio, video). These maps can be linked to as KML / exported as KML. The KML has links to the files in it.

    ----------------------End Scenario 10 ------------------------------

    ----------------------Start Scenario 11 ----------------------------

    I'm making a site for an international club. The club has a special class of Leaders, Members and the general public. In the club there are Groups, with one or more Leaders and one or more Members. Leaders and Members can be in one or more Groups. Groups and Leaders are also organized into Sections, Areas, Divisions (getting bigger). I need location data for Members, Leaders, Groups, Sections, Areas and Divisions. These are street addresses (or city/state or zip).

    Leaders need to be able to control who sees what part of their addresses. Members can see city, state, zip, country maybe phone if the Leader chooses. The general public might not see anything, or partial. Leaders can let other Leaders see more detail like street info.

    Leaders should be able to see their Groups Members address info (if the Member allows it) but not the info for Members of Groups the Leader is not a Leader of.

    directories and maps

    And there are Internal (not for general public and not for Members) directory for Leaders to see, which lists Leaders per location: Group, Section, Area and Division and corresponding maps for each (with for example different markers used depending on the Leader Section on the Division map). There are also maps of just Groups, maps of just Sections, just Areas and just Divisions, so each of those has locations associated with them.

    For the public, for the Leaders that choose to allow the public to see, there is a directory of Leaders and a map of Leaders, but without the street information, so on the map [this bit I dont know how to do it should generate the marker ignoring the street, just based on the city or zip. Otherwise, the marker on the map might accurately place the marker at the street address, even if the street address is hidden, because the lat/long is geocoded using the street info.

    There is also a directory of Groups, with a corresponding map.

    What else? Ah, on each Group page, there is a view which lists the 5 nearest Groups (nearest to the Group being viewed).

    A Leader finder and Group finder, that uses a proximity search based on user input (to find a Leader or Group nearest to a "general public person" some looking to attend a club meeting).

    ----------------------End Scenario 11 ------------------------------

    ----------------------Start Scenario 12 ----------------------------
    An organization has several projects in a country. They want people to find and read about the projects. Show them on a map, pick them and show the specifics about that project.

    I have a specific example. Mano a Mano (www.manoamano.org) builds clinics and schools in Bolivia. They have built 100 clinics throughout the country. They would like to have people see the projects. So the user could see a list of all the clinics in a state (called a department in Bolivia) or show them as push pins. Then click on that clinic and show specific information about that clinic (location, information about the community, distance from headquarters, pictures, brochures) including a local map and satellite photo.

    (I have something like this on my site http://www.lagerquist.com/joel/mano/bolivia-map.php)
    ----------------------End Scenario 12 ------------------------------

    ----------------------Start Scenario 13 ----------------------------
    I travel a lot. I like to create a page for the country I will travel to so that I can look up information before I go (like CIA world factbook). When I am in the country my family and friends can look on the page to see the temperature, time, map and look up information.

    I can search later to see where I have been.

    It is nice to click on a map to find the country or see a list (since the number of countries traveled to is probably small)

    (As an example http://www.lagerquist.com/joel/travel/index.htm)
    ----------------------End Scenario 13 ------------------------------
    ----------------------Start Scenario 14 ----------------------------
    Develop a website of attractions or points of interest.
    - From the locations of the points of interest, assign geopolitical data like town and state/province/country.
    - Enable proximity searches to these points, or searches based on geopolitical boundaries.
    - Another search would be along a route, and the ability to create a route based on a set of selectable points from a map. The route search would include a proximity component as well.
    - Another need would be a views type select to show a defined quantity of closest points to a selected point, or the quantity of closest points within a defined distance.
    - Another search would be to use a map to set a point. This would be the input for a query that would create a list of closest points.
    - Finally users would set their preferred measure of distance.
    ----------------------End Scenario 14 ------------------------------

    ----------------------Start Scenario 15 ----------------------------
    Scenario 15 - Ubuntu-be Support Points Map (submitted bymongolito404)
    A map of local Ubuntu users who volunteer to support new Ubuntu users with official installation sets, demonstrations and help during their first installation.

    Members of the Ubuntu Belgian LoCo Team can register as support points. By doing so, they commit themself to provide some services (installation CDs, etc.) in their area. Visitors of the web site can search the support point in their area and display the results on an interactive map.

    • Registration as support point is done via the creation of a Supporter Profile node (using Content Profile)
    • Search page is a 'user' view with exposed filters and a relationship to Supporter Profiles
    • A CCK field (Postal ?) is used to store support points address(es)
    • A CCK geo field is used to store the user geo-location (adresses are geocoded in the geo field using the geocode widget)

    PS: The system currently runs at http://map.ubuntu-be.org, using a custom webapp built with PHP4 and the CodeIgniter framework. A new version using Drupal is in dev. at http://launchpad.net/support.points.map

    ----------------------End Scenario 15 ----------------------------
    ----------------------Start Scenario 16 ----------------------------

    I posted the following in the location group, but feel it's well suited for this discussion as well.

    How would one set up drupal to get a rough idea of where users are then put them into a chat room / node (with a communication resource) with other users that are in their area?

    This could be done automatically like mentioned above or users could click on a world map to go into a chat room of their choosing, or both.

    I would love to get something like this going in the next day or so, if possible, on a basic level. Any help would be appreciated.
    ----------------------End Scenario 16 ------------------------------
    ----------------------Start Scenario 17 ----------------------------
    Posted by Jerome F
    In a websites to find businesses:

    Input :

    Adress :

    So I need each business owner to input his adress in his user account or profile.
    The best would be an address field with several select list widgets: for the country which makes available a select list for the city, and for the region or an autocomplete field (or mixed autocomplete + select list). (This is both for a nice user experience and to sanitize user submitted content).

    It's very important to store the phone number as well here, but that can be done in an other field if needed. I just keep in mind that we are used to type in our phone and our address in the same form in the final UI.

    Geocode :

    By filling the business's address, a marker is stored in a google map.

    Visualization :

    On the search page, the list (aka: view) displays many fields from the buisiness profile. And there's an exposed filter, e.g. a select list to filter by country, city, region.
    These select list would be even better if a database query could dynamically remove all the countries, cities and regions where there's no business stored in the website.

    On the business page, there's a google map displayed to the user.


    My best bet for the moment is to use:

    views, location, Gmap, Profile2, Finder, Phone number
    everything is no up and running in D7 for the moment for some of these, and there are some features requests here as well
    yet if I use commerce module the addressfield module is needed, and you can't ask your users to type in their address twice.

    ----------------------End Scenario 17 ------------------------------
    ----------------------Start Scenario 18 ----------------------------
    Posted by Jerome F

    A travelling agency website :

    Input :

    You need to store a country OR a region OR a city as adress, a geocode and that's it. Not a precise adderss (no street, no name).
    But it would be great to be able to choose a country > region > city in a select list or a combination of autocomplete and select list, with a database of all cities.

    Visualization :

    A world map with clicable zones could filter a view of the available travellings deals, but an other exposed filter of the view would be the price or the departure place.

    Each available travel would be displayed on the map as either a point for a city and a polygon for a region or a country.
    If the user clics on the destination it triggers an infobox with a link to the travel deal page.


    My best bet for the moment is to use:

    addressfield + geofield + geocode + openlayers + views
    but addressfield is not the good choice for me because I just store a country or a region or a city.
    jq_maphilight for the clicable map
    But how to combine jq_maphilight and the openlayers+geofield+geocode on the same map?

    ----------------------End Scenario 19 ------------------------------
    ----------------------Start Scenario 20 ----------------------------

    Filter shapefile by node field

    We have a content type of habitat classifications (could be any mappable concept) defined by structured attribute fields. Each node in the content type describes one and only one habitat type using an integer class value. There are 50-100 habitat nodes.

    We also have a shapefile of the same habitats with a matching integer field. It could be published as a service. These are linear (vector) features, and could just as easily be polygons or points. The goal is to programmatically display a slippy map of the current habitat type in the body of each node. Any features not matching the current integer attribute should be invisible (filtered out). This is a query by attribute in GIS terms.

    ----------------------End Scenario 20 ----------------------------

  • Location and Mapping

    Group organizers

    Group categories

    Wiki type

    Group notifications

    This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

    Hot content this week