Select to view content in your preferred language

Issue with 'ESRI.ArcGIS.Client.Geometry.Geometry' in WCF service

744
3
04-29-2013 02:43 PM
jayshukla
Regular Contributor
Hi There, I am having this issue with using Geomtry that is returned from a WCF service. As part of the service, I have added a service reference for the map service that I am using in this project. I am trying to return 'ESRI.ArcGIS.Client.Geometry.Geometry as a return type but when I assign the Geomtry to my result, it comes back with this error: 'Geometry' is an ambiguous reference between 'GIS.Services.Data.BoundaryMapService.Geometry' and 'ESRI.ArcGIS.Client.Geometry.Geometry'. I am not sure what needs to be done to resolve this issue. Appreciate any feedback. Thanks Jay

                ESRI.ArcGIS.Client.Geometry.Geometry resultGeometry = null;

                for (int i = 0; i < attributes.Values.Count(); i++)
                    if (attributes.Values is PolygonN)
                    {
                        PolygonN featureExtent = attributes.Values as PolygonN;
                        resultGeometry = featureExtent; // Error here...

                    }
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
You cannot mix two different geometry models. What you are essentially doing is assigning one type to a completely different type, which naturally isn't allowed. You will need to write some code that converts PolygonN into Client.Geometry.Polygon.
0 Kudos
jayshukla
Regular Contributor
Thanks Morten for your feedback. I havent done much with Silverlight API but I am curious if here a way to get the vertices from PolygonN. This way I can get the vertices of the geomtry and pass it as a list. Are there are resources thst have sample showing how to do this. Thanks again. Jay



You cannot mix two different geometry models. What you are essentially doing is assigning one type to a completely different type, which naturally isn't allowed. You will need to write some code that converts PolygonN into Client.Geometry.Polygon.
0 Kudos
dotMorten_esri
Esri Notable Contributor
Sorry I don't know much about PolygonN. You might want to refer to the ArcObjects documentation and forums for that.
0 Kudos