[gdal-dev] How does GDAL OSM driver deal with closed ways?
issworld2000 at yahoo.com
Mon Dec 5 05:00:50 PST 2016
Thank you Jukka!
I wasn't precise enough: particular closed way is not sent to both multipolygons.shp and lines.shp. It is sent to the lines.shp, and I am wondering why hasn't it been sent to the multipolygons.shp.
But your detailed explanation helped me realize that this building footprint does not have the "building" key, only "building:levels". And as "building:levels" is not included in osmconf.ini file's line:
it seems that this is why OSM driver sent it to the lines.shp.
I will definitively read through the links you gave me Jukka. Thank you.
Until then, do you mind if I ask just for a tiny clarification?
> The default rendering style file has such a list
Is this the part of that file that I need to take a look at:
> and you can find it also from the osmconf.ini file
But osmconf.ini file only defines the polygons keys, not linear ones?
This is the line in osmconf.ini which defines polygon keys:
On Monday, December 5, 2016 10:36 AM, jratike80 <jukka.rahkonen at maanmittauslaitos.fi> wrote:
In OSM it is a bit fuzzy what closed linestrings mean. Partly it is based on
known and agreed semantics which may be documented in
wiki.openstreetmap.org/wiki/Map_Features. So a closed linestring is a
polygon if is has any building tag, but a closed linestring
"junction=roundabout" is a closed linestring. One can try to make a list
about which closed linestrings are always polygons by sorting the wiki page,
or then you can rely on the previous work. The default rendering style file
has such a list
https://github.com/openstreetmap/osm2pgsql/blob/master/default.style and you
can find it also from the osmconf.ini file
However, users can use the override tag "area=yes/no" for changing the
interpretation. A way with tags highway=service, area=yes means polygon.
Also, as you can read from http://wiki.openstreetmap.org/wiki/Key:area, a
way can have one tag that makes it into polygon and another tag that means a
closed linestring at the same time.
For analyzing why you have now some way in both multipolygons and lines
tables you must take the osm_id from the lines or osm_way_id from the
multipolygons and check the data from the native OSM data. I can't show such
example right ahead but you will find examples from your own data. Take the
id and make a query like this
Check all the tags of the feature. If you still do not find a reason why it
goes into both polygon and linestring tables you can mail us the link.
However, the OSM data model differs so much from the traditional GIS model
with simple features and fixed schema that conversion from OSM to GIS tends
to be lossy.
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-How-does-GDAL-OSM-driver-deal-with-closed-ways-tp5298544p5298582.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
gdal-dev mailing list
gdal-dev at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev