[postgis-users] Php interface for loading shp file into postgis

strk at refractions.net strk at refractions.net
Tue Nov 14 03:22:22 PST 2006

On Tue, Nov 14, 2006 at 10:14:41AM +0100, Luca Casagrande wrote:
> Hi to all!
> I am trying to found a good way to approach this issue:
> i need to build a php interface that will do those tasks:
> 1) Load a shp file selected by the user;
> 2) Check if the file has got a prj file associated with it and if not
> let the user insert the PROJ code for the current file;
> 3) Use proj to convert the file to the needed projection;
> 4) Store the file inside POSTGIS
> The main thing i am thinking about, is when do the projection swap:
> is it better to do BEFORE importing the data in POSTGIS or do just after the data has
> been inserted inside Postgis?

There's currently no trigger checking for SRID existance added
to the geometry column, so you can add the spatial_ref_sys
entry at an arbitrary time.
Anyway, the .prj => spatial_ref_sys record conversion seems
a useful enough function to have embedded in shp2pgsql (and
the reverse in pgsql2shp) so if you intend to implement such
a feature I think it would be nice to have it implemented 
in C :)


More information about the postgis-users mailing list