[GRASS-dev] [GRASS GIS] #3744: Vector query error

GRASS GIS trac at osgeo.org
Wed Jan 30 12:03:00 PST 2019


#3744: Vector query error
------------------------+-------------------------------------
  Reporter:  balagates  |      Owner:  grass-dev@…
      Type:  defect     |     Status:  new
  Priority:  normal     |  Milestone:
 Component:  wxGUI      |    Version:  svn-releasebranch76
Resolution:             |   Keywords:  vector query error JSON
       CPU:  OSX/Intel  |   Platform:  MacOSX
------------------------+-------------------------------------

Comment (by mmetz):

 Replying to [ticket:3744 balagates]:
 > For some vector elements I get an error
 >
 >
 > {{{
 > Failed to query vector map(s) <mrds_id at brett>. Check database settings
 and topology.
 >
 > Reason: ""}}]}]}]}
 > ...
 > ScriptError: v.what output is not valid JSON format:
 > }}}
 >
 > Within this vector other points query successfully.  My vector mrds_id
 is Mineral Resource Data System records for mines in Idaho.  Within Grass
 the data is in a sqlite database.  Using sqlitebrowser I see no obvious
 problems on elements that generate query errors.
 >
 > I suspect the failure is either related to 1) the length of the vector
 info (number of elements, number of characters, etc) or 2) some special
 characters within the vector info (maybe parenthesis).  The failure
 happens on maybe 10% of the vector points.
 >
 > A picture of the error is attached

 The reason for the failure is most probably the entry for "reporter" which
 has double quotes within double quotes, causing a parse error. A solution
 could be to escape double quotes within a text field, e.g.

 {{{
 "reporter":"\"Peters, DonaldW.\",\"Loen, Jeffrey S. (Pearson, Robert
 C.)\""
 }}}

 This would need to be fixed in v.what, somewhere around what.c:L93.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3744#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list