[GRASS-dev] [GRASS GIS] #1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Steps to reproduce:
  * Add a vector map with more than one layer
  * Go to properties -> selection
  * Layer option has only "-1" and "1" as options, "2" is missing
  * Enter "2" manually to ensure that objects are present and are rendered
correctly for layer "2".

Setting priority major as it might lead users to wrong conclusions that
only single layer is present for the vector map.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------
Changes (by annakrat):

  * keywords: => vector layer

Comment:

It lists only layers which are connected do database. Can we simply
backport this
[http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_core/gselect.py#L738
method]? There is some comment (line 763) which I don't understand much
and I am also not sure about the ''dsn'' parameter.

It might be better to move the functionality (=list all layers of vector
map) in core.utils. Currently there is a function for getting all layers
connected to DB.

Do we need to distinguish in dialogs if we want all layers or only the
ones which are connected to DB?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by annakrat):

Should be fixed in r55137. Now, layers listed with v.category (and not
v.db.connect) are shown. Please test.

Anna

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by mmetz):

Replying to [comment:2 annakrat]:
> Now, layers listed with v.category (and not v.db.connect) are shown.

Not good. This method was used some years ago, but it makes the GUI even
slower than it is already. Therefore v.category was no longer used to get
the vector's layers. v.db.connect is usually very fast, but v.category
takes some time for a larger vector.

Please revert this change.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by martinl):

Replying to [comment:3 mmetz]:
> Replying to [comment:2 annakrat]:
> > Now, layers listed with v.category (and not v.db.connect) are shown.
>
> Not good. This method was used some years ago, but it makes the GUI even
slower than it is already. Therefore v.category was no longer used to get
the vector's layers. v.db.connect is usually very fast, but v.category
takes some time for a larger vector.
>
> Please revert this change.

any other suggestion? Store number of layers in header file?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by mmetz):

Replying to [comment:4 martinl]:
> Replying to [comment:3 mmetz]:
> > Replying to [comment:2 annakrat]:
> > > Now, layers listed with v.category (and not v.db.connect) are shown.
> >
> > Not good. This method was used some years ago, but it makes the GUI
even slower than it is already. Therefore v.category was no longer used to
get the vector's layers. v.db.connect is usually very fast, but v.category
takes some time for a larger vector.
> >
> > Please revert this change.
>
> any other suggestion? Store number of layers in header file?

Alternatively, v.category could get a new option for option, something
like option=layers which would print out only layer numbers, one per line.
This would be fast if topology is available because in this case the
internal category index can be used and the vector map would need to be
opened with head only. Without topology, option=layers would print
nothing.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by annakrat):

Replying to [comment:5 mmetz]:
> Replying to [comment:4 martinl]:
> > Replying to [comment:3 mmetz]:
> > > Replying to [comment:2 annakrat]:
> > > > Now, layers listed with v.category (and not v.db.connect) are
shown.
> > >
> > > Not good. This method was used some years ago, but it makes the GUI
even slower than it is already. Therefore v.category was no longer used to
get the vector's layers. v.db.connect is usually very fast, but v.category
takes some time for a larger vector.
> > >
> > > Please revert this change.

Reverted.

> >
> > any other suggestion? Store number of layers in header file?
>
> Alternatively, v.category could get a new option for option, something
like option=layers which would print out only layer numbers, one per line.
This would be fast if topology is available because in this case the
internal category index can be used and the vector map would need to be
opened with head only. Without topology, option=layers would print
nothing.

Is this change possible now for grass 64?

Anna

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by mmetz):

Replying to [comment:6 annakrat]:
> Replying to [comment:5 mmetz]:
> > Replying to [comment:4 martinl]:
> > >
> > > any other suggestion? Store number of layers in header file?
> >
> > Alternatively, v.category could get a new option for option, something
like option=layers which would print out only layer numbers, one per line.
This would be fast if topology is available because in this case the
internal category index can be used and the vector map would need to be
opened with head only. Without topology, option=layers would print
nothing.
>
> Is this change possible now for grass 64?

In theory yes, we can add new functionality as long as existing
functionality is not changed.

Please try trunk r55140.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by annakrat):

Replying to [comment:7 mmetz]:
> Replying to [comment:6 annakrat]:
> > Replying to [comment:5 mmetz]:
> > > Replying to [comment:4 martinl]:
> > > >
> > > > any other suggestion? Store number of layers in header file?
> > >
> > > Alternatively, v.category could get a new option for option,
something like option=layers which would print out only layer numbers, one
per line. This would be fast if topology is available because in this case
the internal category index can be used and the vector map would need to
be opened with head only. Without topology, option=layers would print
nothing.
> >
> > Is this change possible now for grass 64?
>
> In theory yes, we can add new functionality as long as existing
functionality is not changed.
>
> Please try trunk r55140.

Thanks, it works, could you backport it (at least the v.category part)?

Anna

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by mmetz):

Replying to [comment:8 annakrat]:
> Replying to [comment:7 mmetz]:
> > Replying to [comment:6 annakrat]:
> > > Replying to [comment:5 mmetz]:
> > > > Replying to [comment:4 martinl]:
> > > > >
> > > > > any other suggestion? Store number of layers in header file?
> > > >
> > > > Alternatively, v.category could get a new option for option,
something like option=layers which would print out only layer numbers, one
per line. This would be fast if topology is available because in this case
the internal category index can be used and the vector map would need to
be opened with head only. Without topology, option=layers would print
nothing.
> > >
> > > Is this change possible now for grass 64?
> >
> > In theory yes, we can add new functionality as long as existing
functionality is not changed.
> >
> > Please try trunk r55140.
>
> Thanks, it works, could you backport it (at least the v.category part)?

I have backported the v.category part in r55142-3.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by annakrat):

Replying to [comment:9 mmetz]:
> I have backported the v.category part in r55142-3.

Thanks, the rest is done r55145. Please, could others test?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by mlennert):

Replying to [comment:10 annakrat]:
> Replying to [comment:9 mmetz]:
> > I have backported the v.category part in r55142-3.
>
> Thanks, the rest is done r55145. Please, could others test?

A quick test here doesn't show any problems. Seems to work for me on
Debian GNU/Linux.

Moritz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by hamish):

Hi,

sorry I am coming late to this conversation, and I mostly work with
rasters so am a bit thin on the category layer know-how, but to summarize,
the trouble was that you can have multiple layers of categories connected
to topological data features within the same map, and each of those layers
may or may not have a DB connection specified in vector/$MAP/dbln, right?

So using `v.db.connect -g` only listed the layers with DB connections, and
missed the layers that existed as category-only.
But the new v.category option will list all that exist w/ or w/o a DB
connection. (note not used very much, but as in `v.db.connect -g` the
layer number can have a /name alias too. that might only be widely used in
DBs like Oracle, or a "for the future" idea from Radim?)

is that right?

To help me visualize using layers better, could someone suggest a use case
for when you'd use this? (the whole thing is a little mysterious to me)

trying to understand,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1605#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by marisn):

Replying to [comment:12 hamish]:
> To help me visualize using layers better, could someone suggest a use
case for when you'd use this? (the whole thing is a little mysterious to
me)

Here You go: https://trac.osgeo.org/grass/ticket/1606#comment:8

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1605#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Keywords: vector layer | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------

Comment(by mlennert):

Replying to [comment:12 hamish]:
> To help me visualize using layers better, could someone suggest a use
case for when you'd use this? (the whole thing is a little mysterious to
me)

Check out:

[http://grass.osgeo.org/grass64/manuals/vectorintro.html\] ("Vector object
categories and attribute management")

and

for the network analysis cases Maris hinted at:

[http://grass.osgeo.org/grass64/manuals/v.net.html\]

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1605#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#1605: WXGUI d.vect doesn't offer all vector map layers in a dropdown list
--------------------------+-------------------------------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.2
Resolution: fixed | Keywords: vector layer
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by annakrat):

  * status: new => closed
  * resolution: => fixed

Comment:

Tested successfully also on Windows so I close the ticket.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1605#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>