Opened 14 years ago

Closed 6 years ago

#1021 closed enhancement (wontfix)

v.in.ogr: multiple files are merged when using only dsn= without layer=

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Vector Version: svn-releasebranch64
Keywords: ogr Cc: pcav
CPU: All Platform: All

Description

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.

Change History (7)

comment:1 by mmetz, 14 years ago

Milestone: 6.4.07.0.0

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.

comment:2 by martinl, 8 years ago

Milestone: 7.0.07.0.5

comment:3 by martinl, 8 years ago

Milestone: 7.0.57.3.0
Type: defectenhancement

comment:4 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:5 by martinl, 6 years ago

What is status of this issue?

in reply to:  5 comment:6 by mmetz, 6 years ago

Replying to martinl:

What is status of this issue?

From the manual:

layer=string[,string,...]
    OGR layer name. If not given, all available layers are imported

That should be clear enough. Resolve as "read the manual"?

comment:7 by neteler, 6 years ago

Milestone: 7.4.07.0.0
Resolution: wontfix
Status: newclosed

It was opened 8 years ago (G6.4), so probably the manual got better since then :-) Closing.

Note: See TracTickets for help on using tickets.