[mapguide-users] LatLong to UTM

Dave Wilson dave.wilson at autodesk.com
Fri Aug 29 15:15:58 EDT 2008


What API are you using? Not that it should make much of a difference other than possible rounding error.

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Don MacGregor
Sent: Friday, August 29, 2008 12:04 PM
To: mapguide-users at lists.osgeo.org
Subject: RE: [mapguide-users] LatLong to UTM


I am using MapGuide Open Source 2.0.1.



Dave Wilson-3 wrote:
>
> Using MGE2009 I get the correct answer for your Zone 12 example. The
> difference may be related to PROJ4 vs Mentor being used in MGOS. Which
> version of MGOS?
>
> Dave
>
> -----Original Message-----
> From: mapguide-users-bounces at lists.osgeo.org
> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Don MacGregor
> Sent: Friday, August 29, 2008 10:46 AM
> To: mapguide-users at lists.osgeo.org
> Subject: RE: [mapguide-users] LatLong to UTM
>
>
> Hi Dave,
> You are right the point was in Zone 19.
> But even when I enter a zone 12 point e.g. Long -110.85980508, Lat
> 55.50472355 then I got N:6151000.496561 E:508855.1818729 as a result and
> the
> point should be N:6150967.822 E:508855.135.
> Many thanks for you time.
>
>
>
> Dave Wilson-3 wrote:
>>
>> I could be completely off here, but -71,42 is in North Eastern United
>> States which is definitely not Zone 12.
>>
>> Dave
>>
>> From: mapguide-users-bounces at lists.osgeo.org
>> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Don C.
>> MacGregor
>> Sent: Friday, August 29, 2008 8:32 AM
>> To: mapguide-users at lists.osgeo.org
>> Subject: [mapguide-users] LatLong to UTM
>>
>> Hi folks,
>> I am trying to write a script that can convert LatLong point to UTM.
>> Although the script its working but I am not getting the right results.
>> Below please find my script.
>>
>>     $wktProj =
>> 'PROJCS["NAD_1983_UTM_Zone_12N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-111.0],PARAMETER["Scale_Factor",0.99965242],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]';
>>         $coordSysFactory = new MgCoordinateSystemFactory();
>>         $coordSysProj = $coordSysFactory->Create($wktProj);
>>         $geometryFactory = new MgGeometryFactory();
>>         $xProj = -71.061342;
>>         $yProj= 42.353966647205;
>>         $coordinate = $geometryFactory->CreateCoordinateXY($xProj,
>> $yProj);
>>         $convertedCoordinate =
>> $coordSysProj->ConvertFromLonLat($coordinate);
>>
>>         $xConv = $convertedCoordinate->GetX();
>>         $yConv = $convertedCoordinate->GetY();
>>
>> I am getting (434696.747152, 6017918.57788) and the correct porjected
>> point is (434700.172, 6017603.009).
>> Any help in this regard would be highly appreciated.
>> Thanks
>>
>>
>>
>> ________________________________
>> [http://us.i1.yimg.com/us.yimg.com/i/ca/iotg_search.jpg]Yahoo! Canada
>> Toolbar : Search from anywhere on the web and bookmark your favourite
>> sites. Download it now! <http://ca.toolbar.yahoo.com/>
>>
>> _______________________________________________
>> 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/LatLong-to-UTM-tp19221187p19223605.html
> 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
> _______________________________________________
> 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/LatLong-to-UTM-tp19221187p19224803.html
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