Database Reference
In-Depth Information
(
ogc_fid serial NOT NULL,
acq_date character varying(80),
acq_time character varying(80),
bright_t31 character varying(80),
iso2 character varying,
upload_datetime character varying,
shapefile character varying,
the_geom geometry(POINT, 4326),
CONSTRAINT hs_uploaded_pk PRIMARY KEY
(ogc_fid)
);
9. If you are using Windows, go to step 11. With Linux, create another bash
script named import_shapefiles.sh :
#!/bin/bash
for f in `find out_shapefiles -name
\*.shp -printf "%f\n"`
do
echo "Importing shapefile $f to
chp01.hs_uploaded PostGIStable..." #,
${f%.*}"
ogr2ogr -append -update -f
PostgreSQLPG:"dbname='postgis_cookbook'
user='me'password='mypassword'"
out_shapefiles/$f -nlnchp01.hs_uploaded
-sql "SELECT acq_date,
acq_time,bright_t31, '${f%.*}' AS iso2,
'`date`' AS
upload_datetime,'out_shapefiles/$f' as
shapefile FROM ${f%.*}"
done
10. Assign the execution permission to the bash script and execute it:
$ chmod 775 import_shapefiles.sh
$ ./import_shapefiles.sh
Search WWH ::




Custom Search