Database Reference
In-Depth Information
> raster2pgsql -s 4322 -t 100x100 -I -F
-C -Y
C:\postgis_cookbook\data\chap5\PRISM\us_tmin_2012.01.asc
prism | psql -d chapter10
8. Asin Chapter5 , Working with Raster Data ,wewillpostprocesstherasterfi-
lenames to a date column by executing the following command:
ALTER TABLE prism ADD COLUMN month_year
DATE;UPDATE prism SETmonth_year =
(split_part(split_part(filename, '.', 1),
'_', 3) || '-' ||split_part(filename,
'.', 2) || '-01')::date;
9. Then,weloadtheSanFranciscoboundariesbyexecutingthefollowingcom-
mand:
> shp2pgsql -s 3310
-IC:\postgis_cookbook\data\chap5\SFPoly\sfpoly.shp
sfpoly |psql -d chapter10
10. Copy this chapter's dataset to its own directory by executing the following
commands:
> mkdir C:\postgis_cookbook\data\chap10
> cp -r /path/to/book_dataset/chap10
C:\postgis_cookbook\data\chap10
11. WewillusetheshapefilesforCaliforniaschoolsandpolicestations,provided
by the USEIT program at the University of Southern California. Import the
shapefiles by executing the following commands; use the spatial index flag
-I only for the police stations shapefile:
> shp2pgsql -s 4269 -I
C:\postgis_cookbook\data\chap10\CAEmergencyFacilities\CA_police.shp
capolice | psql -d chapter10
> shp2pgsql -s 4269
C:\postgis_cookbook\data\chap10\CAEmergencyFacilities\CA_schools.shp
caschools | psql -d chapter10
Search WWH ::




Custom Search