[GRASS-user] GRASS7.2: v.in.osm add-on / Windows 8

Helmut Kudrnovsky hellik at web.de
Mon Jan 23 06:40:54 PST 2017


"Peter Löwe" wrote
> Hi GRASS-User list,
> 
> I'm currently using GRASS7.2 on Windows 8.
> 
> The v.in.osm add-on
> (https://grass.osgeo.org/grass72/manuals/addons/v.in.osm.html) refuses to
> work in this setting. I would be grateful for any ideas how to overcome
> this.
> 
> Reference example from the man-page:
> v.in.osm input=saarland-latest.osm.pbf table=lines type=point,line
> output=roads \
>          where="highway is not null"
> 
> Unfortunately this does not work for me:
> v.in.osm input=c:\\hessen-latest.osm.pbf table=lines type=point,line
> output=test_00 where="highway is not null"
> - prints multiple warning that column widths for the attributes
> osm_id,name, barrier, highway,ref,address, is_in,place,man_made,other_tags
> will be truncated to 255 characters 
> - terminates with "WARNING: No data base element files found"
> 
> The pbf itself seems to be valid, the "-l" flag lists the tables as
> points,lines,multilinestrings,multipolygons and other_relations.

a quick closer look into v.in.osm, it's just a wrapper around v.in.ogr

tested:

v.in.ogr input=D:\dl\osm\saarland-latest.osm.pbf layer=lines
output=roadsvingor where=highway is not null
Check if OGR layer <lines> contains polygons...
WARNING: Width for column osm_id set to 255 (was not specified by OGR), some
strings may be truncated!
WARNING: Width for column name set to 255 (was not specified by OGR), some
strings may be truncated!
WARNING: Width for column highway set to 255 (was not specified by OGR),
some strings may be truncated!
WARNING: Width for column waterway set to 255 (was not specified by OGR),
some strings may be truncated!
WARNING: Width for column aerialway set to 255 (was not specified by OGR),
some strings may be truncated!
WARNING: Width for column barrier set to 255 (was not specified by OGR),
some strings may be truncated!
WARNING: Width for column man_made set to 255 (was not specified by OGR),
some strings may be truncated!
WARNING: Width for column other_tags set to 255 (was not specified by OGR),
some strings may be truncated!
Importing -1 features (OGR layer <lines>)...
-----------------------------------------------------
Building topology for vector map <roadsvingor at osm>...
Registering primitives...
104808 primitives registered
781261 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 143707
Number of primitives: 104808
Number of points: 0
Number of lines: 104808
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0

just imported all lines where there is an entry in the "highway" column for
me.

it's what in
https://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.in.osm/v.in.osm.py#L117

117	            grass.run_command('v.in.ogr',
118	                             quiet=True,
119	                             input=options['input'],
120	                             output=self.getNewTmp('ogr'),
121	                             layer=options['table'],
122	                             where=options['where'],
123	                             type=options['type'],
124	                             flags=flags['o']
125	                            )

if you do ogrinfo -al -so saarland-latest.osm.pbf, you see the structure of
the osm.pbf file:

e.g.

Layer name: lines
Geometry: Line String
Feature Count: -1
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]
osm_id: String (0.0)
name: String (0.0)
highway: String (0.0)
waterway: String (0.0)
aerialway: String (0.0)
barrier: String (0.0)
man_made: String (0.0)
z_order: Integer (0.0)
other_tags: String (0.0)



-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/GRASS7-2-v-in-osm-add-on-Windows-8-tp5304461p5304471.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list