Opened 15 years ago
Closed 7 years ago
#1021 closed enhancement (wontfix)
v.in.ogr: multiple files are merged when using only dsn= without layer=
Reported by: | neteler | Owned by: | |
---|---|---|---|
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 , 15 years ago
Milestone: | 6.4.0 → 7.0.0 |
---|
comment:2 by , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
comment:3 by , 8 years ago
Milestone: | 7.0.5 → 7.3.0 |
---|---|
Type: | defect → enhancement |
comment:6 by , 7 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 , 7 years ago
Milestone: | 7.4.0 → 7.0.0 |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
It was opened 8 years ago (G6.4), so probably the manual got better since then :-) Closing.
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.