[gdal-dev] OSM - delineation of rivers

Simon Lyngby Kokkendorff silyko at gmail.com
Sun Jan 1 13:52:18 PST 2017


And indeed - worked like a charm when I ran ogr2ogr on a pbf file
containing the whole of England. The River Thames is represented nicely, as
was the case with osm2pgsql. Was surprisingly fast also compared to
osm2pgsql!

So definitely a "too small area" issue!

Thanks again, and sorry for the noise!
Simon


On Sun, Jan 1, 2017 at 9:15 PM, Simon Lyngby Kokkendorff <silyko at gmail.com>
wrote:

> Thanks Even,
>
>  I'll try to see if I can fix the issue for that particular location by
> including a larger area. Was just puzzled because things were working fine
> at other locations along the river, and for some other rivers, even with a
> smaller area. But perhaps that's due to river polygons being smaller.
> Also I was cheating a bit with osm2pgsql which was run on a much larger
> area - since I thought the problem wasn't due to the area being too small.
> But makes completely sense of course, that this could be the issue -
> somehow assumed that the overpass API would return all "relevant" features
> intersecting the bounding box.
>
> Will test a bit more 😄
>
> Cheers,
> Simon
>
> Den 01/01/2017 7.41 PM skrev "Even Rouault" <even.rouault at spatialys.com>:
>
>> 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/58eb6a98/attachment.html>


More information about the gdal-dev mailing list