Importing Spatial References from URLs in GDAL 1.5
We’ve been busting hard to get things in shape for the GDAL 1.5 release that will be on December 20th. Besides its typical blizzard of new GDAL and OGR drivers, one of the more useful little features that I added for this release allows you to import a spatial reference definition from a URL. It’s expected that you might use http://spatialreference.org URLs, but any old URL will do.
For example, this command will reproject the world_borders shapefile to an Albers projection that a user contributed that focuses on the Northern Pacific:
ogr2ogr -t_srs http://spatialreference.org/ref/user/north-pacific-albers-conic-equal-area/
-s_srs EPSG:4326 world_borders_albers.shp world_borders.shp
It may seem rather innocuous, but this feature can help you out quite a bit when using OGR and GDAL command line utilities. It is a hard and painful problem to ensure that you are using the correct spatial reference, and demonstrating to others what you are using in a bug report can be even harder. By using a wiki-style spatial reference repository like spatialreference.org you can ensure that everyone is using the same one. I’ll admit it’s not very useful for well known spatial references like those in the EPSG list, but if you ever cook your own reference or your pet one was missed by the powers that be, sharing them and consuming them will be a little bit easier with spatialreference.org and GDAL 1.5.
Hopefully some other projects follow suit. Fetching your spatial references from a URL *every* single time through a million member loop might not be the best approach, but it can be really handy in other scenarios.
December 14th, 2007 at 9:13 am
Howard, spatialreference.org should encourage client applications such as ogr2ogr to cache the definitions. That done, there’s no performance hit at all.
December 21st, 2007 at 2:17 am
I had a problem building GDAL v1.4.4 using Visual Studio 2008 (professional edition - released to market)
More information is available here:http://therajahs.blogspot.com/2007/12/building-gdal-144-using-visual-studio.html
The problem might be there in v1.5 of GDAL too (I havent yet had a chance to build it on my machine).
May 3rd, 2008 at 8:05 pm
I have been checking out http://spatialreference.org - nice job. Maybe I could put a bug in your ear to help us out with solar system projection encodings? It you take a look at the latest release of FWTools, Frank, recently included the planetary definitions which use the IAU2000 namespace. THe file is called “IAU2000.WKT”. The IAU2000 numbers work like the EPSG codes and they do have a heritage with other planetary community standards as discussed here: http://www.lpi.usra.edu/meetings/lpsc2006/pdf/1931.pdf
I would love to find how these codes might be included on http://spatialreference.org or my website? It would be great to be able to run gdal with a srs from a URL.
thanks.