Database Reference
In-Depth Information
4. Ifyoustillhaven'tloadedthecountriesshapefiletoPostGISfromaprevious
recipe,doitusingthe ogr2ogr or shp2pgsql commands.Thefollowingis
the shp2pgsql syntax:
$ shp2pgsql -I -d -s 4326 -W LATIN1 -g
the_geom countries.shp chp01.countries >
countries.sql
$ psql -U me -d postgis_cookbook -f
countries.sql
How to do it...
The steps you need to follow to complete this recipe are as follows:
1. Getinformationaboutoneoftherastersusingthe gdalinfo command-line
tool as follows:
$ gdalinfo worldclim/tmax09.bil
Driver: EHdr/ESRI .hdr Labelled
Files: worldclim/tmax9.bil
worldclim/tmax9.hdr
Size is 2160, 900
Coordinate System is:
GEOGCS["WGS
84",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AUTHORITY["EPSG","4326"]]Origin
=
(-180.000000000000057,90.000000000000000)
Pixel Size =
(0.166666666666667,-0.166666666666667)
Corner Coordinates:
Upper Left (-180.0000000, 90.0000000)
(180d 0' 0.00"W, 90d0' 0.00"N)
Lower Left (-180.0000000, -60.0000000)
(180d 0' 0.00"W, 60d0' 0.00"S)
Upper Right ( 180.0000000, 90.0000000)
(180d 0' 0.00"E, 90d0' 0.00"N)
Lower Right ( 180.0000000, -60.0000000)
Search WWH ::




Custom Search