Coverage of SHP-Files or what is the best way to read data?

Hi everyone,
in my current project I need to use OSM data in order to identify different places.

My idea was the following:

  1. I download OSM exports in a regular period either in OSM or SHP file format.
  2. I import the data into my database (f.e. postgreSQL)
  3. From there I can use my custom queries

Now I have the following problem:
In one case for example, I need to identify all lakes (water areas) in a certain bounding box.
If I look at OpenStreetMap I can find a certain lake, for example the “Seggeluchbecken” in Berlin, which is somewhere here: 52.6038,13.3496 (lat/lng). By using the JOSM tool
or even by querying the XAPI I can find the lake (f.e. here: http://open.mapquestapi.com/xapi/api/0.6/way[natural=water][bbox=13.3453,52.6006,13.3496,52.6038]).
As you can see, the lake is located correctly.

My problem is, that if I download the SHP file (f.e. this one http://download.geofabrik.de/openstreetmap/europe/germany/berlin.shp.zip)) I can not find this lake anymore.
In the shapefile there is the natural layer, but here I do not find the lake anymore.

Therefore I want to know, where my failure is. Is it not a good idea to use shapefiles? Are they not complete?

Thanks for your answers.
Fritz

I think I’m getting a bit closer to the actual problem:

The “Seggeluchbecken” and other lakes are described as a “relation” and therefore are not displayed correctly.

There is still something strange here. If I call the XAPI the response is something like this:


<osm version="0.6" generator="Osmosis SNAPSHOT-r26564">
  <bound box="52.60060,13.34530,52.60380,13.34960" origin="Osmosis SNAPSHOT-r26564"/>
  <node id="305565912" version="1" timestamp="2008-10-19T07:59:35Z" uid="12983" user="jorilla" changeset="434900" lat="52.6014412" lon="13.3480799"/>
  ...
  <way id="4802803" version="5" timestamp="2010-02-14T21:18:35Z" uid="233061" user="unsinn" changeset="3878646">
    <nd ref="30820616"/>
    ...
    <tag k="name" v="Seggeluchbecken"/>
    <tag k="natural" v="water"/>
  </way>
</osm>

So the name is displayed correctly within the “way”. If I look to the OSM-File, it is written like this:

<relation id="444583" version="3" timestamp="2012-08-04T11:48:41Z" changeset="12608449" uid="534149" user="lurlrlrl">
                <member type="way" ref="4802803" role="outer"/>
                <member type="way" ref="27835164" role="inner"/>
                <tag k="name" v="Seggeluchbecken"/>
                <tag k="natural" v="water"/>
                <tag k="type" v="multipolygon"/>
</relation>

So here, only the relation has got the name, but not the referred outer polygon/way.

Any idea why this is gonna happen?

Hi Fritz,

whether using shapefiles or raw OSM data will depend on how you will work on the data finally … but from my experience from the last past years, shapefiles are used quite seldomly.

Almost all up-to-date webservices that offer OSM-based maps use a database where raw OSM data are imported directly. There are many possibilities.

You can also try QuantumGIS … it can work with both, OSM and shapefiles.

Or download an OSM data extract from geofabrik.de … do some nice things with osmosis or http://wiki.openstreetmap.org/wiki/Osmfilter … and display the result in any renderer or even in JOSM.

In the OSM wiki there all information you need.

By the way: If you prefer German language I recommend the highly active german speaking subforum here!

Hi Stephan,
thanks for your information. By playing around I found out, that working with the OSM files is really a bit easier.

Actually I want to have the data within a postgis database. The most important thing is, that I am able to query my database with geo queries to find out if there is a lake within my bounding box for example. The database must be able to understand the spatial queries. My last osmosis import is only showing a lot of points, but no way/polygon.

I want to use the GeoTools Library behind my postgis database.