Tag: Sample

How to extract raster values at point locations?


Many a times, in your analysis, you might need to extract values from rasters based on point locations. The Spatial Analyst extension offers several tools that can do this for you, those being Extract Values to Points, Extract Multi Values … Continue reading

Posted in Analysis & Geoprocessing, ArcGIS Pro, ArcMap | Tagged , , , , , , , | Leave a comment

Vehicle Commander Template updated and available for download

New Vehicle Commander Overview

The Vehicle Commander Template has been updated to version 10.1.1 and is now available for download from Arcgis.com. The Vehicle Commander application template is a model for developing an in-vehicle situational awareness application using ArcGIS Runtime 10.1.1 for Java. The … Continue reading

Posted in Defense | Tagged , , , , , , , , , , , , , , , , | 1 Comment

Vehicle Commander Template is available for download

Vehicle Commander Application parts

The Vehicle Commander Template is available for download from Arcgis.com.  The vehicle commander application template is a model for developing an in-vehicle situational awareness application using ArcGIS Runtime SDK 1.0 for Java. You can use the Vehicle Commander template to … Continue reading

Posted in Defense | Tagged , , , , , , , , , , , , , | 2 Comments

Displaying your geoprocessing raster output in your web application (using Silverlight)

When you are developing a Geoprocessing service that generates Raster dataset as output (e.g. Viewshed or Hillshade analysis), you will find the output Raster dataset cannot be rendered directly in your web application.

In order to display the Geoprocessing Raster output in the web application, you have to follow the following steps:

Continue reading

Posted in Analysis & Geoprocessing, Developer, Imagery, Services, Web | Tagged , , , , , , , , , | 15 Comments

Customizing the editing environment: Changing feature template properties

Feature templates provide an easy way to streamline the creation of features while editing. Choosing a feature template determines which layer the feature will be created in, the attributes the new feature will have, and the default construction tool that will be used to create the new feature. These properties can be changed through the user interface or developer customizations.

This post explains how an add-in can update a feature template property. I posted it to the Editing Labs group on ArcGIS.com so other users can install it. The add-in can be accessed directly at http://esriurl.com/2066.

Setting the default feature construction tool
I am editing a layer of building features and need to create new footprint polygons.  My map contains feature templates with default attributes for each category of building I am capturing, such as Office, Residential, and Retail types. The Polygon tool is currently set as the default construction tool for all the templates. Because I am going to draw mostly rectangular features, I can set the default construction tool to Rectangle so that tool automatically becomes active on the Create Features window instead. Setting an appropriate default tool helps me avoid the extra click to switch from the Polygon tool to the Rectangle tool when drawing the rectangular buildings.

While I could change any feature template property manually on the Organize Feature Templates dialog box or the Template Properties dialog box, a simple add-in customization is an easy way to do it quickly for multiple feature templates at once. This add-in updates the default construction tool for all feature templates in a layer.


Writing the add-in
I can create the add-in within Visual Studio as an ArcMap button add-in. I’ll need to reference ESRI.ArcGIS.Carto and ESRI.ArcGIS.Editor, in addition to the default ESRI add-in references.
The full code for the add-in is as follows:

public class
SetTemplateTool : ESRI.ArcGIS.Desktop.AddIns.Button


IEditor3 m_editor;


public SetTemplateTool()


m_editor = ArcMap.Application.FindExtensionByName(“esriEditor.Editor”)



protected override
void OnClick()


// get the selected template and current tool

IEditTemplate currentTemplate =

ICommandItem currentTool =


for (int
i = 0; i < m_editor.TemplateCount -1; i++)


IEditTemplate editTemplate =

if (editTemplate.Layer.Name ==


Guid g = new

editTemplate.Tool = g;




protected override
void OnUpdate()


this.Enabled = (m_editor.EditState ==



The code simply loops through all the possible templates in the map during an edit session, identifies those that share the same layer as the currently selected template, and sets the default tool on those templates to the tool active in the Construction Tools portion of the Create Features window. It is important to note that this code only works within an edit session. I can still make programmatic changes to feature templates in a map outside of an edit session, but I must set them via the layer extension instead of the Editor object that already knows about all templates in the map.  

While this particular add-in only changes the default tool for a template, I could have also changed the default values for other template properties during this edit session via the properties and methods on IEditTemplate. For more information on working with feature templates, see Using feature templates in the ArcGIS 10 ArcObjects .NET SDK help.

Content provided by Sean Jones (Editing Team)

Posted in Developer, Editing | Tagged , , , , , , , , , , | Comments Off

Migrating DSMapBooks to Data Driven Pages

Migrating your map books from the Map Book Developer Sample, DSMapBook, to data driven pages in ArcGIS 10 is a pretty straight forward process. It is not automatic, but many people have already done it and have found it to be quick and easy. The majority of the standard map book functionality is available in ArcGIS 10 without needing to write any Python scripts or having to dig into ArcObjects. How you do things with data driven pages is different, but the functionality for multiple pages, printing and exporting, creating index features, adding dynamic titles and text, creating locator maps, etc. is all there, out of the box.

It will depend on the complexity of your maps, but if you already have map documents and index layers, the basic process for migrating to data driven pages is not difficult. The workflow is as follows:

1)    Open the map document
2)    Open the data driven pages property page,
3)    Select the layer you used for your map extents as the index layer
4)    Update your dynamic text and titles using new dynamic text tags

If you have dynamic locator maps or custom page effects (like highlighting the current page), you can achieve these with some new data frame properties. The following blog post should help with this:

This gets more complex if you have customized the map book developer sample, or if you use the indexing functionality to generate a place name index, or a gazetteer. These require using some of the new arcpy.mapping Python scripting capabilities. If you have customized the developer sample in some way, first I would recommend reading about and trying the new functionality in ArcGIS 10 related to data driven pages. Some of the common customizations can be done out of the box now. If you are not able to accomplish what you need, the next step would be evaluating whether you can do it with using the new arcpy.mapping Python module that is available. We have included many sample scripts on the Resource Center to help you out including a sample for generating indexes

Supported map books, without the need for a developer sample should be a big benefit at ArcGIS 10. The migration process should be straight forward, and once it is done, it’s done. Spend some time reviewing the resources that are available and then give it a try with one of your map books. Here are some other resources that might be helpful to read before you start:

Blog post on creating map books with ArcGIS 10

Blog post on data driven pages

Desktop help on enabling data driven pages

Desktop help on working with dynamic text

Blog post on getting started with Python and map automation

Posted in Uncategorized | Tagged , , , , , , | 3 Comments

Using the Mosaic Image Finder add-in

Last week, the Mosaic Image Finder add-in for ArcMap was added to the sample gallery. This window provides an interactive interface to explore the overlapping images in a mosaic dataset (or image service).

Once you’ve installed the Add-in, simply (1) add a mosaic dataset (or image service published from a mosaic dataset) to ArcMap. (2) Zoom to an area of interest, then (3) drag-and-drop the mosaic dataset into the Mosaic Image Finder window.

Each image contained in the display view will load into the Mosaic Finder Window. You can click on the window and move your mouse to tilt the view.

You can click on the fields to sort the images and click the ascending/descending arrow buttons to help filter the images that are displayed.

You can click on each image to view its metadata and the window will display a wireframe to show where in the stack the image displays. You can then click the Add button to add this selection to your ArcMap.


Submitted by: Melanie Harlow


Posted in Imagery, Services | Tagged , , , , , | Leave a comment

Creating Place Name Indexes for Map Books

ArcGIS 10 includes the ability to make multiple-page map books using data driven pages. However, map books are often a collection of information in addition to the maps, for example, title pages, tables of contents, and index pages.  So, in addition to data driven pages, ArcGIS 10 includes the arcpy.mapping Python module that provides the ability to create and combine a series of pages into a final map book product.  

Building an index or gazetteer of place names is a common requirement for map books, and data driven pages by themselves do not provide a solution for building the index pages. However, Python scripting can be used to create these. We have placed a sample on the Resource Center to help. The sample combines the use of Data Driven Pages, arcpy.mapping, and a 3rd party PDF design toolkit called ReportLab to create a final map book product with index pages.


Indexes can vary greatly from organization to organization. The rules for what is indexed, how the index table is compiled, and the index formats can differ widely.  This sample provides one example. However, both the geoprocessing workflow and script can be customized for your particular index needs (Note:  In the geoprocessing steps in this example the Frequency tool is used that requires an ArcInfo license.).  Also, one of the nice things about using ReportLab is it gives you all sorts of formatting options for the results.  The arcpy.mapping Map Book with Index Pages sample can be downloaded here.

Content provided by David W.

Posted in Uncategorized | Tagged , , , , , , , , | 2 Comments

Changing the display of image services dynamically in a Web API

Last week, we posted up a sample web application to navigate and explore an image service. This week we will examine some of the Silverlight code that was used in the sample.

Web clients can dynamically change the display of image services, such as format, band composition, interpolation, compression quality, nodata value, projection, and (starting from ArcGIS Server 10) clients can also specify a raster function to be applied by ArcGIS Server.

Band Combination

Changing band composition on-the-fly can be particularly useful when service has more than 3 bands, such as a Landsat service. This give you the ability to change to true color or false color composition.
isLayer.BandIds = new int[]{2,1,0}; //0-based; shown in Silverlight code


You can change format of the returned service on-the-fly. For instance, you may use the new “JPGPNG” format, which returns a PNG when the request extent contains transparent pixels, and returns a JPG when there are no transparent pixels. JPGPNG is the default format in Web API and is recommended for web developers.
isLayer.ImageFormat = ArcGISImageServiceLayer.ImageServiceImageFormat.JPGPNG;

Compression Quality

The compression quality is a useful way to transmit the service faster when limited bandwidth is an issue. A lower compression quality transmits a lower quality image, but the image can be transmitted faster. Compression quality only applies when the JPG format is used. Compression quality ranges from 1 (low quality) to 100 (high quality).
isLayer.CompressionQuality = 50;

The display resampling method can be customized for your service. You should use bilinear or cubic for continuous data such as elevation of imagery. You should use nearest neighbor or majority for discrete data such as land use classification.
isLayer.Interpolation = ArcGISImageServiceLayer.ImageServiceInterpolation.BilinearInterpolation;


You can define a nodata value for any pixels that should not have a pixel value, such as the background border of a satellite image. When you display Nodata as a PNG format, these pixels will be displayed as transparent.
isLayer.NoData = 0;

Raster Functions
At ArcGIS 10, client can specify a rendering rule and ask ArcGIS Server to apply it on top of image service. This is done through a number of raster functions, 8 raster functions are supported through REST: Hillshade, ShadedRelief, Slope, Aspect, Colormap, Statistics, Stretch, NDVI. Web clients can leverage these raster functions to achieve different visualization goals. In many cases, you may want to apply a different stretch on an RGB service, or a color map on a single band service, and a shaded relief on an elevation service.

RenderingRule renderingRule = new RenderingRule();
renderingRule.RasterFunctionName = “Hillshade”; //Refer function name in REST SDK
functionArguments.Add(“Azimuth”, 315.0); //Refer arguments in REST SDK
functionArguments.Add(“Altitude”, 45.0);
functionArguments.Add(“ZFactor”, 1.0);
renderingRule.RasterFunctionArguments = functionArguments;
isLayer.RenderingRule = renderingRule;

You can view live samples online: JavaScript, Flex, Silverlight.
As described above, image service web API provides a number of different ways that you can change the appearance of image service on the fly. You can expose them in web applications so users can visualize image services on demand. This means that you can use fewer services to serve multiple purposes. For example, one Landsat service is enough for true-color, false-color, and NDVI display; one elevation service is enough for slope, aspect and shaded relief visualization.  Note: Image services are automatically projected to the map’s coordinate system when used in Web APIs.

Submitted by: Wenxue Ju

Posted in Imagery, Services | Tagged , , , , , , , , | 4 Comments

"Image Service Explorer 3.0" web application sample is now available

“Image Service Explorer” is a web application has been updated. This sample is version 3.0.

It provides the following functionalities:
- dynamically renders an image service by applying different band combinations, resampling methods, or raster functions,
- controls how a collection of imagery (in one image service) is mosaicked on-the-fly by applying different mosaic methods,
- queries image services, check associated metadata, and download (or clip) source rasters or mosaicked/processed images,
- identifies pixel values of an image service and draw distance-value or time-series profiles,
- animate the image service if it is time enabled.

Download this sample web application

Submitted by: Wenxue Ju

Posted in Imagery, Services | Tagged , , , , , , | 3 Comments