]> granicus.if.org Git - postgis/commitdiff
Cowboy triumphs. (#304)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Nov 2009 00:27:55 +0000 (00:27 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Nov 2009 00:27:55 +0000 (00:27 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4823 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geography_measurement.c
postgis/lwgeom_transform.c

index f4667443d142b46d4f9cd89af52168ed1fb9c003..6178da654be2ee1f851df110ce087eb1608a385e 100644 (file)
@@ -521,16 +521,16 @@ Datum geography_bestsrid(PG_FUNCTION_ARGS)
                gbox2 = gbox1;
 
        
-       /* Are these data arctic? Polar stereographic north. */
+       /* Are these data arctic? Lambert Azimuthal Equal Area North. */
        if( gbox1.ymin > 65.0 && gbox2.ymin > 65.0 )
        {
-               PG_RETURN_INT32(-3995);
+               PG_RETURN_INT32(-3574);
        }
 
-       /* Are these data antarctic? Polar stereographic south. */
+       /* Are these data antarctic? Lambert Azimuthal Equal Area South. */
        if( gbox1.ymin < -65.0 && gbox2.ymin < -65.0 )
        {
-               PG_RETURN_INT32(-3031);
+               PG_RETURN_INT32(-3409);
        }
        
        /*
index a8e5a6cbb518e308c40b1dc3670047e26d3e8ca4..85fc733a2e911f3ceb9b77c31a09e5548bbc3677 100644 (file)
@@ -415,24 +415,39 @@ static char* GetProj4String(int srid)
                        snprintf(proj_str, maxproj4len, "+proj=utm +zone=%d +ellps=WGS84 +datum=WGS84 +units=m +no_defs", id - 32600);
                }
                /* UTM South */
-               if( id >= 32701 && id <= 32760 )
+               else if( id >= 32701 && id <= 32760 )
                {
                        snprintf(proj_str, maxproj4len, "+proj=utm +zone=%d +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs", id - 32700);
                }
+               /* Lambert Azimuthal Equal Area South Pole */
+               else if( id == 3409 )
+               {
+                       strncpy(proj_str, "+proj=laea +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs", maxproj4len );
+               }               
                /* Polar Sterographic South */
-               if( id == 3031 )
+               else if( id == 3031 )
                {
                        strncpy(proj_str, "+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs", maxproj4len);
                }
+               /* Lambert Azimuthal Equal Area North Pole */
+               else if( id == 3574 )
+               {
+                       strncpy(proj_str, "+proj=laea +lat_0=90 +lon_0=-40 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs", maxproj4len );
+               }               
                /* Polar Stereographic North */
-               if( id == 3995 )
+               else if( id == 3995 )
                {
                        strncpy(proj_str, "+proj=stere +lat_0=90 +lat_ts=71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs", maxproj4len );
                }               
                /* World Mercator */
-               if( id == 3395 )
+               else if( id == 3395 )
                {
                        strncpy(proj_str, "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs", maxproj4len );
+               }
+               else
+               {
+                       elog(ERROR, "Cannot find SRID (%d) in spatial_ref_sys", srid);
+                       return NULL;
                }               
                
                POSTGIS_DEBUGF(3, "returning on SRID=%d: %s", srid, proj_str);