Bug report #2571

Path to GRASS vector map loses "vector/" in path string

Added by Markus Neteler over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:Low
Assignee:Lorenzo Masini
Category:GRASS
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:invalid
Crashes QGIS or corrupts data: Copied to github as #:12631

Description

To access Quantum GIS environment from this console
use qgis.utils.iface object (instance of [[QgisInterface]] class).

>>> iface=qgis.utils.iface
>>> map=iface.mapCanvas()
>>> print map.layer(0).source()
/home/neteler/grassdata/patUTM32/mymapset/box/1_polygon
>>>

the correct path to a GRASS vector layer would be including "vector/" in the string:

/home/neteler/grassdata/patUTM32/mymapset/vector/box/1_polygon

Note: for raster layers it is ok:

>>> print map.layer(1).source()
/home/neteler/grassdata/patUTM32/neteler/cellhd/elevation

The omission of "vector/" in the string leads to troubles in ogr2ogr called by QGIS plugins.

History

#1 Updated by Redmine Admin over 9 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

layer.source() is internal data provider representation of data location. For GRASS vector provider it is GISBASE/LOCATION/MAPSET/MAP/LAYER_TYPE.

Expecting that layer.source should be a valid OGR DSN is just misunderstanding.

Warning: please don't try to change that format, it would break all old project files.

Also available in: Atom PDF