Opened 3 years ago

Closed 19 months 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 3 years ago.
d.what.vect error message (copy-paste not possible unfortunately)

Download all attachments as: .zip

Change History (9)

Changed 3 years ago by neteler

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

comment:1 in reply to:  description Changed 3 years ago by mmetz

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 Changed 3 years ago by neteler

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:3 Changed 3 years ago by martinl

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:4 Changed 3 years ago by martinl

Milestone: 7.2.4

comment:5 Changed 22 months ago by annakrat

Is r74048 perhaps related?

comment:6 in reply to:  5 Changed 22 months ago by mmetz

Replying to annakrat:

Is r74048 perhaps related?

Yes, same problem of double quotes within double quotes.

comment:7 Changed 19 months ago by martinl

Still relevant?

comment:8 Changed 19 months ago by neteler

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.