[GIS] ArcGIS API for Silverlight – pass geometries to ESRI service

arcgis-silverlight-apicgeometry

How would I test this service to find what it wants? http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/MapServer/exts/ElevationsSOE/ElevationLayers/1/GetElevations

It says geometries. But does it want a polyline or a point. I tried just putting a lat/long in the dialog box but no go.

What I have is a result from a densify service

void DensifyService_DensifyCompleted(object sender, GraphicsEventArgs e)
    {
        GraphicsLayer graphicsLayerVertices = MyMap.Layers["VerticesGraphicsLayer"] as GraphicsLayer;
        foreach (Graphic graphic in e.Results)
        {
            ESRI.ArcGIS.Client.Geometry.Polyline p = graphic.Geometry as ESRI.ArcGIS.Client.Geometry.Polyline;


            foreach (ESRI.ArcGIS.Client.Geometry.PointCollection pc in (graphic.Geometry as Polyline).Paths)
            {
                foreach (MapPoint point in pc)
                {
                    Graphic vertice = new Graphic()
                    {
                        Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol,
                        Geometry = point
                    };
                    graphicsLayerVertices.Graphics.Add(vertice);
                }
            }

        }
        DensifyButton.IsEnabled = true;
    }

So what I am wanting to do is get each MapPoint geometries from the
foreach (MapPoint point in pc)

And figure out how to get that into a list or whatever format is needed by the elevation service at the top of the question. Thanks.

Best Answer

Have you seen this blog post and the sample included in the SOE source code? They got me on the right track

http://blogs.esri.com/Dev/blogs/apl/archive/2010/10/07/Elevation-Server-Object-Extension.aspx

http://resources.arcgis.com/gallery/file/arcobjects-net-api/details?entryID=87BEC705-1422-2418-34B5-308930DE323A

A typical string that I am passing from my app is: GetElevationData?Extent={"spatialReference":{"wkid":2246},"xmax":1202184.46609375,"xmin":1194752.28390625,"ymax":248223.36453125,"ymin":240791.18234375}&Rows=51&Columns=51&f=json

Related Question