Posts Tagged ‘Web Map Service’
Editing OpenStreetMap data with QGIS and Merkaartor
Problem: You want to contribute to OpenStreetMap from your desktop instead of from the Potlatch web tool.
In my last entry I discussed the process of downloading OpenStreetMap data using Quantum GIS (QGIS). This is how the downloaded data looked in the vicinity of the North Plateau Loop in Monte Sano State Park:

In this entry, I will cover two different methods I used to update this data to include my GPS track of the entire loop. I initially attempted to do this with QGIS.
Method #1: QGIS
When you first activate the QGIS OpenStreetMap plugin, the editing widget should appear on the right side of the screen. If it doesn’t, turn it on by going to View –> Panels –> OSM Feature. You should use the widget instead of the standard toolbar to identify and edit OSM features. If you click the OSM identify tool and hover over features, they will turn red and you can see their tags.

Shown above (in red) is one of the footway bits that fell near the North Plateau Loop, along with my GPS tracks (in magenta). I decided to keep the two segments that were already there, along with their foot=permissive and highway=footway tags. I added a name=North Plateau Loop tag to both of them by typing in the <new tag here> area.
Then I pressed the Create Line button.

The editor will automatically snap to existing features. I began at one the end of the segment by the parking lot and traced along the length of my track, stopping to incorporate the second segment along the way. Then I added the three tags to the new lines I had created.

Once I was happy with my edits, I tried to upload them to the OpenStreetMap server. At this point in the process, if you do not yet have an OSM account, go to https://www.openstreetmap.org/user/new and create one. Then, go back to QGIS and press the Upload OSM Data button.

The next screen is a summary of your changes. Add an optional comment to explain what you did, then enter your OSM account username and password, and press the Upload button.

If all goes well, you will get a message saying your upload has completed successfully. I, instead, got a python error message “OperationalError: SQL logic error or missing database”. According to the Quantum GIS forum, this has happened to some other people, but it doesn’t happen to everyone. You may get lucky. If not, you can try another tool such as Merkaartor.
Method #2: Merkaartor
While QGIS is a full GIS software package, Merkaartor has been developed solely for the purpose of working with OpenStreetMap. I found the interface less than intuitive.
After opening the program, my next step would typically be to add a basemap that moves me to the right geographic location. However, there is no Add Data button like I would expect. Instead, there is a list of layers already in the table of contents that have no source. You need to right-click on the top one to point it to some data. You can choose from a pre-loaded list of TMS (tile map service) or WMS (web map service) layers, or add a raster in GeoTIFF or “Walking Paper” (JPG, PNG or BMP) format.

I had trouble getting Merkaartor to load my georeferenced trail map, so I went the map service route. Once you pick a layer (I liked OSM Mapnik), you can use the mouse wheel to zoom and the right mouse button to pan to your area of interest. Then, press the green arrow Download button to get the current OSM layers in that area.

In the next screen that comes up, you would choose to download the Current View, which is selected by default. Alternatively, you could choose to download “From the map below” and do the same zooming and panning to your area of interest within the smaller window.
Merkaartor’s way of displaying the Monte Sano OSM layers is a bit different. It shows every vertex (node).
When you hover over a group of nodes, their color will change to a pink highlight. You must click on them to select them. They will then turn royal blue and their tags will be displayed in the Properties window on the bottom left of the screen. In order to select the line instead of the nodes that make it up, you need to move the mouse until the pink highlight turns thicker. After you click, the resulting royal blue selection symbol will also be thicker. Then you will see the tags shown above. You can edit them by typing inside the fields, just as with QGIS.
Go to File –> Import to load your GPS track .gpx file. It will be symbolized in a way that is difficult to distinguish from the OSM data. There is no way to change the symbols. I recommend turning off every layer that you don’t need to make things easier to see. (Do this by clicking on the eye symbol next to the layer.) When you are ready to begin editing, go to the Create menu and select Road.

I started, once again, at the bit of footway near the parking lot.

A couple cool things will happen at this point that didn’t happen in QGIS. First, the program will snap your new line not only to the ends of the existing segments, but also to the vertices of your GPS track. This makes it easier to follow it exactly. Second, the program will automatically carry all of the tags associated with the existing segment over to your new road. You will not have to go back and add them later.
When you have finished digitizing, press the ESC key to exit creation mode. At this point, if you want, you can polish up your work by splitting and merging segments. Simply hold down the CTRL key to select multiple segments, then choose the function to apply from the Road menu.

I found the ability to do that very useful because there was a bit of North Plateau Loop that didn’t belong in the original segments. Also, I worked in pieces so I could zoom in closer, and I liked being able to merge everything into one at the end.
When you are ready to upload your changes, you will need to go to the Tools –> Preferences –> Data tab to enter your OpenStreetMap username and password. Then press the megaphone Upload button. Review and summarize your edits in the next screen.

If you’re me, this time it will work! There is now a perfect North Plateau Loop on OpenStreetMap.org for all to see.

(click to see full size)
My parting thoughts are thus:
I wish I had been able to complete the upload in QGIS, because I find the program more pleasant to work with, and I like the idea of using a single GIS package to do everything. However, Merkaartor does offer some advanced OSM editing functions that make for a cleaner final product.
In summary, these are the main benefits of each tool:
QGIS
- Full-service GIS package
- Allows for changing of symbol representation
- Allows for raster georeferencing and display
- Better interface for those familiar with ArcGIS
Merkaartor
- Allows for merging and splitting road segments
- Snaps to GPS trace vertices
- Copies tags from attached segment into extension
- Uploads OSM edits without issues
Tags: free, gps, gpx, OpenStreetMap, Web Map Service
Viewing flood zones with ArcGIS Explorer, Part 1
Problem: You need to look at some GIS data without purchasing a GIS software package.
This post is inspired by a reader question. My friend Jeremy asks,
“Is there any easy way to get at GIS data of water tables, flood zones, and stuff like that? Things that people who buy houses really should look into but seldom do.”
I cut my teeth making flood zone maps so I am quite familiar with where this data lives. I revisited the FEMA Map Service Center to give him some specific advice about where to look. My plan was to determine the easiest/fastest path to the information. To my dismay, the website has not changed much since I changed jobs. Meaning, to put it bluntly: there is no easy way.
I assume most visitors to the website would want to be able to type in an address and have that address come up as a dot on a map with the flood zone layer below it. If the dot falls within a flood zone, they’d be able to tell in one glance. Well, you can get pretty close, but you can’t exactly do that. So, instead of talking about the easiest way to get flood zone information, I’ll talk about four different ways.
I attended college at George Mason University so I decided to use the city of Fairfax as my example location. Pretend you are moving there. Because I don’t want to map a private residence, pretend you are moving there because you just got elected mayor. You want to check if your new digs at City Hall are in danger of flooding.
Method 1: FEMA’s Map Viewer
https://hazards.fema.gov/wps/portal/mapviewer
Pros
- This viewer allows you to type in an address and zoom to it.
- The map that comes up shows the flood zones in that area along with a lot of other useful information.
- There’s an identify tool that allows you access even more information about the data layers.
Here’s what I got for City Hall:

Cons
- There’s no “you are here” symbol on the map. If I’m not familiar enough with the area to already know where City Hall is, I still don’t know whether it’s in a flood zone.
- There’s too many layers turned on by default, which clutters the map, making it confusing and hard to interpret at first glance.
- The legend isn’t very helpful. It doesn’t explain what the blue-hatched Zone A is, or what the purple text LOMRs are. I only know that they are Letters of Map Revision because I used to work there.
Method 2: Product Search by Address…
Box on top-left corner of main Map Service Center screen
You can enter an address and select either a Flood Map (visual image) or DFIRM (digital database) product. The Fairfax City data is at the moment only available as a DFIRM, which I will discuss later in method 4. For now, I’ll enter the address of nearby GMU campus to bring up the Flood Map of surrounding Fairfax County.

Pros
- A beautiful looking map (If I don’t say so myself) which is simple and easy to interpret, and also happens to be the authoritative flood zone representation product.
- A good legend which explains in detail what the flood zone designations mean.
Cons
- Obviously no “you are here” symbol on this static map.
- And, it’s even harder to pinpoint an exact location than in the Map Viewer, because these maps only show major roads, and most of the time use route numbers instead of road names.
It isn’t hard to see why people may feel the need to look elsewhere to determine if their prospective property is really in a flood zone. Maybe that’s why a google search for “flood zone data” brings up companies that will research this for you if you pay them. There are, however, other ways, which are free or almost free.
Method 3: FEMA’s Web Map Service (WMS) & ArcGIS Explorer
https://hazards.fema.gov/femaportal/wps/portal/NFHLWMSe
A web map service is a computer program that will query a database and deliver the results back in the form of a dynamically generated map. FEMA makes the National Flood Hazard Layer available for free through a WMS. You need to have GIS software in order to read WMS data. However, if you don’t have access to the ArcGIS Desktop package that I regularly blog about, you aren’t locked out from playing. You just need to grab a copy of ArcGIS Explorer: “GIS for Everyone” at http://www.esri.com/software/arcgis/explorer/index.html

Once you’ve installed and opened the program, press the Add Content icon on the main toolbar. Select GIS Services… and then press New Server Connection. For the server type, chose WMS, and then enter the Server address that FEMA gives on their tool description page:
http://hazards.fema.gov/wmsconnector/wmsconnector/Servlet/NFHL?

You’ll then be given a list of services to choose from. Flood Hazard Zones (General) is the main one. If you pick that, then enter your address in the Find box on the left side of the screen, the globe will whirl around until you see this.
Eureka! Now I know City Hall isn’t in a flood zone!

(I changed the Basemap to Streets)
Stay tuned, in two weeks I will post about Method 4: Using DFIRM Shapefiles. The best is yet to come.
Tags: ArcGIS Explorer, flood zone, Web Map Service
