Database Reference
In-Depth Information
Importing shapefile DO.shp to
chp01.hs_uploaded PostGIS table...
Importing shapefile ID.shp to
chp01.hs_uploaded PostGIS table...
Importing shapefile AR.shp to
chp01.hs_uploaded PostGIS table...
...
11. If you are using Windows, create a batch script named im-
port_shapefiles.bat :
@echo off
for %%I in (out_shapefiles\*.shp)
do (
echo Importing shapefile %%~nxI to
chp01.hs_uploadedPostGIS table...
ogr2ogr -append -update -f
PostgreSQLPG:"dbname='postgis_cookbook'
user='me'password='mypassword'"
out_shapefiles/%%~nxI
-nlnchp01.hs_uploaded -sql "SELECT
acq_date, acq_time,bright_t31, '%%~nI' AS
iso2, '%date%' AS
upload_datetime,'out_shapefiles/%%~nxI'
as shapefile FROM %%~nI"
)
12. Run the batchscript:
>import_shapefiles.bat
Importing shapefile AL.shp to
chp01.hs_uploaded PostGIS table...
Importing shapefile AO.shp to
chp01.hs_uploaded PostGIS table...
Importing shapefile AR.shp to
chp01.hs_uploaded PostGIS table...
...
Search WWH ::




Custom Search