[postgis-users] Fwd: Pushing all the shapefiles into the Postgres

Michael.Scholz at dlr.de Michael.Scholz at dlr.de
Thu Nov 22 02:21:48 PST 2012


Moin.
The PostGIS documentation is a good starting point. You can use the command line shp2pgsql loader (http://postgis.refractions.net/documentation/manual-2.0/using_postgis_dbmanagement.html#shp2pgsql_usage) which comes with your PostGIS installation.

To batch-load shapefiles on Ubuntu shell, you could use a for-loop. Example:
user at server:/your/directory> for shape in *.shp; do shp2pgsql -c -D -s 4326 -I $shape yourschema.${shape%.*} | psql -d yourdatabase; done

Set all parameters of shp2pgsql according to your needs, especially the SRID (-s).

Ahoi! Michi

Von: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] Im Auftrag von Smaran Harihar
Gesendet: Mittwoch, 21. November 2012 20:23
An: PostGIS Users Discussion
Betreff: [postgis-users] Fwd: Pushing all the shapefiles into the Postgres

And I am working on the command line as I am on remote Ubuntu Server. So the Introduction<http://workshops.opengeo.org/postgis-intro/> given in the OpenGeo Workshop is not really helpful.

Thanks,
Smaran
---------- Forwarded message ----------
From: Smaran Harihar <smaran.harihar at gmail.com<mailto:smaran.harihar at gmail.com>>
Date: Wed, Nov 21, 2012 at 12:04 PM
Subject: Pushing all the shapefiles into the Postgres
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net<mailto:postgis-users at postgis.refractions.net>>


Hi Guys,

I have been working with lots of shapefiles and hosting them on the Geoserver (around 8k). Now the Geoserver is completely stalled and fetching the data is almost not possible. I have installed the complete OpenGeo Suite and till now have not played with the PostGIS. I guess adding the shapefiles to the PostGIS will surely speed up the process.

The problem is I am new to PostGIS, so can someone share some ideas where I should begin and how I can add the shapefiles to the PostGIS database.

--
Thanks & Regards
Smaran Harihar




--
Thanks & Regards
Smaran Harihar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20121122/51837419/attachment.html>


More information about the postgis-users mailing list