[gdal-dev] OSM - delineation of rivers

Even Rouault even.rouault at spatialys.com
Sun Jan 1 10:41:57 PST 2017


On dimanche 1 janvier 2017 18:17:58 CET Simon Lyngby Kokkendorff wrote:
> Dear List,
> 
>   I have some issues getting river boundaries out of OSM data when using
> GDAL to read e.g. an OSM xml file downloaded via the overpass API. Using
> 
> e.g.:
> >ogr2ogr -t_srs EPSG:3857 -f SQLITE -dsco SPATIALITE=YES --config
> 
> OSM_USE_CUSTOM_INDEXING NO map.sqlite map.osm
> 
> >ogrinfo --version
> 
> GDAL 2.1.0, released 2016/04/25
> 
> Specifically I have been trying with the River Thames in London. For some
> parts of the river it works, and I get features in the 'lines' layer with
> waterway='riverbank', that are closed. But for many locations I get no
> features (lines or multlipolygons) that can be used to bound the river -
> links to some images and OSM data below.
> 
> When running the ogr2ogr command, I do get an errror:
> 
> ERROR 1: Too many tags in relation 62149,
> 
> which is not unusual though..

I've just fixed in trunk this error, but this is not directly related to the issue you have.

I presume osm2pgsql is more tolerant when parsing relations where some members are 
missing. Currently the OGR OSM driver gives up building a multipolygon as soon as a member 
is missing. This is my hypothesis for the missing geometries (that should be confirmed by 
identifying the OSM id of the objects imported by osm2pgsql and missing in OGR OSM 
output)

This is for example the case for  <relation id="28934"> "River Thames".

No solution except improving OGROSMDataSource::BuildMultiPolygon() in ogr/ogrsf_frmts/
osm ;-) or extracting a larger extent around the area of interest so that relations aren't 
truncated.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170101/4b157f90/attachment.html>


More information about the gdal-dev mailing list