How to Build a Web Map That Supports Queries

How to Build a Web Map That Supports Queries

While maps are a great way to tell compelling visual stories, it's important to remember that interactive maps also offer the possibility of answering questions that a person might have.

The question could be simple e.g. Where is Springfield, MI? or it could be complex e.g. How many Walmarts are there in Orange County?

In map speak, we consider these questions and the process by which they are answered as queries.

Queries open up a world of possibilities to the user, from navigating from place to place, finding a service provider, preparing a list of outlets to be checked/visited or including the results in some kind of decision making process.

A good, well designed web map with a specific purpose in mind should lead the user to answer such queries without overwhelming them with too many options. We might add one or two queries to the map, but to throw give them a whole toolbox all at once might overwhelm them.

So what tools are available to answer map based queries and how can they be successfully implemented?

Search

Suggested web map search results based on user input

A simple, Google style search is the simplest point of entry for answering user queries. They are easily understood my non-expert users and typically return results very quickly.  A good search tool will allow partial text matches so the users does not need to type the full name or even know EXACTLY what they are looking for. Results are typically returned as a list from which a user can select the most relevant result. This result is then highlighted on the map and the attributes displayed in a popup window. The drawback of basic search is that is can return a lot of results and typically searches all information in the table attached to our spatial data (the attribute table).

Advanced Search

A web map with advanced search with multi-field input to narrow down answers fast

Advanced search gives us the possibility of building queries that are more narrowly focused and/or where the user already has some idea what they are looking for.
For example, they might have a property ID that they wish to search for. We can setup and advanced search so that it is restricted to the property ID column, thus ensuring focused, uncluttered results. Again, users can then select the most relevant result from a list.

Query

Query results in a web map

Queries differ slightly from searches in that they offer the possibility of querying any spatial dataset like a shapefile and returning values from within the features, and also for multiple criteria to be entered at the same time.

For example,

Show me all properties that are for sale in Spokane that have more than three bedrooms and are priced < $250,000

Provided our underlying data contains such information, a query will quickly find properties meeting these criteria and return them to the user for further examination on the map, view as tabular data, or to download as a new spatial file.

Proximity Analysis

Because we are in a map environment, we can also leverage the power of location to understand the relationship between two different layers. Taking our previous example, we could take our list of properties and drill down further and ask:

Show me the schools that are within a 5-mile radius of selected properties

Such a query is referred to as proximity analysis, since we are interested in which Features B (schools) are located in proximity to features A (properties).

Additionally, to really put the power of the map in the hands of users, we can allow them to also select features manually using a circle or point-and-click and then run a query or proximity analysis on those features.

In this way, virtually any kind of question or query can be answered by the users themselves, provided we can add the data to a web map and implement the right kind of tool for the job.

This will almost certainly turn out to be a huge benefit to any organization that deals with contractors the public or simple a person in another department who would otherwise bug us endlessly to produce results from a clunky old Desktop GIS.

Mango, a leading provider of Web GIS solutions offers all of the above mentioned tools and is trusted by local government, companies, NGOs to provide a platform for users to access their spatial data and answer questions for themselves.

Try out a proximity query with the example map below.

Click the map to open

Ready to start giving your users the tools to answer their questions?

Sign up for your free 30-day trial here and see what Mango can do for your customers and constituents.

Share this!
Chris Brown is the founder and CEO of Mango (simple online web GIS for everyone).