[mapguide-users] Transform coordinates from a BC, Canada Albersprojection to geographic

Bruce Dechant bruce.dechant at autodesk.com
Tue Mar 20 14:07:17 EDT 2007


I just tested the following WKT (from below) using the web tier test
pages for MGOS 1.1 and for the upcoming MGOS 1.2 and both passed.

PROJCS["BC_Albers",GEOGCS["LL83",DATUM["NAD83",SPHEROID["GRS1980",637813
7.000,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519
94330]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["false_easting",
1000000.000],PARAMETER["false_northing",0.000],PARAMETER["standard_paral
lel_1",58.500000],PARAMETER["standard_parallel_2",50.0],PARAMETER["latit
ude_of_origin",45.0000],PARAMETER["central_meridian",-126.000000],UNIT["
Meter",1.00000],AUTHORITY["EPSG","3005"]]

Did you try testing with the web tier test pages?

Web tier test pages (Apache shown below):
http://localhost:8008/mapguide/mapagent/index.html

Then select "Coordinate System" on the left. Then select "CheckWkt" and
paste your WKT and click "Execute".

Thanks,
Bruce

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Bruce A
Sent: March 20, 2007 7:53 AM
To: mapguide-users at lists.osgeo.org
Subject: Re: [mapguide-users] Transform coordinates from a BC, Canada
Albersprojection to geographic


Frank,

Thanks for the response. I get the following message vs. valid
results...:
	>"ERROR: The coordinate system transform failed. PROJ4 failed to
transform 
                > the data.
I am using MapGuide Open Source V. 1.1 (MgServerSetup-1.1.0.exe)

Do I need to set something different up for this projection on the
server?

The email contains the contents of my php test file (alb2geo.php) - Did
you
try creating and running this php file?
Could you provide me with the details of your testespg function? Perhaps
I
could identify the issue based on your code...

I agree with your naming convention however the db file that I am using
is
structured the reverse and thus the variable names...

Thanks again for your assistance. It is greatly appreciated.

Bruce


Frank Warmerdam-2 wrote:
> 
> Bruce A wrote:
>> I am trying to transform coordinates from a BC, Canada Albers
projection
>> to
>> geographic and I cannot get the correct results using Mapguide's WKT
and
>> transformation capabilities.
>> 
>> The PHP code below outlines the WKT for the reference systems above
(I
>> believe) and the transformation code. I have tried several
permutations
>> of
>> the WKT for the projection without success. I am not certain that the
>> definition being used is correct... However, if I use what I believe
to be
>> the
>> "correct" definition - the transformation produces an error outlined
>> below
>> and others although they do not produce an error produce incorrect
>> results.
>> 
>> "ERROR: The coordinate system transform failed. PROJ4 failed to
transform
>> the data.
> ...
>> 	 	$wktGeo = 'GEOGCS["Longitude/Latitude(NAD
83)",DATUM["NAD 83",
>> SPHEROID
>> ["GRS 80", 6378137, 298.257222101]], RRIMEM [ "Greenwich", 0.000000
],
>> UNIT
>> ["Decimal Degree", 0.01745329251994330]]';		
>> 		 
>> 		$wktAlb = 'PROJCS["BC_Albers",
>>
GEOGCS["LL83",DATUM["NAD83",SPHEROID["GRS1980",6378137.000,298.257222101
]],PRIMEM["Greenwich",
>>
0],UNIT["Degree",0.01745329251994330]],PROJECTION["Albers_Conic_Equal_Ar
ea"],PARAMETER["false_easting",1000000.000],PARAMETER["false_northing",0
.000],PARAMETER["standard_parallel_1",58.500000],PARAMETER["standard_par
allel_2",50.0],PARAMETER["latitude_of_origin",45.0000],PARAMETER["centra
l_meridian",-126.000000],UNIT["Meter",1.00000],AUTHORITY["EPSG","3005"]]
';
> ...
>> 		//$xProj = $point.X;
>> 		//$yProj = $point.Y;
>> 		$xProj = 1094382;
>> 		$yProj = 448309;
>> 		
>> 		$xLat = 49.05958;
>> 		$yLon = -122.8836876;
> 
> Bruce,
> 
> I tried converting from your geographic to your BC Albers with your
> WKT definition and I got:
> 
> warmerda at amd64[132]% testepsg -t 1.wkt 2.wkt -122.8836876 49.05958
> (-122.883688,49.059580,0.000000) ->
> (1227954.325206,454269.784357,0.000000)
> 
> I notice you refer to xLat, and yLon, shouldn't that properly be the
> following?
> 
> $xLon = -122.8836876;
> $yLat =  49.05958;
> 
> The "testepsg" transformation I did is using GDAL/OGR and PROJ from
the
> current development version while MapGuide uses a somewhat older
version.
> But I don't know of any obvious recent changes in PROJ.4 or OGR with
> regard to handling of Albers Conic Equal Area.
> 
> What values are you getting?  How exactly do you expect to get the
> projected coordinates you quoted?  BTW, I also tried the following
> which should be equivelent using EPSG lookups for NAD83 and BC Albers
> and I get the same output, so I think your WKT is fine.
> 
> warmerda at amd64[134]% testepsg -t NAD83 EPSG:3005 -122.8836876 49.05958
> (-122.883688,49.059580,0.000000) ->
> (1227954.325206,454269.784357,0.000000)
> 
> 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
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context:
http://www.nabble.com/Transform-coordinates-from-a-BC%2C-Canada-Albers-p
rojection-to-geographic-tf3430756s16610.html#a9572840
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users



More information about the mapguide-users mailing list