Tag: ArcMap

Moving to Add-ins (Recycling VBA)

In the Spring edition of ArcUser there is a nice article by Craig Gallant (LJB Inc) on converting existing projects to ArcGIS Add-ins.

Here how’s the article starts…

You might ask this after installing ArcGIS 10. With the release of ArcMap 10, Visual Basic for Applications (VBA) is on the way out. As the online help article “Migrating VBA customizations to ArcGIS 10″ explains, “VBA no longer provides the best toolset for customizing ArcGIS and is not included in the default installation.”

At ArcGIS 10, there are two new ways to customize in ArcGIS 10: Python and the new ArcGIS Desktop Add-in. [Add-ins are a new way to customize and extend ArcGIS 10. They are authored in .NET or Java and Extensible Markup Language (XML). They provide a declaratively based framework for creating a collection of customizations that can be conveniently packaged in a single compressed file that is easily shared. Add-ins do not require installation programs or Component Object Model (COM) registration.] Both options have advantages and disadvantages. You need to pick the option that best suits your application. This article shows how, with a little refactoring, existing VBA code can quickly be converted to an ArcGIS Desktop Add-in.

for more see ArcUser Online

 

Posted in Developer | Tagged , , , , , , , , , , , | Leave a comment

Taking full advantage of dynamic text

At 10 we released dynamic text for the layout. This is layout text that updates automatically based on a property from the map, a data frame, or the computer system.  Additionally, if you are using data driven pages, dynamic text can be used for page names, page numbers, or attributes from the index layer.  Dynamic text uses tags in a standard text element string to specify the properties to return. You can use dynamic text to display things like the current date and time, the current user logged in to the computer, or the map author. The most common dynamic text tags can be added using the Insert > Dynamic Text menu.  However, this is only a small number of the types and formats that can be used.

A dynamic text tag always includes a type, for example <dyn type =”document”/> is how you access properties of the map document and <dyn type =”page”/> is used to access properties of data driven pages.  There are seven types available. In addition to document and page are computer, user, date, time, and data frame. For each type there are additional properties or formatting options. You can specify these using the key words property and format.  For example,  <dyn type=”document” property=”credits”/> will return the credits stored in the map document properties, and <dyn type=”date” format=”dddd MMM yyyy”/> will return Thursday Sep 2010.

When working with data driven pages you can return the value of any attribute in your page index layer. Simply specify the dynamic type as page and the property as the attribute. For example, <dyn type =”page” property=”POP_2000”/> will return the population value of the POP_2000 attribute for the current page. 

There are other things you can do with dynamic text. For example, you can add the corner coordinates of your data frame to your layout.  Using the data frame type and the properties for upper left, upper right, lower left and lower right you can access the coordinates of each corner.  For example, <dyn type=”dataFrame” name=”DataFrameName” property=”upperLeft.x” units=”dms” decimalPlaces=”2″/> will return the x coordinate in degrees minutes seconds for the upper left corner of your data frame and <dyn type=”dataFrame” name=”DataFrameName” property=”upperLeft.y” units=”dms” decimalPlaces=”2″/> will return the y coordinate. If you pan and zoom, the coordinate will update dynamically with the changes to position.

 

There are a few special tags for handling null values or empty strings, and for specifying strings that appear either before or after the dynamic text.  These key words are emptyStr, postStr, and preStr. The preStr option allows you to add text before a dynamic text string and the postStr option allows you to add text after a dynamic text string. The emptyStr option lets you specify a string to substitute when the dynamic text returns a null value. For example, when the map author property is not populated, you could use the following: <dyn type=”document” property=”author” emptyStr=”Map author unknown.”/> to return a more descriptive explanation rather than just leaving a blank.  Or in some cases you may want the entire string to disappear. For example, if you are using dynamic text to label adjoining pages in your map book, when you don’t have an adjoining page you may want the entire “See page: “ text to disappear.  <dyn type=”page” property=”PageNumber_N” preStr=”See Page: ” emptyStr = ” “/> will hide the entire “See Page: “ string when the PageNumber_N attribute is empty.

 

There are many types and formats for dynamic text that are available in addition to those under the Insert > Dynamic Text menu.  These are all accessible through tags that can be added to any layout text element.  For a more complete list, and to start taking full advantage of all the dynamic text options, take a look through the tables and examples in the help doc Working with dynamic text located here.

Content from David Watkins
 

Posted in Mapping | Tagged , , , , , | 6 Comments

Constructing features with precise measurements

In many scenarios, particularly in the built environment, you need to construct new features based on a series of measurements and offsets from existing features in your data.  Although ArcGIS supports a variety of ways to create features using a combination of snapping and constraints, more permanent construction geometries are appropriate in some scenarios.

Rather than resorting to storing construction lines in a feature class, an alternative method to support construction lines is with the temporary guide functionality available by installing the Construction Guides add-in written by Esri’s Editing development team. You can use the guides to build a series of geometries to assist you with completing complex constructions for use while creating new features and modifying the shape of existing features. The guides can be created with common editing constraint capabilities, such as making geometry parallel to an existing feature, at distance from a known location, or at a specific x,y coordinate. You can use snapping both when placing the guides and creating features in relation to them, allowing you to precisely locate a position based on the construction guide geometry.

To use the Construction Guides add-in, download it from the Editing Labs group on ArcGIS.com and double-click the file to install it on your machine. When you start ArcMap you have access to the Guides toolbar, which hosts all the tools to create and manage the temporary geometries that can be used in constructions. Creating construction guides is a straightforward process. You just click the type of guide on the Guides toolbar and define its geometry on the map.  You can do this interactively, or if you have specific values to enter, the tools support the ability to specify them using keyboard shortcuts.


To illustrate how the guides can be utilized during feature creation, I am going to digitize a new residential building with them. Once I position the guides, I use the regular feature construction tools to create the building feature. I have been given several measurements that I can use to place the guides, and ultimately, the new building. The northwest corner of the building is 12.5 feet from the corner of the lot. To locate this position, I first use a circle guide and snap to the corner of the lot to place the center point of the circle.  I then drag a circle, but rather than clicking to define the circle’s diameter interactively, I can press the R key and enter 12.5 to define the radius. I also know that the edge of the building is offset eight feet from the western lot boundary.  I can use the Line Guide tool to create a guide from that lot boundary and specify a distance of eight feet by pressing the D key. Similar to entering values in built-in editing dialog boxes, guide measurements are entered in map units.

With these two guides in place, I can now begin to create the building feature. Since the rresidential building is rectangular in shape, I can use the Rectangle construction tool to create it. To place the first corner of the building, I need to turn on Intersection Snapping from the Snapping toolbar and snap to the intersection of the circle and line guides.

Once I have created the corner of the building at that intersection, I set the orientation of the building in the lot by snapping along the line guide I created from the lot boundary. I can then right-click to access a menu that allows me to enter the length and width dimensions of my building.

The building feature is completed once I finish entering the measurements. The guides remain after the feature is created, so I could continue to use them for other editing tasks. In this case, I don’t need them any longer, so I can click Clear Guides to remove all the guides.

This is just one illustration of using guides to locate features precisely.  In future blog posts, I’ll explain how this sample was developed and how you can extend your own code to utilize some of the same capabilities shown here.

Introducing Editing Labs on ArcGIS.com
The Construction Guides add-in is one example of how Esri’s Editing development team is building tools, prototypes, and practical examples and sharing them with you. We are adding these to an ArcGIS.com group called Editing Labs, which provides an opportunity, along with the ArcGIS Ideas site, for you to share feedback on some work that the Editing team is investigating. Tell us what you think about Construction Guides and our other samples by adding comments on the individual items in the Editing Labs group.  We’ll be adding new content regularly to Editing Labs, so check back often.

Content provided by Doug (ArcGIS Editing Team)

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

New Geocoding Services

As of last week, ArcMap and ArcReader version 10 users will see new version 10 ArcGIS Online geocoding services are now available in the Find dialog and Geocoding toolbar. These provide single-line input capabilities and so are much more flexible and make it easier to find addresses. When you use the version 10 locators, you can enter addresses without commas, without having to include the state and zip code, etc.

 

 

 

 
For more information on the new ArcGIS Online geocode services checkout this post on the Geocoding Blog.

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

Getting the most out of editing in ArcGIS 10: Selecting the right features

Selecting the right features is a key part of editing since most tools operate on selections. For example, selections are used when updating attribute values, editing the shapes of features, and even creating new features. With ArcGIS 10, it is easier to set up the selection environment and refine the selected features by using the new List By Selection button on the table of contents. List By Selection dynamically groups the layers in the map by whether or not they are selectable and currently have selected features. The window’s contents sort automatically as I interact with the map, select features, and turn layers on and off.

Right now, I am working with a map containing parcels and other land base data. Two parcels that are zoned for office space were recently sold, and the new owner names need to be added to the attributes.  The simplest way to make these updates is to select the features and edit their values in the Attributes window. This post describes how I can use the table of contents to help me select only the features I want to edit.

Managing the selection environment
Setting which layers are selectable is the first step toward selecting the right features. When a layer is selectable, features in it can be selected using interactive tools, including the Edit tool on the Editor toolbar. In my map, I have layers of road centerlines, parcels, neighborhood blocks, and aerial imagery. For some layers, I do not ever want to make a selection from them. For example, the Blocks layer draws on top of the Parcels layer, but with partial transparency, so the parcels can be seen beneath the blocks. Where the blocks overlap the parcels, the block features also get selected whenever I try to select an underlying parcel. The simplest solution for this is making the Blocks layer not selectable, which keeps it visible but allows me to select the parcels underneath it. I can make Blocks not selectable by clicking the icon to the right of the layer name. If the icon is colored , the layer is selectable; if it is gray , the layer is not selectable. When I click the icon, the Blocks layer moves automatically into the Not Selectable category.

Refining the selection
The quickest way to select features while editing is to drag a box on the map using the Edit tool. While this might initially result in selecting extra features, I can easily remove features I do not need using the table of contents. Any layer that contains selected features is automatically promoted into the Selected category at the top of the table of contents. This way, I do not have to sift through a long layer list looking for layers that have selected features.

When I dragged a box, no blocks were selected this time since that layer is not selectable, but I did inadvertently select an adjacent road centerline feature. Since I only want to work with parcels, I can remove the selection from all other layers by holding down the ALT key and clicking the Parcels layer’s white selection icon  in the column between the set selectable icon and number of selected features. Now, only features from the Parcels layer remain selected. Without the ALT keyboard shortcut, clicking the white selection icon actually clears the selected features in only the Parcels layer.

Each selected parcel feature is listed individually under the layer name by an ID, which is obtained from the layer’s display expression. For the Parcels layer, I set up a display expression on the Display tab of the Layer Properties dialog box to append the text “Property ID:” to the value from the property ID attribute field and the value from a zoning field. When I click the ID in the list, it flashes the feature so I can locate it on the map.

I want to update just the two office parcels, but I still have that extra utility parcel selected. If I use the map to attempt to deselect the utility parcel, I might accidentally clear the selection on the office parcels or find that I have added other features to the selection. Instead, I can deselect features quicker and with better accuracy using the table of contents. By clicking the blue square icon  to the left of Property ID: 3390 (Utility), I can deselect this feature individually.

Now that I have confirmed that I have the correct office parcels selected, I can open the Attributes window and complete the attribute edits.
For more information, see Using the table of contents, Selecting features interactively, and Selecting features while editing.

Content provided by Rhonda (Editing Team)

Posted in Editing | Tagged , , , , | 1 Comment

Managing Parcels with ArcGIS 10

Over on the Local Gov blog there is a good post on managing parcels with ArcGIS 10.

With the release of ArcGIS 10, Esri is now providing you a Land Records solution as a core part of the ArcGIS. This solution will help you produce great web maps, implement efficient workflows, and incorporate best practices from the land records industry at large. 


 

Posted in Uncategorized | Tagged , , , , , | Leave a comment

An easy way to add GPS data to ArcMap

So, you have a GPS and have been cruising around all day collecting waypoints and tracks which are now stored on your device. Suppose you’d like to get those into ArcMap for further work or analysis, how would you do that? An easy way is using ArcGIS Explorer Desktop.

The first step is to export your data to a GPX file using your GPS device (a format just about all of them support). Next, we’ll add the GPX file to Explorer by choosing Add, then GPS Data Files, as shown below:

Then choose what you want to add:

 

After making choices and clicking Add, we now have our GPX file displayed in ArcGIS Explorer Desktop with all the correct symbols.

Next, right-click the layer in contents and choose Share.

You can choose to share as either a layer package, KML, or Explorer map content file. We chose layer package since not only does ArcMap support LPKs, but the layer package also captures the symbols for display in ArcMap.

 

Start ArcMap, then drag and drop the layer package onto your map. Below we’ve also connected to the ArcGIS Online world imagery basemap which serves as our foundation for displaying the now-converted GPX file, just like we used in Explorer. Note that the symbols are exactly the same.

If you are interested in a live feed from a GPS device, you have another option. ArcMap enables you to create a direct connection to a GPS unit for live input. Right-click on the menu and look for the GPS toolbar:

And you can find out more about it in the ArcGIS Help (just search for GPS).

You can also learn more about importing GPS data files in ArcGIS Explorer Desktop by taking a look at the Add GPS Data Files Explorer help topic.

Posted in Uncategorized | Tagged , , , | 3 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”)
as
IEditor3;

    }

 

   
protected override
void OnClick()

    {

     
// get the selected template and current tool

     
IEditTemplate currentTemplate =
m_editor.CurrentTemplate;

     
ICommandItem currentTool =
ArcMap.Application.CurrentTool;

 

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

     
{

       
IEditTemplate editTemplate =
m_editor.get_Template(i);

       
if (editTemplate.Layer.Name ==
currentTemplate.Layer.Name)

       
{

         
Guid g = new
Guid(currentTool.ID.Value.ToString());

         
editTemplate.Tool = g;

       
}

     
}

    }

   
protected override
void OnUpdate()

    {

     
this.Enabled = (m_editor.EditState ==
esriEditState.esriStateEditing);

    }

  }

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

Getting the most out of editing in ArcGIS 10: Editing attributes

Using the Attributes window is a quick way to add or update attribute values for features. This window was redesigned with ArcGIS 10 and has many enhancements. This post covers some of the functionality changes and provides tips and tricks for editing in it.

Displaying and sorting attribute information
I have some landownership data of parcels and neighborhood blocks that need attribute updates. I am going to use the Attributes window to make my changes. I can open the window by clicking the Attributes button on the Editor toolbar or right-clicking a feature with the Edit tool and clicking Attributes. To populate the Attributes window, I need to select one or more features that are currently being edited. The window can be docked to the ArcMap application and has a vertical layout by default.

The most significant functionality improvement in the ArcGIS 10 Attributes window is that the window uses layer information. This means the settings for the layer properties are reflected, rather than the feature class information from the geodatabase or data source. In the past, I would spend time entering field aliases, hiding fields, and changing the field sorting order, only to find this effort ignored in the Attributes window. However, with ArcGIS 10, all these settings are used by the Attributes window. So as I’ve emphasized in previous posts, you can save yourself time later if you set up the layer properties before you start editing. Use the Fields tab of the Layer Properties dialog box to specify how fields appear in the Attributes window and throughout ArcMap.

The top of the Attributes window groups features by the layer name and lists features by their display expression, which is set on the Layer Properties > Display tab. For my data, I have set a display expression for my Blocks layer that includes the text “Block ID: ” + the [BLOCKID] field  +  the [ZONING] field in parentheses. This makes the Attributes window entry display as Block ID: 10848 (Non-Residential). In one glance, I can understand that the numeric value is the block identification code and see how the block is zoned. I have also created a similar expression for the Parcels layer to display “Property ID:” before its ID value and zoning type.

The buttons at the top of the Attributes window sort and organize the window. By default, fields are listed by the order on the Layer Properties > Fields tab, but the Sort Fields Alphabetical button overrides this to show the field names in ascending alphabetical order. The Options menu also allows me to change temporarily how fields are displayed in the Attributes window, such as to view all the fields in a layer. Before I started editing, I used the Layer Properties > Fields tab to hide the fields I was not expecting to edit, which included the field for a property’s valuation. However, a parcel was recently reassessed and now that field needs to be updated. I can click Options > All Fields to show all the fields and make the valuation change. If I find that I need to display that field all the time or make other field display changes, I can right-click the layer name and click Layer Properties to open that dialog box quickly.

Since I am working with some parcel data with tables that are linked to my features through a relationship class, I can use the Attributes window to view and edit the records related to the selected features. Similar to feature layers, related tables can also have display expressions once they have been added to ArcMap. I can right-click the table’s entry in the Attributes window, click Add to Map, then right-click it again, point to Table, and click Table Properties. On the Display tab, I have created a display expression to show the “Owner name: ” + [OWNER] field value. I can quickly tell whether a table is in the map by noting the color of the table icon in the Attributes window: it is gold when the table is present and gray when it is not in the map. When working with related records, clicking the Expand All Relationships In Branch button at the top of the window is useful for automatically showing all the nodes in the attributes tree. It’s best to use this on a small set of features since expanding all these relationships could take some time otherwise.

Making bulk attribute updates
The values that are shown in the grid at the bottom of the window depend on what I have clicked (highlighted in gray) in the attributes tree at the top. Many times, multiple features should have the same attribute values, so I can use a trick of the Attributes window to perform bulk attribute updates. Learning where to click at the top of the window allows me to make rapid updates to the attributes of multiple features at once.

If I click one feature in the list, it flashes on the map and its attributes appear in the grid. The fields are listed in the leftmost column with their corresponding attribute values in the right column. Because the window is showing just the attribute values of that one feature, any changes I make are applied to the attributes of only that feature. However, if I need to update the values for all the selected parcel features, I can click the Parcels layer name node in the tree. In this case, any updates are applied to all the selected parcels.

When I am viewing the attributes for multiple features, only values that are common to all the features are shown in the grid. If field values are different among the features, the attribute cell in the right column is blank. To enter a value, type it and it is updated in all the highlighted features. When doing this, I need to be sure to change just the values that should apply to all the features.

If I only need to change the values for a few of the selected features, I can hold down CTRL and click features or related records to highlight them. This way, when I update the attribute values, they are applied to only the highlighted items. For example, I want to change the Percentage ownership value for just two of the related records, and not all of them. I can hold down CTRL and click to highlight only the records I want to update, such as for owners Jones and Johnson. Since the records for the City or Smith are not highlighted at the top of the window, the Percentage ownership field will not be updated for those records.

For more information on the Attributes window, see About editing attributes and Applying the same attribute values to multiple features in a layer in the ArcGIS Desktop Help.

Content provided by Rhonda from the ArcGIS Editing Team

Posted in Editing | Tagged , , , , , | 3 Comments