+ Reply to Thread
Results 1 to 5 of 5

Thread: Problem with reprojection

  1. #1
    Roger Vaca
    Join Date
    Sep 2011
    Posts
    11
    Points
    0
    Answers Provided
    2


    0

    Default Problem with reprojection

    Hi, I'm having the following issue:

    Click image for larger version

Name:	projection.jpg
Views:	44
Size:	196.9 KB
ID:	13896

    The yellow flag is a point feature with WGS 84 zone 20S projection (wkid: 32720), in a feature layer. Using Bing or ArcGIS Online map, that point is correctly drawn by the viewer. The green star is a graphic added to a graphic layer in the same projection (32720) with the same x,y coordinate.

    Why are they drawn in different places?

    Regards,
    Roger.

  2. #2
    Demin Hu
    Join Date
    Apr 2010
    Posts
    136
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem with reprojection

    How you add that green point, can you show your code here?

  3. #3
    Jennifer Nery

    Join Date
    May 2010
    Posts
    2,449
    Points
    289
    Answers Provided
    51


    0

    Default Re: Problem with reprojection

    Does your GraphicsLayer Graphic.Geometry has its SpatialReference set?
    Jennifer Nery
    Software Developer
    ArcGIS API for SL/WPF/WP7

  4. #4
    Roger Vaca
    Join Date
    Sep 2011
    Posts
    11
    Points
    0
    Answers Provided
    2


    0

    Default Re: Problem with reprojection

    Quote Originally Posted by deminhu View Post
    How you add that green point, can you show your code here?
    This is the code:

    var point = results[0].Geometry as MapPoint;

    GraphicsLayer graphicsLayer;

    Layer layer = Mapa.Layers["X,Y Point"];
    bool isNull = (layer != null);
    bool isGraphicLayer = (layer is GraphicsLayer);
    if (isNull && isGraphicLayer)
    {
    graphicsLayer = layer as GraphicsLayer;
    }
    else
    {
    graphicsLayer = new GraphicsLayer();
    graphicsLayer.ID = "X,Y Point";
    graphicsLayer.SetValue(MapApplication.LayerNameProperty, nombreCapaGrafica);
    }

    graphicsLayer.ClearGraphics();
    graphicsLayer.Graphics.Add(results[0]);

    if (MapApplication.Current.Map.Layers[graphicsLayer.ID] == null)
    {
    MapApplication.Current.Map.Layers.Add(graphicsLayer);
    }

    Regards.

  5. #5
    Roger Vaca
    Join Date
    Sep 2011
    Posts
    11
    Points
    0
    Answers Provided
    2


    0

    Default Re: Problem with reprojection

    Quote Originally Posted by jenniferdnery View Post
    Does your GraphicsLayer Graphic.Geometry has its SpatialReference set?
    No, the spatial reference is null, and I don't know how to set it, because the SpatialReference property is read only. What am I missing?

    Regards.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts