Opened 8 years ago

Closed 8 years ago

#3172 closed defect (fixed)

v.what: does not take into account layer information

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.2.0
Component: Vector Version: unspecified
Keywords: v.what layer Cc:
CPU: Unspecified Platform: Unspecified

Description

As reported by Dave Roberts and Helmut Kudrnovsky on grass-user:

g.copy vector=firestations@PERMANENT,myfire
v.category input=myfire@user1 layer=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 output=myfire_manylayers option=transfer
v.db.addtable map=myfire_manylayers@user1 layer=2
[...]
v.db.addtable map=myfire_manylayers@user1 layer=25

Gives the following output when queries by v.what:

v.what -a map=myfire_manylayers@user1 layer=25 coordinates=635642.103403,234048.276032 distance=10
East: 635642.103403
North: 234048.276032
------------------------------------------------------------------
Map: myfire_manylayers 
Mapset: user1
Type: Point
Id: 17
Layer: 1
Category: 17
Driver: sqlite
Database: J:\gisdata\nc_spm_08_grass7\user1\sqlite\sqlite.db
Table: myfire_manylayers
Key column: cat
cat : 17
ID : 0
LABEL : RFD #17
LOCATION : 4601 Pleasant Valley Rd
CITY : Raleigh
MUN_COUNT : M
PUMPERS : 1
PUMPER_TAN : 0
TANKER : 0
MINI_PUMPE : 0
RESCUE_SER : 0
AERIAL : 0
BRUSH : 0
OTHERS : 0
WATER_RESC : 0
MUNCOID : 1
BLDGCODE : 257
AGENCY : RF
STATIONID : RF17
RECNO : 19
CV_SID2 : RF17
CVLAG : 0
Layer: 2
Category: 17
Driver: sqlite
Database: J:\gisdata\nc_spm_08_grass7\user1\sqlite\sqlite.db
Table: myfire_manylayers_2
Key column: cat
cat : 17
Layer: 3
Category: 17
Driver: sqlite
Database: J:\gisdata\nc_spm_08_grass7\user1\sqlite\sqlite.db
Table: myfire_manylayers_3
Key column: cat
cat : 17
[...]
Layer: 25
Category: 17
Driver: sqlite
Database: J:\gisdata\nc_spm_08_grass7\user1\sqlite\sqlite.db
Table: myfire_manylayers_25
Key column: cat
cat : 17
xcoor : 635640.313379964
ycoor : 234048.036434468

d.what.vect and thus the GUI query are also affected.

The attached patch is an attempt to solve this for v.what. Please test.

Attachments (1)

v_what_layer.diff (617 bytes ) - added by mlennert 8 years ago.
patch to only list information about selected layer

Download all attachments as: .zip

Change History (6)

by mlennert, 8 years ago

Attachment: v_what_layer.diff added

patch to only list information about selected layer

comment:1 by annakrat, 8 years ago

In 69647:

v.what: use layer information (by mlennert), see #3172

in reply to:  1 comment:2 by hellik, 8 years ago

Replying to annakrat:

In 69647:

v.what: use layer information (by mlennert), see #3172

all layers

v.what -a map=myfire_manylayers@user1 coordinates=655179.780713,222274.755375 distance=20
East: 655179.780713
North: 222274.755375
------------------------------------------------------------------
Map: myfire_manylayers 
Mapset: user1
Type: Point
Id: 30
Layer: 1
Category: 30
Driver: sqlite
Database: /home/bugs/grassdata/nc_spm_08_grass7/user1/sqlite/sqlite.db
Table: myfire_manylayers
Key column: cat
cat : 30
ID : 38
LABEL : Eastern Wake #1
LOCATION : 4828 Clifton Rd
CITY : Knightdale
MUN_COUNT : C
PUMPERS : 1
PUMPER_TAN : 0
TANKER : 0
MINI_PUMPE : 0
RESCUE_SER : 1
AERIAL : 1
BRUSH : 1
OTHERS : 2
WATER_RESC : 1
MUNCOID : 2
BLDGCODE : 269
AGENCY : FD
STATIONID : EW2
RECNO : 32
CV_SID2 : EW2A
CVLAG : 1.83
Layer: 2
Category: 30
Driver: sqlite
Database: /home/bugs/grassdata/nc_spm_08_grass7/user1/sqlite/sqlite.db
Table: myfire_manylayers_2
Key column: cat
cat : 30
nlayer : 2
Layer: 3
Category: 30
Driver: sqlite
Database: /home/bugs/grassdata/nc_spm_08_grass7/user1/sqlite/sqlite.db
Table: myfire_manylayers_3
Key column: cat
cat : 30
nlayer : 3
Layer: 4
Category: 30
Driver: sqlite
Database: /home/bugs/grassdata/nc_spm_08_grass7/user1/sqlite/sqlite.db
Table: myfire_manylayers_4
Key column: cat
cat : 30
nlayer : 4
Layer: 5
Category: 30
Driver: sqlite
Database: /home/bugs/grassdata/nc_spm_08_grass7/user1/sqlite/sqlite.db
Table: myfire_manylayers_5
Key column: cat
cat : 30
nlayer : 5
Layer: 6
Category: 30
Driver: sqlite
Database: /home/bugs/grassdata/nc_spm_08_grass7/user1/sqlite/sqlite.db
Table: myfire_manylayers_6
Key column: cat
cat : 30
nlayer : 6

select layer

v.what -a map=myfire_manylayers@user1 layer=6 coordinates=655179.780713,222274.755375 distance=20
East: 655179.780713
North: 222274.755375
------------------------------------------------------------------
Map: myfire_manylayers 
Mapset: user1
Type: Point
Id: 30
Layer: 6
Category: 30
Driver: sqlite
Database: /home/bugs/grassdata/nc_spm_08_grass7/user1/sqlite/sqlite.db
Table: myfire_manylayers_6
Key column: cat
cat : 30
nlayer : 6

thanks for the quick fix. closing ticket or backporting first?

comment:3 by annakrat, 8 years ago

In 69756:

v.what: use layer information (by mlennert), see #3172 (merge from trunk, r69647)

comment:4 by annakrat, 8 years ago

In 69757:

v.what: use layer information (by mlennert), see #3172 (merge from trunk, r69647)

comment:5 by annakrat, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.