Click or drag to resize

ImageServiceRaster Class

An instance of this class represents a raster that is retrieved from an ArcGIS image service.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.RastersRaster
    Esri.ArcGISRuntime.RastersImageServiceRaster

Namespace:  Esri.ArcGISRuntime.Rasters
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public sealed class ImageServiceRaster : Raster

The ImageServiceRaster type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleImageServiceRaster
Initializes a new instance of the ImageServiceRaster class from the given URI.
Top
Properties
  NameDescription
Public propertyCredential
Gets or sets the security credential used to access a remote image service.
Public propertyFunction
Gets the raster function for this instance.
(Inherited from Raster.)
Public propertyLoadError
Gets the load status of raster.
(Inherited from Raster.)
Public propertyLoadStatus
Gets the load status of raster.
(Inherited from Raster.)
Public propertyPath
Gets the raster path for this instance.
(Inherited from Raster.)
Public propertyRasterType
Gets the type of the raster (data source)
(Inherited from Raster.)
Public propertyCode exampleRenderingRule
Gets or sets the RenderingRule object.
Public propertyCode exampleServiceInfo
Gets the ArcGISImageServiceInfo object.
Public propertyUri
Gets the image service URI.
Top
Methods
  NameDescription
Public methodCancelLoad
Cancels an ongoing load.
(Inherited from Raster.)
Public methodCode exampleLoadAsync
Initiates loading of raster.
(Inherited from Raster.)
Public methodRetryLoadAsync
Retry loading raster.
(Inherited from Raster.)
Top
Events
  NameDescription
Public eventLoaded
Occurs when raster is loaded.
(Inherited from Raster.)
Public eventLoadStatusChanged
Occurs when raster's LoadStatus is changed.
(Inherited from Raster.)
Top
Remarks
An image service provides access to raster data through a web service. A single raster dataset or a mosaic dataset which contains a collection of raster datasets can be served as one image service. The mosaic dataset can dynamically process and mosaic the images on the fly. An image service supports accessing both the mosaicked image and its catalog, as well as individual rasters in the catalog. An image service raster allows you to display raster data from image services using a RasterLayer. It also allows you to apply service-defined or client-defined rendering rules by setting RenderingRule on it. You can pass an image service raster as a raster input to an RasterFunction to work with local raster functions. The image service raster is derived from the raster class.
Examples

Android

Example Name: RasterLayerImageServiceRaster

Create a raster layer from a raster image service.

Code example screen shot.

C#
// Copyright 2017 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 Android.App;
using Android.OS;
using Android.Widget;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Rasters;
using Esri.ArcGISRuntime.UI.Controls;
using System;

namespace ArcGISRuntime.Samples.RasterLayerImageServiceRaster
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "ArcGIS raster layer (service)",
        "Layers",
        "Add a raster layer from an image service to a map.",
        "")]
    public class RasterLayerImageServiceRaster : Activity
    {
        // Create and hold reference to the used MapView.
        private MapView _myMapView;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Title = "ArcGIS raster layer (service)";

            CreateLayout();
            Initialize();
        }

        private void Initialize()
        {
            // Create new map with the dark gray canvas basemap.
            Map myMap = new Map(Basemap.CreateDarkGrayCanvasVector());

            // Create a Uri to the image service raster.
            Uri myUri = new Uri("https://gis.ngdc.noaa.gov/arcgis/rest/services/bag_hillshades/ImageServer");

            // Create new image service raster from the Uri.
            ImageServiceRaster myImageServiceRaster = new ImageServiceRaster(myUri);

            // Create a new raster layer from the image service raster.
            RasterLayer myRasterLayer = new RasterLayer(myImageServiceRaster);

            // Add the raster layer to the maps layer collection.
            myMap.Basemap.BaseLayers.Add(myRasterLayer);

            // Assign the map to the map view.
            _myMapView.Map = myMap;

            // zoom in to the San Francisco Bay.
            _myMapView.SetViewpointCenterAsync(new MapPoint(-13643095.660131, 4550009.846004, SpatialReferences.WebMercator), 100000);
        }

        private void CreateLayout()
        {
            // Create a new vertical layout for the app.
            LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };

            // Add the map view to the layout.
            _myMapView = new MapView(this);
            layout.AddView(_myMapView);

            // Show the layout in the app.
            SetContentView(layout);
        }
    }
}
Examples

Xamarin Forms Android

Example Name: RasterLayerImageServiceRaster

Create a raster layer from a raster image service.

Code example screen shot.

C#
// Copyright 2017 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 Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Rasters;
using System;
using Xamarin.Forms;

namespace ArcGISRuntime.Samples.RasterLayerImageServiceRaster
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "ArcGIS raster layer (service)",
        "Layers",
        "Add a raster layer from an image service to a map.",
        "")]
    public partial class RasterLayerImageServiceRaster : ContentPage
    {
        public RasterLayerImageServiceRaster()
        {
            InitializeComponent ();

            Initialize();
        }

        private void Initialize()
        {
            // Create new map with the dark gray canvas basemap.
            Map myMap = new Map(Basemap.CreateDarkGrayCanvasVector());

            // Create a Uri to the image service raster. (NOTE: iOS applications require the use of Uri's to be https:// and not http://)
            Uri myUri = new Uri("https://gis.ngdc.noaa.gov/arcgis/rest/services/bag_hillshades/ImageServer");

            // Create new image service raster from the Uri.
            ImageServiceRaster myImageServiceRaster = new ImageServiceRaster(myUri);

            // Create a new raster layer from the image service raster.
            RasterLayer myRasterLayer = new RasterLayer(myImageServiceRaster);

            // Add the raster layer to the maps layer collection.
            myMap.Basemap.BaseLayers.Add(myRasterLayer);

            // Assign the map to the map view.
            MyMapView.Map = myMap;

            // zoom in to the San Francisco Bay.
            MyMapView.SetViewpointCenterAsync(new MapPoint(-13643095.660131, 4550009.846004, SpatialReferences.WebMercator), 100000);
        }
    }
}
XAML
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"             
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
             xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime" 
             x:Class="ArcGISRuntime.Samples.RasterLayerImageServiceRaster.RasterLayerImageServiceRaster">
  <Grid>
    <esriUI:MapView x:Name="MyMapView"/>
  </Grid>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
RasterLayerImageServiceRasterCreate a raster layer from a raster image service.
RasterLayerRasterFunctionShow a raster layer from an image service with a raster function applied.
RasterRenderingRuleDisplay a raster on a map and apply different rendering rules to that raster.