[postgis-users] shape file loading

Stefano Bonnin stefano.bonnin at comai.to
Fri Sep 17 08:36:10 PDT 2004


Hi,

I have one spatial table (my_postgis_table) with a schema like

    the_geom,object_name,object_id ......

I'd like to know if is possible in a simple way to load data from a generic shape file into "my_postgis_table".

The shp2pgsql load data into postgis spatial table creating a table with the same schema of the shape, so, the problem here is to "create a mapping" from shp file fields and my table.

The most simple way that I found is the following:

1) use the shp2pgsql loader in order to load the data into postgres spatial table (my_spatial_table_temp)
2) read the schema of "my_spatial_table_temp" and give to the user a page where to create the mapping between the 2 tables
            Example:

                            my_spatial_table_temp.generic_field1 --> my_postgis_table.object_name
                            my_spatial_table_temp.generic_field2 --> my_postgis_table.object_name

                            ...

                            and obviously:
                            my_spatial_table_temp.geom --> my_postgis_table.the geom
                            ....
                            and so on ...


3) Excute the query that copies the gis data from my_spatial_table_temp to my_postgis_table using the mapping just created.
4) drop the "my_spatial_table_temp" table

is this the right way or exists another procedure more simple than this one?

Thanks in advance.
RedS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20040917/4c816895/attachment.html>


More information about the postgis-users mailing list