Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Possible Duplicate:
Bulk load multiple shapefiles into PostGIS

Is it possible to bulk upload shp files into postgis. Im currently playing around with postgis, qgis and geoserver (as a potential arcgis server, arcmap and arcsde replacements) and want i want to be able to do is run a batch file (I guess) that will upload a number of shp files (exported from arcsde) that overwrite existing shp/tables files in postgis.

In effect postgis would be a slave database (for the time being).

Med

share|improve this question

marked as duplicate by underdark Jul 30 '11 at 22:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

2 Answers

Using shp2pgsql, you will have to write a script looping on each files located into one (or many folders).

The syntax will depend of your OS or the language script you want to use.

Here, is how to loop in bash script. Here on a set of files.

share|improve this answer
    
In case your PostGIS database uses a spatial index, create it after the data load is done. That is, in case the database has an spatial index before the bulk data load is done, drop it or the data load will likely be very slow. –  dariapra Jul 30 '11 at 15:07
add comment

If you don't want to use Bash or a script you can use QGIS + PostGIS to do so under "layer-> add postgis layer" I think it does the same thing as @simo mentioned just with a GUI.

THe nice thing about this is that you get to see a progress bar as well as be able to set some of the fields, projections etc.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.