Measuring features
The measure tool allows you to calculate measurements by drawing and measuring points, lines, circles, ellipses, rectangles, and polygons. The measure tool also provides the ability to get the measurements of features on the map. Linear and areal measurements can be retrieved in a number of different units.
For developers, the measure tool's full source code has been made public on ArcGIS Online and provides an example of an advanced tool implemented using best practices. The implementation follows the Model View ViewModel (MVVM) pattern, shows how to interact with the map and add graphics programmatically, demonstrates how to make an add-in localizable, and more. To view the source code, download the Measure tool sample from ArcGIS Online and open the MeasureTool.sln file. To debug the add-in, follow the instructions provided in the Deployment and Use Instructions text file included with the sample.
Geodesic versus Euclidean measurements
The term Geodesic means calculating the shortest distance between two points on a curved surface. Geodesic algorithms are therefore uniquely suited to calculating length and area of measurements of features on the (nearly spherical) surface of the earth. The geodesic algorithm uses the concept of a great circle to obtain the shortest route between two points along the Earth's surface. This contrasts with algorithms based on Euclidean geometry, which assume a flat (planar) surface to derive measurements.
Although not perfect, the length and area measurements obtained via the geodesic functions are generally more accurate than the corresponding Euclidean functions. Geodesic measurements are based on the approximate shape of the earth (geoid), while Euclidean functions are based upon a projection (i.e. a flat 2D representation of a 3D surface) which introduces distortion, especially over large areas.
The ArcGIS API for Silverlight provides both a Euclidean and a Geodesic class for calculating measurements. If using both measurement techniques in your app, you may notice descrepancies between the results. If such a case, trust the geodesic measurement. The Measure tool uses geodesic algorithms to ensure the best accuracy.
Draw and measure geometries:
- Add the Measure tool to a toolbar by following the steps in Adding and managing tools and toolbars
- Click the Measure button on the toolbar to open the Measure dialog box.
- Select the shape to draw. The available shapes, from left to right, are point, line, freehand line, rectangle, circle, ellipse, polygon, and freehand polygon.
- Draw the shape on the map. When hovering the pointer over the map, a message appears next to the mouse cursor with instructions specific to the type of shape selected for drawing.
- Once a shape is drawn on the map, measurements are calculated and displayed at the bottom of the Measure dialog box. To change the units used for the measurements, select the desired unit from the drop-down menus that appear next to the measurements.
Measure features on the map:
- Add the Measure tool to a toolbar by following the steps in Adding and managing tools and toolbars
- Click the Measure button on the toolbar to open the Measure dialog box.
- From the top of the dialog box, click the Select features to measure button. If this button is not visible, the map does not contain any measurable layers.
- From the Layer drop-down menu, select the desired layer.
- If the selected layer is a map service layer, then a sub-layer drop-down menu appears on the dialog box. If this is visible, select the desired layer within the map service.
- Click a feature belonging to the selected layer.
- Once a feature is clicked, measurements are calculated and displayed at the bottom of the Measure dialog box. To change the units used for the measurements, select the desired unit from the drop-down menus that appear next to the measurements.