05-17-2019 04:02 PM
I have telephone pole data with lat/longs in a csv that i would like to build a mobile inspection app around. I have been using the Lab6 tutorial as a template app and it seemed to be straight forward until I realized the app uses GUIDs for a pkey and the data I imported into PostGIS uses an integer. The app does not have to create new poles, just change attributes and snap pictures. How do I populate the existing records with a compatible GUID and geometry?
Solved! Go to Solution.
05-20-2019 04:15 PM
In fact, you only need the UID´s in the mobile app if you want to add features, particularly if you need to add features while the mobile device is offline. GUID´s will ensure that the id value given to a new feature is unique, if you use integers then another user may send a new feature with the same id making a mess of your data.
If you still want to give it a try, the GUID doesn´t need to be the actual PK in postgres you just define it as a PK on the app. Easy way to do what you need is to load the CSV into postgres and manually add the GUID column (character(36)) then generate the UID values with a query ( SELECT uuid_generate_v4()::text; ).
05-21-2019 01:08 AM
If you only edit data you can keep your integer column as key field.
To generate a geometry column from your lat/long values you can use ST_Point function.