[mapguide-users] converting projection on fly

Kori Maleski Kori.Maleski at websoftdev.com
Tue Jun 5 16:44:33 EDT 2007


What is the error?

________________________________




Kori Maleski
Senior Application Developer
WEBSOFT DEVELOPERS, INC.
P: (530) 759-8754 ext 114
F: (530) 759-0923
kori.maleski at websoftdev.com
________________________________

 
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of shreepad
Sent: Tuesday, June 05, 2007 11:53 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] converting projection on fly


Hi 
i have the data in state plane coordinate and i want to convert them to lat
lon on fly i have wrote the code but it is giving me error. here is my code.
please let me know what i am doing wrong . 

projection is NAD_1983_StatePlane_California_III_FIPS_0403_Feet 
and i want to conver it to LAT LON

here is my code 


MgSelection mapSelection = null;
MgResourceService resService =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceServic
e);
MgFeatureService featService =
(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService)
;
MgMap map = new MgMap();
map.Open(resService, "General Public Map");
mapSelection = new MgSelection(map);
mapSelection.Open(resService, "General Public Map");
MgReadOnlyLayerCollection layers = mapSelection.GetLayers();


MgCoordinateSystemFactory l_oMGCoordinateSystemFactory = new
MgCoordinateSystemFactory();
MgGeometryFactory l_oMGGeometryFactory = new MgGeometryFactory();
String l_sWKTproj = map.GetMapSRS();

Response.Write(l_sWKTproj);
MgCoordinateSystem l_oMGCoordinateSystem =
l_oMGCoordinateSystemFactory.Create(l_sWKTproj);

double l_dMinX = 6141861.7828919375;
double l_dMinY = 2095968.7307088032;

MgCoordinate l_oMGCoordinateLatLonLL =
l_oMGGeometryFactory.CreateCoordinateXY(l_dMinX, l_dMinY);
MgCoordinate l_oMGCoordinateXYLL =
l_oMGCoordinateSystem.ConvertToLonLat(l_oMGCoordinateLatLonLL);

double xConv = l_oMGCoordinateXYLL.GetX();
double yConv = l_oMGCoordinateXYLL.GetY();
Response.Write(xConv);
Response.Write(yConv);

"

-- 
View this message in context:
http://www.nabble.com/converting-projection-on-fly-tf3873611s16610.html#a109
75522
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