[gdal-dev] Setting up a StatePlane Coordinate system
Christiaan Janssen
cjanssen at iavo-rs.com
Mon Dec 31 09:19:12 EST 2007
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
From: Martin Chapman [mailto:mchapman at texelinc.com]
Sent: Friday, December 28, 2007 6:04 PM
To: 'Christiaan Janssen'
Cc: gdal-dev at lists.osgeo.org
Subject: RE: [gdal-dev] Setting up a StatePlane Coordinate system
Sorry, the proj link is http://proj.maptools.org/.
Martin Chapman
Chief Software Architect
Fortified Datacom Inc.
http://www.fortifieddatacom.com
mchapman at fortifieddatacom.com
303-324-1065
From: Martin Chapman [mailto:mchapman at texelinc.com]
Sent: Friday, December 28, 2007 4:00 PM
To: 'Christiaan Janssen'
Cc: 'gdal-dev at lists.osgeo.org'
Subject: RE: [gdal-dev] Setting up a StatePlane Coordinate system
Christiaan,
Looks to me like two issues:
1. Try using this coordinate system def for Alabama East:
PROJCS["NAD_1983_StatePlane_Alabama_East_FIPS_0101",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199432955]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",200000],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-85.83333333333333],PARAMETER["Scale_Factor",0.99996],PARAMETER["Latitude_Of_Origin",30.5],UNIT["Meter",1]]
2. Make sure the proj.dll is able to find the NAD files it depends on for the transformation that are identified by an environment variable called PROJ_LIB and the value should be something like c:\proj\nad. If you don't have the NAD files you can download them from www.proj4.org. You can set this environment variable at run time like so:
CPLSetConfigOption("PROJ_LIB", "c:\\proj\\nad");
Or you can set it in My Computer settings through the environment variables dialog manually.
Give that a try and let me know how it went.
Best regards,
Martin Chapman
Chief Software Architect
Fortified Datacom Inc.
http://www.fortifieddatacom.com
mchapman at fortifieddatacom.com
303-324-1065
From: Christiaan Janssen [mailto:cjanssen at iavo-rs.com]
Sent: Friday, December 28, 2007 1:06 PM
To: Martin Chapman
Subject: RE: [gdal-dev] Setting up a StatePlane Coordinate system
I'm trying to generate a Coordinate Transformation from NAD83 State Plane Zone 101 (Alabama East) to WGS84 LatLon. Here are the Well Known Texts for the source and destination:
Source: "LOCAL_CS["State Plane Zone 101 / NAD83",UNIT["Meter",1]]"
Destination: "GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4326"]]"
I've been successful with UTM<->LatLon but not with the StatePlane based transformations. And as a side not here's the error message from CPLGetLastErrorMsg():
"No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed."
Thanks,
Christiaan
From: Martin Chapman [mailto:mchapman at texelinc.com]
Sent: Friday, December 28, 2007 2:56 PM
To: 'Christiaan Janssen';gdal-dev at lists.osgeo.org
Subject: RE: [gdal-dev] Setting up a StatePlane Coordinate system
Christiaan,
Can you send me your projection string and I will validate the projection is correct and then I will send back the code I used to do it.
Martin Chapman
Chief Software Architect
Fortified Datacom Inc.
http://www.fortifieddatacom.com
mchapman at fortifieddatacom.com
303-324-1065
From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Christiaan Janssen
Sent: Friday, December 28, 2007 12:32 PM
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Setting up a StatePlane Coordinate system
Could someone point me to (or provide me) a code snippet that shows how one would go about setting up a State Plane zone based OGR Spatial Reference object. Every attempt I've made has resulted in a SRS object that when used with OGRCreateCoordinateTransformation() function always results in a failure because there is no conversion from it. Thanks
Christiaan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20071231/54993a9a/attachment-0001.html
More information about the gdal-dev
mailing list