Hi,I'm looking for a way to get the Geometry Type of a layer, giving its URL (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Average_Household_Size/MapServer/1 returns esriGeometryPolygon in REST but how can I get it programmatically?Thanks a lot,Miri
private void GetLayerDescription() { var webClient = new WebClient(); webClient.OpenReadCompleted += DownloadComplete; webClient.OpenReadAsync(new Uri("http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Average_Household_Size/MapServer/1?f=json")); } private string _geometryType; private void DownloadComplete(object sender, OpenReadCompletedEventArgs e) { if ( e.Error != null ) return; var jsonObject = JsonValue.Load(e.Result) as JsonObject; if ( jsonObject == null ) return; JsonValue geometryTypeJsonValue; if ( jsonObject.TryGetValue("geometryType", out geometryTypeJsonValue) ) { _geometryType = geometryTypeJsonValue; } }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.