[gdal-dev] Setting up a StatePlane Coordinate system

Frank Warmerdam warmerdam at pobox.com
Mon Dec 31 09:46:50 EST 2007


Christiaan Janssen wrote:
> So the coordinate system def you provided works, which is great, but I 
> was wondering if you could show me how to programmaticaly generate a 
> state plane based coordinate system object in code. I've been using the 
> following (which I know isn't working for me)
>  
> int StatePlaneZone = 101;    //Alabama East
> int isNad83 = 1;                    //True
> OGRSpatialReference* ogrsr = new OGRSpatialReference();
> ogrsr->SetProjCS(zoneTitle);
> ogrsr->SetStatePlane(statePlaneZone, isNAD83, NULL, NULL);
>  
> This is obviously not working based on what the well known text string 
> generated from this object is. Could you help clarify what I'm doing 
> wrong, thanks.

Christiaan,

I haven't followed this thread closely, but the above steps (simulated
through the python bindings) did produce this for me:

PROJCS["NAD83 / Alabama East",
     GEOGCS["NAD83",
         DATUM["North_American_Datum_1983",
             SPHEROID["GRS 1980",6378137,298.257222101,
                 AUTHORITY["EPSG","7019"]],
             AUTHORITY["EPSG","6269"]],
         PRIMEM["Greenwich",0,
             AUTHORITY["EPSG","8901"]],
         UNIT["degree",0.01745329251994328,
             AUTHORITY["EPSG","9122"]],
         AUTHORITY["EPSG","4269"]],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",30.5],
     PARAMETER["central_meridian",-85.83333333333333],
     PARAMETER["scale_factor",0.99996],
     PARAMETER["false_easting",200000],
     PARAMETER["false_northing",0],
     AUTHORITY["EPSG","26929"]]

The original zone title is discarded when things are reset by SetStatePlane().
The title can be reset after SetStatePlane() using the SetProjCS() method.

Note that SetStatePlane() depends on the OGRSpatialReference class being
able to find and load various GDAL support files, like stateplane.csv and
pcs.csv.

I appologise if I missed the point of this thread.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list