When you create a spatial database using PostGIS, you may notice that PostGIS automatically installs a table called “spatial_ref_sys”. This is a standard table for spatial databases, as required by the Open Geospatial Consortium’s specification. It defines which SRIDs are allowed in your geometries, and provides information about the corresponding coordinate systems.
In this article, we’ll take a brief look at the spatial_ref_sys table and how you can use it in your application. We’ll cover:
- What’s useful about the
spatial_ref_systable - Where the
spatial_ref_sysdata comes from, and how you can populate your own custom data. - Accessing
spatial_ref_sysdata from Ruby using RGeo’sSRSDatabase
This is part 9 of my continuing series of articles on geospatial programming in Ruby and Rails. For a list of the other installments, please visit http://www.daniel-azuma.com/blog/archives/category/tech/georails.