Database Reference
In-Depth Information
acq_date: String (80.0)
acq_time: String (80.0)
bright_t31: String (80.0)
iso2: String (0.0)
upload_datetime: String (0.0)
shapefile: String (0.0)
OGRFeature(chp01.hs_uploaded):6413acq_date
(String) = 2012-08-20
acq_time (String) = 0110
bright_t31 (String) = 292.7
iso2 (String) = AT
upload_datetime (String) = Sun Aug 26
01:58:44 CEST 2012
shapefile (String) = out_shapefiles/
AT.shp
POINT (14.333 48.279)
...
How it works...
You could implement both the data flows (processing shapefiles out from PostGIS,
and then into it again) thanks to the power of the ogr2ogr GDAL command.
You have been using this command in different forms and with the most important
inputparametersinotherrecipes,soyoushouldnowhaveagoodunderstandingof
it.
Here,itisworthmentioningthewayOGRletsyouexporttheinformationrelatedto
thecurrentdatetimeandtheoriginalshapefilenametothePostGIStable.Insidethe
import_shapefiles.sh (Linux, OS X) or the import_shapefiles.bat (Win-
dows)scripts,thecoreisthelinewiththe ogr2ogr command(hereistheLinuxver-
sion):
ogr2ogr -append -update -f PostgreSQL
PG:"dbname='postgis_cookbook' user='me'
password='mypassword'" out_shapefiles/$f -nln
chp01.hs_uploaded -sql "SELECT acq_date,
Search WWH ::




Custom Search