[GRASS-dev] v.in.osm working?

Markus Neteler neteler at osgeo.org
Thu Aug 24 01:40:35 PDT 2017


On Thu, Aug 24, 2017 at 9:30 AM, Markus Metz
<markus.metz.giswork at gmail.com> wrote:
> On Tue, Aug 22, 2017 at 8:37 PM, Markus Neteler <neteler at osgeo.org> wrote:
>> Hi,
>>
>> does v.in.osm actually work? I am trying to import from a OSM PBF
>> file, for example:
>>
>> http://download.geofabrik.de/europe/germany/berlin.html
>> --> berlin-latest.osm.pbf (51MB)
>>
>> grass72 ~/grassdata/latlong_wgs84/osm
...

> You can use v.in.ogr directly for OSM PBF files
> (http://gdal.org/drv_osm.html).

v.in.ogr input=~/Downloads/berlin-latest.osm.pbf type=point,line output=roads
...
Number of nodes: 177060
Number of primitives: 743673
Number of points: 550356
Number of lines: 193317
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0

Nice!

GRASS 7.2.2svn (latlong_wgs84):~ > v.db.connect -p roads
Vector map <roads> is connected by:
layer <1/points> table <roads_1> in database
</home/mneteler/grassdata/latlong_wgs84/osm/sqlite/sqlite.db> through
driver <sqlite> with key <cat>
layer <2/lines> table <roads_2> in database
</home/mneteler/grassdata/latlong_wgs84/osm/sqlite/sqlite.db> through
driver <sqlite> with key <cat>
layer <3/multilinestrings> table <roads_3> in database
</home/mneteler/grassdata/latlong_wgs84/osm/sqlite/sqlite.db> through
driver <sqlite> with key <cat>
layer <4/multipolygons> table <roads_4> in database
</home/mneteler/grassdata/latlong_wgs84/osm/sqlite/sqlite.db> through
driver <sqlite> with key <cat>
layer <5/other_relations> table <roads_5> in database
</home/mneteler/grassdata/latlong_wgs84/osm/sqlite/sqlite.db> through
driver <sqlite> with key <cat>

Problem:
Only vector queries in the GUI fail with a JSON error. It will be some
"escape" issue.
I have opened a ticket for that: https://trac.osgeo.org/grass/ticket/3409

> BTW, with GDAL 2.2.1, using OGR_INTERLEAVED_READING=YES does not work for me
> (empty vector).

I got here:

gdal-config --version
2.1.3

v.in.ogr
...
Check if OGR layer <points> contains polygons...
ERROR 1: Too many features have accumulated in lines layer. Use
OGR_INTERLEAVED_READING=YES mode
Warning 1: organizePolygons() received an unexpected geometry.
Either a polygon with interior rings, or a polygon with less than 4 points,
or a non-Polygon geometry.  Return arguments as a collection.
 100%
Check if OGR layer <lines> contains polygons...
 100%
Check if OGR layer <multilinestrings> contains polygons...
 100%
Check if OGR layer <multipolygons> contains polygons...
 100%
Check if OGR layer <other_relations> contains polygons...
 100%
...

However, the roads are imported.

markusN


More information about the grass-dev mailing list