OSM Inspector/WxS
The OSM Inspector uses WMS and WFS OGC standards internally to exchange data between the server and your web browser. If you want to use the OSM Inspector data outside the OSM Inspector web interface, you can use the same API calls to get to the data. This would allow you, for instance, to create your own OSM Inspector user interface. Or you can use the data in your own projects.
| The following describes an internal interface of OSM Inspector. Everything might change without notice. Especially layer names and the attributes of these layers can change at any time. We encourage everybody who wants to use the data to subscribe to the OSM Inspector mailing list at [1] where changes will be announced. Do not use data from OSM Inspector for anything drastic like automated changes to the OSM database without making really sure that you know what you are doing and the data you get is what you expect! |
Contents |
WMS access
The overlays you see in the OSM Inspector are generated from a WMS server. You can access the WMS server in any GIS client, just give it the following WMS URL:
http://tools.geofabrik.de/osmi/view/NAME_OF_VIEW/wxs?
For NAME_OF_VIEW use one of the names of a view like this:
http://tools.geofabrik.de/osmi/view/addresses/wxs?
The trailing question mark is important.
You can get a list of available views from here:
http://tools.geofabrik.de/osmi/view
As usual you send a GetCapbilities request to find out which layers are available:
http://tools.geofabrik.de/osmi/view/addresses/wxs?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities
Note that the available layers might be different from what you see in the web user interface, because the web site sometimes adds several internal layers to one visible external layer to make things easier for users. This is most often used to show one layer on higher zoom levels with more details and one layer on smaller zoom level that only show some colored dots for the areas where information is available.
WMS access in JOSM
JOSM can also access WMS servers with the WMS Plugin. JOSM doesn't have a full WMS implementation, so the use is a bit more complicated.
Add the following URL to the list of WMS servers in the preferences:
http://tools.geofabrik.de/osmi/view/NAME_OF_VIEW/wxs?REQUEST=GetMap&SERVICE=wms&VERSION=1.1.1&FORMAT=image/png&SRS=EPSG:4326&STYLES=&LAYERS=NAME_OF_LAYER&
For instance if you want to see the bodies_of_water layer in the water view, the URL is:
http://tools.geofabrik.de/osmi/view/water/wxs?REQUEST=GetMap&SERVICE=wms&VERSION=1.1.1&FORMAT=image/png&SRS=EPSG:4326&STYLES=&LAYERS=bodies_of_water&
WMS access in Merkaartor
You can add WMS servers with Tools → WMS Servers Editor. Enter a name and the URL (replacing NAME_OF_VIEW with your desired view)
http://tools.geofabrik.de/osmi/view/NAME_OF_VIEW/wxs?
Press the button Get Capabilities and wait a few moments. The list below the button should be filled with the available layers. Select one ore more layers you want to use and press Add. Afterwards you can add a new background layer by selecting Layers → Add new image layer. Right click on the added layer in the layer dock and select WMS adapter → The entry you created.
WFS access
With WMS you can get fully rendered maps, with WFS you can get to the raw data. All the data that you see in the OSM Inspector can be accessed through WFS requests.
The WFS URL is the same as the WMS URL:
http://tools.geofabrik.de/osmi/view/NAME_OF_VIEW/wxs?
Say you want all the buildings with addresses in Karlsruhe. You can then use the following URL:
http://tools.geofabrik.de/osmi/view/addresses/wxs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&BBOX=8.3,48.95,8.5,49.04&TYPENAME=buildings_with_addresses
This will get you the contents of the buildings_with_addresses layer in the addresses view in the GML format.
Make sure you always use a BBOX on your WFS request, otherwise you'll get all the data in the layer and the download can take a long time!
The WFS server (www.mapserver.org) understands version 1.0.0 and 1.1.0. Coordinates must be given in EPSG:4326 (longitude/latitude).