[postgis-users] Updated shapefile to update postgres database

Chris Hermansen chris.hermansen at timberline.ca
Tue May 6 15:55:29 PDT 2008


Presumably what you mean by "update" is that you want to replace old
versions of roads already in PostGIS with new versions of the same roads
from shapefiles, and you want to keep the old street type in conjunction
with the updated geometry?

If that's the case, your problem is really determining which old roads
are coincident with which new roads.  One approach might be to buffer
the new road by a metre or two, and then select the old road whose
length within the buffer is the maximum of all old roads that intersect
the buffer.  This specific old road's street type could be transferred
to the new road, and the old road could be deleted.

The above is probably an oversimplification that will crash and burn
when confronted by real live roads whose updates are not particularly
coincident with their older avatars.

SenTnel wrote:
> Hello!
>
> I would like some help updating a postgres database. This is the problem: We
> created the database using shp2pgsql to convert a shapefile that contains a
> city's street details (centerline), after we created the database we also
> created an aditional column to classify the street types (eg: street,
> avenues, highways, etc.), now we are working on the original shapefile,
> updating new roads, changes made to highways due to constructions
> modifications, etc., and we want to upload the "updated" shapefile, without
> afecting the actual database, another words, we would like to convert to
> postgres the updated shapefile with the new information (it cuold be the
> whole shapefile) but to keep the added clasiffication column intact. How can
> we do that?
>
> Thanks
>   


-- 
Regards,

Chris Hermansen         mailto:chris.hermansen at timberline.ca
tel+1.604.714.2878 · fax+1.604.733.0631 · mob+1.778.232.0644
Timberline Natural Resource Group · http://www.timberline.ca
401 · 958 West 8th Avenue  · Vancouver BC · Canada · V5Z 1E5




More information about the postgis-users mailing list