[GRASS-dev] [GRASS GIS] #3292: Query on spatially overlapped features in one vector map

GRASS GIS trac at osgeo.org
Tue Feb 28 11:37:23 PST 2017


#3292: Query on spatially overlapped features in one vector map
--------------------------+-------------------------
  Reporter:  hcho         |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.4.0
 Component:  Vector       |    Version:  svn-trunk
Resolution:               |   Keywords:  query
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by hcho):

 Check r70700. -m flag should output valid JSON.

 {{{
 v.what -d map=bridges at PERMANENT coordinates=641178,235089 distance=100 -jm
 }}}
 outputs
 {{{
 {
    "Coordinates":{
       "East":"641178",
       "North":"235089"
    },
    "Maps":[
       {
          "Map":"bridges",
          "Mapset":"PERMANENT",
          "Features":[
             {
                "Feature_max_distance":100.000000,
                "Id":3985,
                "Type":"Point",
                "Left":0,
                "Right":0,
                "Categories":[
                   {
                      "Layer":1,
                      "Category":3985
                   }
                ]
             }
          ]
       }
    ]
 }
 }}}

 Another example JSON output:
 {{{
 {
    "Coordinates":{
       "East":"3303269.05023",
       "North":"504062.5"
    },
    "Maps":[
       {
          "Map":"lfp",
          "Mapset":"tmp",
          "Features":[
             {
                "Type":"Line",
                "Id":537,
                "Length":55131.571388,
                "Categories":[
                   {
                      "Layer":1,
                      "Category":215646882
                   }
                ]
             },
             {
                "Type":"Line",
                "Id":328,
                "Length":67346.659403,
                "Categories":[
                   {
                      "Layer":1,
                      "Category":124085340
                   }
                ]
             },
             {
                "Type":"Line",
                "Id":536,
                "Length":69806.020152,
                "Categories":[
                   {
                      "Layer":1,
                      "Category":215016485
                   }
                ]
             },
             {
                "Type":"Line",
                "Id":183,
                "Length":97443.201949,
                "Categories":[
                   {
                      "Layer":1,
                      "Category":62974869
                   }
                ]
             },
             {
                "Type":"Line",
                "Id":326,
                "Length":86823.383054,
                "Categories":[
                   {
                      "Layer":1,
                      "Category":122824546
                   }
                ]
             },
             {
                "Type":"Line",
                "Id":535,
                "Length":83302.062710,
                "Categories":[
                   {
                      "Layer":1,
                      "Category":214386088
                   }
                ]
             }
          ]
       }
    ]
 }
 }}}

 Now, it would be great if you could implement a new query button for
 multiple queries.

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



More information about the grass-dev mailing list