-
-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] v.in.ogr: Link to database table is broken after importing a new .shp file #3604
Comments
My principal question is: what is the classical proper way to import .shp files to preserve linking. My LOCATION serve as a database with some rasters and vectors that are always there (they are very big). My script imports any chosen watershed file and cuts big rasters and select vectors with this polygon. So I want to cleanly import and then remove working polygon without destructing the database. |
I think there are two problems described in one post, but I trust they come from the unique root. To be honest, I can't describe exactly the moment when the database looses the link. |
Shapefile e.g. hybas_lake_eu_lev01_v1c.shp DBF file contains column name ORDER which is reserved SQLite keyword, and it seems column is not properly escaped inside code during creating table.
|
I tried again:
Although db.tables didn't show any table for basin from GUI. That means I can properly import the file from GUI, but can't import it with the same command from linux terminal. |
With this fix #3605 I successfully import shapefile from my comment above.
But it is not possible see attribute table data with GUI tool (error message is showed, because table column name is DB reserved keyword and is not escaped). But with command
|
The same error I got for basin2 file which is simply exported from HydroSHEDS basins, like @tmszi proposed.
Importing basin from such a full and clean file is preferrable. |
I haven't managed to load the table of HydroLAKES layer still.
And by the way, yes, the basin shp was imported, but there is no features in the table, and the error is "Unable to open select cursor" when I try to display the attribute table. |
Could @geografin post exact reproducible steps, please (same as in my comment above #3604 (comment))? |
Vector map attribute table (GUI tool) should be will open with this fix #3614 or use v.db.select or db.select inside emulator terminal. GUI tool require much more changes to work with attribute table which contains columns names with reserved DB backend keywords. |
Describe the bug
Vector .shp files can't be imported with attribute table. If they are imported, database connection breaks.
To Reproduce
Steps to reproduce the behavior:
2a. Try to import with -t flag - the result will be the same.
Expected behavior
I expected any vector to be imported without any supplemental setting with autocreation of an attribute table. Also I expected that tables links are stable, otherwise GRASS can't be used as a database.
System description (please complete the following information):
I make all operations in the same LOCATION with docker container, then I exit and enter from Windows GUI to see results.
Additional context
When I imported lakes and a watershed (without a key column) I tried to select lakes with the watershed in Windows GUI, and I managed. Then from docker I failed, and now from GUI I also don't see any table and can't select in the same way (because of unlinked vector).
The text was updated successfully, but these errors were encountered: