I am making a buffer in an ArcGIS Pro Add-in. How do I set the units? GeometryEngine.Instance.Buffer() takes a geometry and a distance. How do I get the map's units so I can choose the metric or US value I give the buffer method?
Hi Steve,
You may want to look at the ArcGISDynamicMapServiceLayer
Example
private void theArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e) { // Get the ArcGISDynamicMapServiceLayer. ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer theArcGISDynamicMapServiceLayer = null; theArcGISDynamicMapServiceLayer = (ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer)sender; // Get and display the ArcGISDynamicMapServiceLayer.Units information. string theUnits = theArcGISDynamicMapServiceLayer.Units; TextBlock_Units.Text = theUnits; // Get and display the ArcGISDynamicMapServiceLayer.SpatialReference information. ESRI.ArcGIS.Client.Geometry.SpatialReference theSpatialReference = theArcGISDynamicMapServiceLayer.SpatialReference; if (theSpatialReference != null) { int theWKID = theSpatialReference.WKID; string theWKT = theSpatialReference.WKT; if (theWKID != 0) { TextBlock_SpatialReference.Text = "WKID: " + theWKID.ToString(); } else { TextBlock_SpatialReference.Text = "WKT: " + theWKT; } } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.