Database Reference
In-Depth Information
5. Now, export the virtual layer as a new table in PostGIS using the
ogr2ogr
GDAL/OGRcommand.Youneedtousethe
-f
optiontospecifytheoutput
format,the
-t_srs
optiontoprojectthepointstothe
EPSG:3857
spatialref-
erence, the
-where
option to load only the records from the MODIS Terra
satellite type, and the
-lco
layer creation option to provide the schema
where you want to store the table:
$ ogr2ogr -f PostgreSQL -t_srs EPSG:3857
PG:"dbname='postgis_cookbook' user='me'
password='mypassword'" -lco SCHEMA=chp01
global_24h.vrt -where "satellite='T'"
-lco GEOMETRY_NAME=the_geom
6. Checkhowthe
ogr2ogr
commandcreatedthetableasshowninthefollow-
ing command:
$ pg_dump -t chp01.global_24h
--schema-only -U me postgis_cookbook
CREATE TABLE global_24h (
ogc_fid integer NOT NULL,