Select to view content in your preferred language

Projection Points from Geographic to State Plane Coordinate system

779
3
04-05-2011 05:11 AM
BernardNtiamoah
Deactivated User
Here is what I want to do:
I am trying to project lat/lon points to state plane using geometry service. Everything works great but then I realized that, the projected points(graphics) don't keep their original attributes. In other words, the resulted graphics have no attributes whatsover.

Here is my question:
How do you keep track of the graphics after projection if they have no attribute? I have already tried projecting the points one after the other but that's not efficient. I need to project them in batches.

I strongly need help on this please

Bernard
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
You can use this instead: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Geom.... Second parameter UserToken is object. You can pass the original graphic (with attributes) here and then update its geometry from the ProjectCompleted event instead of adding the resulting graphic directly to your map, just use it's Geometry.

Something like
void geometryService_ProjectCompleted(object sender, GraphicsEventArgs e)
{
 Graphic resultGraphic = e.Results[0];
 Graphic sourceGraphic = e.UserState as Graphic;
 if (resultGraphic.Geometry.Extent != null && sourceGraphic != null)
 {
  sourceGraphic.Geometry = resultGraphic.Geometry;
  graphicsLayer.Graphics.Add(sourceGraphic);
  MyMap.PanTo(sourceGraphic.Geometry);
 }
}
0 Kudos
JenniferNery
Esri Regular Contributor
0 Kudos
BernardNtiamoah
Deactivated User
Thank you Jennifer
0 Kudos