Project

General

Profile

Support #3308

Raingauges: conflicting id

Added by Philippe May almost 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Start date:
13/12/2016
Due date:
% Done:

0%

Close

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

Related to Gisaf - Feature #3327: Put 2 tables for raingauge Closed 15/12/2016

Associated revisions

Revision 5c7f7d17 (diff)
Added by Philippe May almost 8 years ago

ORM: add resident model, use proper keys (refs #3316, refs #3307, refs #3308), use proper foreign key names and relations

History

#1 Updated by Philippe May almost 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 almost 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 almost 8 years ago

#4 Updated by Philippe May almost 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

Also available in: Atom PDF