Click or drag to resize

Envelope Class

Represents an axis-aligned envelope.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Geometry
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.9.0
Syntax
public class Envelope : Geometry

The Envelope type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleEnvelope(MapPoint, MapPoint)
Initializes a new instance of the Envelope class from given diagonal corner points.
Public methodCode exampleEnvelope(MapPoint, Double, Double)
Initializes a new instance of the Envelope class from a center point, with a defined width and height.
Public methodCode exampleEnvelope(Double, Double, Double, Double)
Initializes a new instance of the Envelope class from given diagonal corner coordinates.
Public methodEnvelope(MapPoint, Double, Double, Double)
Initializes a new instance of the Envelope class from a center point, with a defined width, height, and depth.
Public methodCode exampleEnvelope(Double, Double, Double, Double, SpatialReference)
Initializes a new instance of the Envelope class from given diagonal corner coordinates in the given SpatialReference.
Public methodEnvelope(Double, Double, Double, Double, Double, Double)
Initializes a new instance of the Envelope class based on the x, y, and z values.
Public methodCode exampleEnvelope(Double, Double, Double, Double, Double, Double, SpatialReference)
Initializes a new instance of the Envelope class based on the x, y, and z values in the given SpatialReference.
Top
Properties
  NameDescription
Public propertyCode exampleDepth
Gets the depth (ZMax - ZMin) for this envelope.
Public propertyDimension
Gets the number of dimensions for the geometry.
(Overrides GeometryDimension.)
Public propertyExtent
Gets the extent of this Envelope, which is the same as the Envelope itself.
(Overrides GeometryExtent.)
Public propertyGeometryType
The geometry type (always Envelope).
(Overrides GeometryGeometryType.)
Public propertyHasCurves
Gets a value indicating whether the geometry has any curves.
(Inherited from Geometry.)
Public propertyHasM
Gets a value indicating whether this Envelope has M (measure) values.
(Overrides GeometryHasM.)
Public propertyHasZ
Gets a value indicating if this Envelope has Z values.
(Overrides GeometryHasZ.)
Public propertyCode exampleHeight
Gets the height of the Envelope (along Y-axis).
Public propertyIsEmpty
Gets a value indicating whether or not this Envelope is empty.
(Overrides GeometryIsEmpty.)
Public propertyMMax
Gets maximum M (measure) value.
Public propertyMMin
Gets minimum M (measure) value.
Public propertyCode exampleSpatialReference
Gets the spatial reference of this geometry.
(Inherited from Geometry.)
Public propertyCode exampleWidth
Gets the width of this Envelope (along X-axis).
Public propertyCode exampleXMax
Gets the max coordinate along X-axis (upper right corner).
Public propertyCode exampleXMin
Gets the min coordinate along X-axis (lower left corner).
Public propertyCode exampleYMax
Gets the max coordinate along Y-axis (upper right corner).
Public propertyCode exampleYMin
Gets the min coordinate along Y-axis (lower left corner).
Public propertyCode exampleZMax
Gets the max coordinate along Z-axis.
Public propertyCode exampleZMin
Gets the min coordinate along Z-axis.
Top
Methods
  NameDescription
Public methodStatic memberCreateWithM(Double, Double, Double, Double, Double, Double)
Creates an Envelope based on the given x, y, and m values.
Public methodStatic memberCreateWithM(Double, Double, Double, Double, Double, Double, SpatialReference)
Creates an Envelope based on the given x, y, and m values in the given SpatialReference.
Public methodStatic memberCreateWithM(Double, Double, Double, Double, Double, Double, Double, Double)
Creates an Envelope based on the given x, y, z, and m values.
Public methodStatic memberCreateWithM(Double, Double, Double, Double, Double, Double, Double, Double, SpatialReference)
Creates an envelope based on the x, y, z and m values in the given SpatialReference.
Public methodEquals
Checks if two geometries are approximately same, within some tolerance.
(Inherited from Geometry.)
Public methodCode exampleGetCenter
Gets the center of the Envelope.
Public methodIsEqual
Compares two geometries for equality.
(Overrides GeometryIsEqual(Geometry).)
Public methodToJson
Converts this geometry into an ArcGIS JSON representation.
(Inherited from Geometry.)
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Top
Remarks

An envelope is defined by a pair of x,y coordinates representing the lower-left and upper-right vertices of a rectangular bounding-box. The vertices may optionally contain z coordinates and/or m (measure) values. An envelope is associated with a SpatialReference which specifies the coordinate system.

An envelope is typically used to represent the minimum bounding rectangle for a Geometry or to define a simple area of interest such as a Map's extent. Ordinarily, an envelope is a rectangle whose sides are oriented parallel to the x and y axes. These characteristics allow for simpler construction and manipulation of this object than is possible with a polygon.

An envelope may optionally have a Depth, in which case its geometry is that of a rectangular cuboid.

Envelopes are based upon the parent Geometry Class. The Geometry Class is immutable which means that you can not change its shape once it is created. If you need to modify an Envelope once it has been created, use the EnvelopeBuilder Class instead. The ToGeometry Method will provide you with the Envelope object.

Examples

WPF

Example Name: AddEncExchangeSet

Display nautical charts per the ENC specification.

Code example screen shot.

C#
// Copyright 2018 Esri.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
// language governing permissions and limitations under the License.

using System;
using ArcGISRuntime.Samples.Managers;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Hydrography;
using Esri.ArcGISRuntime.Mapping;
using System.Collections.Generic;
using System.Windows;

namespace ArcGISRuntime.WPF.Samples.AddEncExchangeSet
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Add ENC exchange set",
        category: "Hydrography",
        description: "Display nautical charts per the ENC specification.",
        instructions: "Run the sample and view the ENC data. Pan and zoom around the map. Take note of the high level of detail in the data and the smooth rendering of the layer.",
        tags: new[] { "Data", "ENC", "hydrographic", "layers", "maritime", "nautical chart" })]
    [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("9d2987a825c646468b3ce7512fb76e2d")]
    public partial class AddEncExchangeSet
    {
        public AddEncExchangeSet()
        {
            InitializeComponent();

            // Create the UI, setup the control references and execute initialization
            Initialize();
        }

        private async void Initialize()
        {
            // Initialize the map with an oceans basemap
            MyMapView.Map = new Map(Basemap.CreateOceans());

            // Get the path to the ENC Exchange Set
            string encPath = DataManager.GetDataFolder("9d2987a825c646468b3ce7512fb76e2d", "ExchangeSetwithoutUpdates", "ENC_ROOT", "CATALOG.031");

            // Create the Exchange Set
            // Note: this constructor takes an array of paths because so that update sets can be loaded alongside base data
            EncExchangeSet myEncExchangeSet = new EncExchangeSet(encPath);

            try
            {
                // Wait for the exchange set to load
                await myEncExchangeSet.LoadAsync();

                // Store a list of data set extent's - will be used to zoom the mapview to the full extent of the Exchange Set
                List<Envelope> dataSetExtents = new List<Envelope>();

                // Add each data set as a layer
                foreach (EncDataset myEncDataset in myEncExchangeSet.Datasets)
                {
                    // Create the cell and layer
                    EncLayer myEncLayer = new EncLayer(new EncCell(myEncDataset));

                    // Add the layer to the map
                    MyMapView.Map.OperationalLayers.Add(myEncLayer);

                    // Wait for the layer to load
                    await myEncLayer.LoadAsync();

                    // Add the extent to the list of extents
                    dataSetExtents.Add(myEncLayer.FullExtent);
                }

                // Use the geometry engine to compute the full extent of the ENC Exchange Set
                Envelope fullExtent = GeometryEngine.CombineExtents(dataSetExtents);

                // Set the viewpoint
                await MyMapView.SetViewpointAsync(new Viewpoint(fullExtent));
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString(), "Error");
            }
        }
    }
}
XAML
<UserControl x:Class="ArcGISRuntime.WPF.Samples.AddEncExchangeSet.AddEncExchangeSet"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView x:Name="MyMapView"/>
    </Grid>

</UserControl>
See Also
Additional Examples
Hyperlink to ExampleDescription
AddEncExchangeSetDisplay nautical charts per the ENC specification.
AddGraphicsRendererA renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style.
AddGraphicsWithSymbolsUse a symbol style to display a graphic on a graphics overlay.
AnalyzeHotspotsUse a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.
AnimateImageOverlayAnimate a series of images with an image overlay.
AuthorMapCreate and save a map as an ArcGIS `PortalItem` (i.e. web map).
BrowseWfsLayersBrowse a WFS service for layers and add them to the map.
BufferListGenerate multiple individual buffers or a single unioned buffer around multiple points.
ChangeBlendRendererBlend a hillshade with a raster by specifying the elevation data. The resulting raster looks similar to the original raster, but with some terrain shading, giving it a textured look.
ChangeEncDisplaySettingsConfigure the display of ENC content.
ChangeFeatureLayerRendererChange the appearance of a feature layer with a renderer.
ChangeStretchRendererUse a stretch renderer to enhance the visual contrast of raster data for analysis.
ChangeSublayerRendererApply a renderer to a sublayer.
ChangeViewpointSet the map view to a new viewpoint.
ClipGeometryClip a geometry with another geometry.
ClosestFacilityFind a route to the closest facility from a location.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
CreateFeatureCollectionLayerCreate a Feature Collection Layer from a Feature Collection Table, and add it to a map.
CreateGeometriesCreate simple geometry types.
CustomDictionaryStyleUse a custom dictionary style (.stylx) to symbolize features using a variety of attribute values.
DensifyAndGeneralizeA multipart geometry can be densified by adding interpolated points at regular intervals. Generalizing multipart geometry simplifies it while preserving its general shape. Densifying a multipart geometry adds more vertices at regular intervals.
DictionaryRendererGraphicsOverlayThis sample demonstrates applying a dictionary renderer to graphics, in order to display military symbology without the need for a feature table.
DisplayKmlDisplay KML from a URL, portal item, or local KML file.
DisplaySubtypeFeatureLayerDisplays a composite layer of all the subtype values in a feature class.
DisplayUtilityAssociationsCreate graphics for utility associations in a utility network.
DisplayWfsDisplay a layer from a WFS service, requesting only features for the current extent.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
EditKmlGroundOverlayEdit the values of a KML ground overlay.
ExportTilesDownload tiles to a local tile cache file stored on the device.
FeatureLayerGeodatabaseDisplay features from a local geodatabase.
FeatureLayerQueryFind features in a feature table which match an SQL query.
FeatureLayerSelectionSelect features in a feature layer.
FeatureLayerShapefileOpen a shapefile stored on the device and display it as a feature layer with default symbology.
FindAddressFind the location for an address.
FindPlaceFind places of interest near a location or within a specific area.
FindRouteDisplay directions for a route between two points.
FindServiceAreasForMultipleFacilitiesFind the service areas of several facilities from a feature service.
GenerateGeodatabaseGenerate a local geodatabase from an online feature service.
GenerateOfflineMapTake a web map offline.
GenerateOfflineMapWithOverridesTake a web map offline with additional options for each layer.
GeodatabaseTransactionsUse transactions to manage how changes are committed to a geodatabase.
GroupLayersGroup a collection of layers together and toggle their visibility as a group.
IdentifyKmlFeaturesShow a callout with formatted content for a KML feature.
IdentifyRasterCellGet the cell value of a local raster at the tapped location and display the result in a callout.
ListKmlContentsList the contents of a KML file.
ListTransformationsGet a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.
LocalServerFeatureLayerStart a local feature service and display its features in a map.
LocalServerGeoprocessingCreate contour lines from local raster data using a local geoprocessing package `.gpk` and the contour geoprocessing tool.
LocalServerMapImageLayerStart the Local Server and Local Map Service, create an ArcGIS Map Image Layer from the Local Map Service, and add it to a map.
MapImageLayerTablesFind features in a spatial table related to features in a non-spatial table.
NearestVertexFind the closest vertex and coordinate of a geometry to a point.
OfflineBasemapByReferenceUse the `OfflineMapTask` to take a web map offline, but instead of downloading an online basemap, use one which is already on the device.
OfflineGeocodeGeocode addresses to locations and reverse geocode locations to addresses offline.
OfflineRoutingSolve a route on-the-fly using offline data.
ProjectProject a point from one spatial reference to another.
QueryFeatureCountAndExtentZoom to features matching a query and count the features in the current visible extent.
RasterColormapRendererApply a colormap renderer to a raster.
RasterHillshadeUse a hillshade renderer on a raster.
RasterLayerFileCreate and use a raster layer made from a local raster file.
RasterLayerGeoPackageDisplay a raster contained in a GeoPackage.
RasterLayerRasterFunctionLoad a raster from a service, then apply a function to it.
RasterRenderingRuleDisplay a raster on a map and apply different rendering rules to that raster.
RasterRgbRendererApply an RGB renderer to a raster layer to enhance feature visibility.
ReadShapefileMetadataRead a shapefile and display its metadata.
RenderPictureMarkersUse pictures for markers.
SceneLayerSelectionIdentify features in a scene to select.
SceneLayerUrlDisplay an ArcGIS scene layer from a URL.
SelectEncFeaturesSelect features in an ENC layer.
ServiceFeatureTableCacheDisplay a feature layer from a service using the **on interaction cache** feature request mode.
ServiceFeatureTableNoCacheDisplay a feature layer from a service using the **no cache** feature request mode.
SetInitialMapAreaDisplay the map at an initial viewpoint representing a bounding geometry.
ShowPopupShow predefined popups from a web map.
SimpleRenderersDisplay common symbols for all graphics in a graphics overlay with a renderer.
StatisticalQueryQuery a table to get aggregated statistics back for a specific field.
StyleWmsLayerChange the style of a Web Map Service (WMS) layer.
TraceUtilityNetworkDiscover connected features in a utility network using connected, subnetwork, upstream, and downstream traces.
ViewPointCloudDataOfflineDisplay local 3D point cloud data.
WfsXmlQueryLoad a WFS feature table using an XML query.
WmsIdentifyIdentify features in a WMS layer and display the associated popup content.
WMSLayerUrlDisplay a WMS layer using a WMS service URL.