<div dir="ltr"><div><div><div>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!<br><br></div>So definitely a "too small area" issue!<br><br></div>Thanks again, and sorry for the noise!<br></div>Simon<br> <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 1, 2017 at 9:15 PM, Simon Lyngby Kokkendorff <span dir="ltr"><<a href="mailto:silyko@gmail.com" target="_blank">silyko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Thanks Even,<div dir="auto"><br></div><div dir="auto"> 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. </div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">Will test a bit more 😄</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto">Simon</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">Den 01/01/2017 7.41 PM skrev "Even Rouault" <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'monospace';font-size:9pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">On dimanche 1 janvier 2017 18:17:58 CET Simon Lyngby Kokkendorff wrote:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Dear List,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> I have some issues getting river boundaries out of OSM data when using</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> GDAL to read e.g. an OSM xml file downloaded via the overpass API. Using</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> e.g.:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> >ogr2ogr -t_srs EPSG:3857 -f SQLITE -dsco SPATIALITE=YES --config</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> OSM_USE_CUSTOM_INDEXING NO map.sqlite map.osm</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> >ogrinfo --version</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> GDAL 2.1.0, released 2016/04/25</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Specifically I have been trying with the River Thames in London. For some</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> parts of the river it works, and I get features in the 'lines' layer with</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> waterway='riverbank', that are closed. But for many locations I get no</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> features (lines or multlipolygons) that can be used to bound the river -</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> links to some images and OSM data below.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> When running the ogr2ogr command, I do get an errror:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ERROR 1: Too many tags in relation 62149,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> which is not unusual though..</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">I've just fixed in trunk this error, but this is not directly related to the issue you have.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">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)</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">This is for example the case for <relation id="28934"> "River Thames".</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">No solution except improving OGROSMDataSource::BuildMultiPo<wbr>lygon() in ogr/ogrsf_frmts/osm ;-) or extracting a larger extent around the area of interest so that relations aren't truncated.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Even</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">-- </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></div></blockquote></div></div>
</div></div></blockquote></div><br></div>