Support #3308
Raingauges: conflicting id
0%
Description
Here in Redmine, there are 2 files for the raingauges.
Assuming they have to be imported in the same table: there is a conflict with objects sharing the same identifier (ie. primary key in the database, 'id'):
- "region raingauges UTM44N.zip" has ids: 1, 2, 3, 4
- "auroville raingauges UTM44N.zip" has ids: 1, 2, 3, 4, 5, 6, 7, 8.
So, ids of 1, 2, 3, 4 are conflicting.
I'm not 100% sure of what's happening though. The software uses a convenient utility called "shp2pgsql", which generates the SQL commands from shapefiles. The utility can actually generate the field 'id'.
Alternatively, the 'id' comes from QGis, and we'll need to see together how QGis generates the shapefiles (how does it set the 'id'?), and adapt the export.
Related issues
Associated revisions
History
#1 Updated by Philippe May about 8 years ago
Note that we could use a python library with a bit of code to import shapefiles to the DB (see http://geospatialpython.com/2016/08/pure-python-loading-shapefiles-into.html).
This method would allow a lot of flexibility: pre-processing the shapefiles.
That really depends on the workflow we want, in relation with QGis.
#2 Updated by Philippe May about 8 years ago
We stick to the convention: 1 shapefile <=> 1 table.
So, we get 2 tables for raingauge: raingauge_av and raingauge_region
#3 Updated by Philippe May about 8 years ago
- Related to Feature #3327: Put 2 tables for raingauge added
#4 Updated by Philippe May about 8 years ago
- Status changed from New to Resolved
#5 Updated by Giulio Di Anastasio over 4 years ago
- Status changed from Resolved to Closed