[postgis-users] Beginning in PostGIS

Luciano br.analistagis at gmail.com
Sat Apr 18 11:42:30 PDT 2015


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 <Lee.Hachadoorian+L at gmail.com>:

>  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, neighborhoods get inserted in a PostGIS
> neighborhoods table, etc.?
>
> Best,
> --Lee
>
>
> On 04/18/2015 12:22 PM, James Keener wrote:
>
> 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
> you can get end editable form for each feature or you can edit directly in
> the attribute table. Copy and pasting features in QGIS copied all of the
> attributes as well.
>
> Can you give a more complete example of the issue you're facing?
>
> Jim
>
> Jim
>
> On April 18, 2015 12:11:38 PM EDT, Luciano <br.analistagis at gmail.com>
> <br.analistagis at gmail.com> wrote:
>>
>>  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 copy a polygon layer shape, and try to stick to the
>> database layer, the fields of the new polygon will be void.
>> Note that my database blocks table does not have the same structure of
>> the shape file because it is normalized (or should be), so the fields of two
>> data sources do not match.
>> In this case, what is the best practice?
>>
>>  tia
>>
>> 2015-04-18 12:44 GMT-03:00 James Keener <jim at jimkeener.com>:
>>
>>> 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/duplicate PostgreSQL tables could work.  As for mutating
>>> geometries, maybe QGIS?  That would also allow you to edit geometries,
>>> attributes, as well as duplicate features.
>>>
>>> Hope that helps,
>>> Jim
>>>
>>> On 04/18/2015 11:39 AM, Luciano wrote:
>>> >
>>> > 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 database
>>> > structure is different from the shape file. For example:
>>> > Imagine that the shapefile have all the fields in one table, already in
>>> > the database, by reason of standardization, have these columns in
>>> tables
>>> > distinct. Below is an example of a register of towns.
>>> >
>>> > File shape, columns:
>>> > town ​​code;
>>> > town description;
>>> > Neighborhood code;
>>> > name of the neighborhood;
>>> > block code;
>>> > Street code;
>>> > street name;
>>> >
>>> > In Postgres / Gis could look like this:
>>> >
>>> > Cities table (data):
>>> > - Town id
>>> > - Description of town
>>> >
>>> > Neighborhoods table (data):
>>> > - Id of the neighborhood
>>> > - Description of the neighborhood
>>> > - Id of town (foreign key)
>>> >
>>> > Blocks table:
>>> > - Id of the court
>>> > - Block of code
>>> > - Town id (foreign key)
>>> > - Geometry, polygon
>>> >
>>> > Streets table:
>>> > - Street id
>>> > - Street name
>>> > - Town id (foreign key)
>>> > - Geometry, line
>>> >
>>> > How could update (insert) a block in postgresql table using copy /
>>> paste
>>> > the shape file?
>>> > Would have to create a trigger/procedure (instead of) to automate the
>>> > process?
>>> > Fields of shape file should be equal to the fields of database table?
>>> > Some practical example as a reference?
>>> >
>>> > tia
>>> > --
>>> > Luciano
>>> >
>>> >
>>> >
>>>  > _______________________________________________
>>> > postgis-users mailing list
>>> > postgis-users at lists.osgeo.org
>>> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>> >
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>
>>
>>
>>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
> _______________________________________________
> postgis-users mailing listpostgis-users at lists.osgeo.orghttp://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
> --
> Lee Hachadoorian
> Assistant Professor in Geography, Dartmouth Collegehttp://geospatial.commons.gc.cuny.eduhttp://freecity.commons.gc.cuny.edu
>
>


-- 
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150418/3cb74d41/attachment.html>


More information about the postgis-users mailing list