[GRASS-dev] [GRASS GIS] #1021: v.in.ogr: multiple files are merged when using only dsn= without layer=

#1021: v.in.ogr: multiple files are merged when using only dsn= without layer=
---------------------+------------------------------------------------------
Reporter: neteler | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Vector | Version: svn-releasebranch64
Keywords: ogr | Platform: All
      Cpu: All |
---------------------+------------------------------------------------------
When pointing v.in.ogr to a directory which contains several SHAPE files
(or presumably
other OGR supported files) by defining dsn= without using layer=, it
imports all files
into the output map which is typically undesired.

Suggestion: add a check if the DSN is file based and if layer= was
omitted, in
that case refuse to importand complain about the missing layer= parameter.

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

#1021: v.in.ogr: multiple files are merged when using only dsn= without layer=
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch64
Resolution: | Keywords: ogr
  Platform: All | Cpu: All
----------------------+-----------------------------------------------------
Changes (by mmetz):

  * milestone: 6.4.0 => 7.0.0

Comment:

But if dsn points to a shapefile directly and layer is omitted, only this
one shapefile is imported. And a directory may hold only one shapefile, so
only one layer would be imported anyways.

Alternative: have a new -a flag to import all layers in given dsn. Without
-a flag, if only one layer is found, import it, if more layers are found,
list them (same like -l flag) and exit with a helpful message like "Please
select layer to be imported or import all with -a". I would like to
preserve the possibility to import all layers in a given (file-based) dsn,
e.g. a *.gpx or *.kml file, but since the most common usage seems to be
importing one OGR layer only, importing several OGR layers into one GRASS
vector map could be triggered by this new flag. Disadvantage is that this
adds yet another option to v.in.ogr.

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