Opened 7 years ago

Closed 5 years ago

#3409 closed defect (fixed)

d.what.vect JSON issue with OSM data

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Display Version: svn-releasebranch72
Keywords: d.what.vect, v.what Cc:
CPU: x86-64 Platform: Linux

Description

I have imported successfully an OSM pbf file, can display it but not query:

ScriptError(_("v.what output is not valid JSON format:

(screenshot attached since the error cannot be copy-pasted, no text selection possible)

To reproduce:

# (51MB)
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf 


grass72 -c epsg:4326 ~/grassdata/latlong_wgs84
v.in.ogr input=berlin-latest.osm.pbf type=point,line output=roads
g.region vector=roads -p
d.mon wx0  # same issue with g.gui
d.vect roads
d.what.vect roads
# --> JSON error

Here an example for v.what output not parsable by d.what.vect (note: this is not exactly the same position as in the error msg screenshot):

v.what roads coordinates=13.3926375553,52.5548668929 -a
East: 13:23:33.495199E
North: 52:33:17.520814N
------------------------------------------------------------------
Map: roads 
Mapset: osm
Type: Point
Id: 34721
Layer: 1
Category: 34721

Driver: sqlite
Database: /home/mneteler/grassdata/latlong_wgs84/osm/sqlite/sqlite.db
Table: roads_1
Key column: cat
cat : 34721
osm_id : 631984925
name : 
barrier : 
highway : 
ref : 
address : 
is_in : 
place : 
man_made : 
other_tags : "addr:city"=>"Berlin","addr:street"=>"Bornholmer Straße","addr:suburb"=>"Gesundbrunnen","addr:country"=>"DE","addr:postcode"=>"13359","addr:housenumber"=>"50"

Some more "escaping" might be needed here?

Attachments (1)

gui_query_json_error_OSM.png (22.6 KB ) - added by neteler 7 years ago.
d.what.vect error message (copy-paste not possible unfortunately)

Download all attachments as: .zip

Change History (9)

by neteler, 7 years ago

d.what.vect error message (copy-paste not possible unfortunately)

in reply to:  description comment:1 by mmetz, 7 years ago

Replying to neteler:

I have imported successfully an OSM pbf file, can display it but not query:

[...]

Here an example for v.what output not parsable by d.what.vect (note: this is not exactly the same position as in the error msg screenshot):

v.what roads coordinates=13.3926375553,52.5548668929 -a
East: 13:23:33.495199E
North: 52:33:17.520814N
------------------------------------------------------------------
Map: roads 
Mapset: osm
Type: Point
Id: 34721
Layer: 1
Category: 34721

Driver: sqlite
Database: /home/mneteler/grassdata/latlong_wgs84/osm/sqlite/sqlite.db
Table: roads_1
Key column: cat
cat : 34721
osm_id : 631984925
name : 
barrier : 
highway : 
ref : 
address : 
is_in : 
place : 
man_made : 
other_tags : "addr:city"=>"Berlin","addr:street"=>"Bornholmer Straße","addr:suburb"=>"Gesundbrunnen","addr:country"=>"DE","addr:postcode"=>"13359","addr:housenumber"=>"50"

Some more "escaping" might be needed here?

Alternatively you can use a osmconf.ini file http://gdal.org/drv_osm.html to 1) avoid the creation of the other_tags field, 2) select some of the OSM keys summarized in the other_tags field.

comment:2 by neteler, 7 years ago

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:3 by martinl, 6 years ago

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:4 by martinl, 6 years ago

Milestone: 7.2.4

comment:5 by annakrat, 5 years ago

Is r74048 perhaps related?

in reply to:  5 comment:6 by mmetz, 5 years ago

Replying to annakrat:

Is r74048 perhaps related?

Yes, same problem of double quotes within double quotes.

comment:7 by martinl, 5 years ago

Still relevant?

comment:8 by neteler, 5 years ago

Milestone: 7.2.47.6.2
Resolution: fixed
Status: newclosed

Tested in 7.6 and trunk, working now. Closing.

Note: See TracTickets for help on using tickets.