[mapguide-users] Re: wgs84 degrees to x,y

Tony Tang tony.tang at autodesk.com
Wed Dec 20 11:18:00 EST 2006


I assume the Non-Earth (meters) that you mentioned is some kind of free
form system.

You do not care whether the feature object is geo-referenced or not.

MapGuide can treat the data in an "Arbitrary X-Y" Coordinate system
without change the (longitude and latitude) value.

Here is an example in PHP for the conversion from WGS84 to another
coordinate system. 

The output of the example is: 

(15, 32) to (15, 32) 
Unit: Meter

You can change the $wktProj to different coordinate systems if you know
the WKT String.

------------------------------------------

<?php

include('C:\Program
Files\Autodesk\MapGuideEnterprise2007\WebServerExtensions\www\mapviewerp
hp\Constants.php');

Example_1();

function Example_1()

{

    $wktProj = 'LOCAL_CS [ "Non-Earth (Meter)", LOCAL_DATUM ["Local
Datum", 0], UNIT ["Meter", 1.0], AXIS ["X", EAST], AXIS["Y", NORTH]]';

    $coordSysFactory = new MgCoordinateSystemFactory();

    $coordSysProj = $coordSysFactory->Create($wktProj);

    $lat = 32;

    $lon = 15;

    $geometryFactory = new MgGeometryFactory();

    $coordinate = $geometryFactory->CreateCoordinateXY($lon, $lat);

    $convertedCoordinate =
$coordSysProj->ConvertFromLonLat($coordinate);

    $xConv = $convertedCoordinate->GetX();

    $yConv = $convertedCoordinate->GetY();

    echo  "($lon, $lat) to ($xConv, $yConv) <br>";

    $unit = $coordSysProj->GetUnits();

    echo  "Unit: $unit <br>";

}

?>

  _____  

From: Camilo Aguilar [mailto:camilo.aguilar at gmail.com] 
Sent: Tuesday, December 19, 2006 3:25 PM
To: users at mapguide.osgeo.org
Subject: Re: [mapguide-users] Re: wgs84 degrees to x,y

 

Thanks for yours fast answers !, 

I am newbie in Geographic concepts , sorry and thanks for explain me. 
In response to the answer, I think that is : Non-Earth (meters)

On 12/19/06, Traian Stanev <traian.stanev at autodesk.com> wrote:

X,Y in which coordinate system?

 

 

  _____  

From: Camilo Aguilar [mailto:camilo.aguilar at gmail.com] 
Sent: Tuesday, December 19, 2006 3:00 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Re: wgs84 degrees to x,y

I need the formula please

On 12/19/06, Camilo Aguilar <camilo.aguilar at gmail.com> wrote: 

hi, i need converter from degrees in wgs84 to plain points X, Y in
meters. does anybody help me please

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide_users/attachments/20061220/bc910a29/attachment.html


More information about the Mapguide_users mailing list