
510
|
Chapter 9, Mapping with Other People
#100 Map Imaginary Places
HACK
The GEOGCS[ entry is where we define our coordinate system, known as
A2484, with a prime meridian of New New Albemuth. For future spatial
analysis, the important part of this is the
SPHEROID definition inside the
WKT:
SPHEROID("made_up_name",<semi-major axis>,<inverse flattening>).
The
UNIT is 2π/360, the number of degrees per radian; degree-based coordi-
nate systems are (relatively) simple and familiar, so don’t change it. The
semi-major axis and inverse flattening tell PostGIS how to calculate distance
and area from points based on a latitude/longitude coordinate system. Ours
is an unprojected, geographical coordinate system. “Work with Different
Coordinate Systems”
[Hack #26] explains how different projections work in
more depth. Try
SELECT SRID,SRTEXT FROM SPATIAL_REF_SYS from your data-
base shell to see all the different projections normally available in PostGIS.
The last value,
PROJ4TEXT, tells proj4 how to perform coordinate transforma-
tions and isn’t really necessary for our purposes, so we just borrow the defi-
nition for WGS84 for the sake of completeness. For in-depth information
about the PostGIS spatial tables, check out the online documentation at
http://postgis.refractions.net/docs/ch04.html.
Now when you insert and retrieve points or other bits of geometry into Post-
GIS, use your new SRID and you can perform realistic ...