[postgis-users] Beginning in PostGIS

2015-04-18 Thread Luciano
Hi, I wonder how can I update a postgresql postgis database before the following scenario: Always worked with shape files and update them used copy / paste between files. Now, think about creating a database in PostgreSQL and would like to continue using copy / paste to update polygons, but in my d

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread James Keener
tl;dr: Have you tried QGIS? What were you using to copy/paste before? I didn't think straight editing of the DBaseIII files directly was a sane thing to do, as they're linked up with the shape and shape-index files. PostGIS is just a PostgreSQL database, so any editor that can allow you to edit/

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Luciano
Yes, I'm using QGIS. I agree, if I make a table in the database with the same structure the shape file is simple. The copy / paste works perfectly. But my question is how to update for example the blocks table, using the copy / paste, since the database structure is different. For example, if I cop

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread James Keener
I guess I'm still not fully understanding the problem. I don't understand what problem the normalization is causing you. You shouldn't need to duplicate the rows in different tables when you duplicate one in another table. To edit fields in QGIS you need to enable editing on the layer and then y

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Rémi Cura
maintaining your data model is easy to do with triggers. About copy / past. Sorry this just doesn't make much sense to me. You can import shapefile into postgres if it is the question. You can also use trigger on the import table to fill you rmodel with the imported data. Cheers, Rémi-C 2015-04

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Luciano
Ok, I have a shape file with the following structure. Shape file, columns: town ​​code; town description; Neighborhood code; name of the neighborhood; block code; Street code; street name; Using the How to Copy / paste a geometry from shape file to postgis with follow structure: Cities table (d

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread James Keener
OH, I think I understand: You want to copy and paste from a shapefile layer into the appropriate postgis layer? I don't know if you can do that directly. You may want to write a script to do it, or import the shapefile into a temporary table and then using multiple sql statements to build up your

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Lee Hachadoorian
Luciano, I think I'm not understanding your goal. Do you have a shapefile that contains a mix of towns, neighborhoods, blocks and streets? Are you trying to load the shapefile but break the features up so that towns get inserted in a PostGIS towns table, neighborhood

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Luciano
Ok Remi, and Jim, thanks... Lee, Thats it, the problem is that I get/receive a shape file with the following structure and need to use it to update my database. But my database does not have the same file's structure. As mentioned above... tia 2015-04-18 15:14 GMT-03:00 Lee Hachadoorian :

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Rémi Cura
Ok, this is totally a postgres question then. First you create your data model (here it is just for example, you should pick better name, don't use capital, no space, etc) ​​ CREATE TABLE Cities (...) CREATE TABLE Neighborhoods () CREATE TABLE Blocks() CREATE TABLE Streets () >From here I expect

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Luciano
Very good !! based on Remi's advice and some adjustments, it worked! Now the table is updating using the SQL Editor or the Qgis. Thank you all! 2015-04-18 16:19 GMT-03:00 Rémi Cura : > Ok, this is totally a postgres question then. > > First you create your data model (here it is just for examp

Re: [postgis-users] Beginning in PostGIS

2015-04-18 Thread Rémi Cura
Glad it works ^^ A note for archive : this solution won't be super-efficient. This looks like a textbook case for using the postgres rule system. A simpler solution would be to switch to statement trigger (as opposed ot row trigger) if you care about it, but it may be trickier to write. Cheers, R