Monthly Archives: April 2008

Developer Tips – Qualified field names in ArcSDE

This post was provided by geodatabase Product Engineer James MacKay.

There are fourteen field names that cause fields to behave slightly different in ArcSDE. They are:

AREA

POINTS

FID

EMINX

EMINY

EMINZ

MIN_MEASURE

LEN

NUMOFPTS

ENTITY

EMAXX

EMAXY

EMAXZ

MAX_MEASURE

These field names conflict with internal ArcSDE properties used for storing geometries. Fields that use these names can be created like any other fields, but when they’re retrieved – or when using FindField to find their indexes in a fields collection – they will be qualified with the username and table name (and database name, if applicable).

 This means a field named “Len” could appear as “wgretzky.Highways.Len” if the DBMS is Oracle, or as “sde.mlemieux.Highways.Len” if the DBMS is SQL Server.

The best plan is to avoid using these field names, but when that isn’t possible, a few code changes can be made to handle these cases. The most noticeable effect is that calls to FindField with the unqualified field name will return a value of -1 (indicating that the field could not be found).

It’s the developer’s responsibility to either qualify the field name with the username and table name (and database name, if applicable), or to find the field’s index with IFields2.FindFieldIgnoreQualification (this will find both qualified and unqualified field names).

The code below shows how to retrieve a field with the FindFieldIgnoreQualification method:

private IField GetFieldByName(IWorkspace workspace,IObjectClass objectClass, String fieldName)

{

      // Cast the workspace to the ISQLSyntax interface.

      ISQLSyntax sqlSyntax =(ISQLSyntax)workspace;

                      

      // Get the field’s index from the fields collection.

      IFields2 fields2 = (IFields2)objectClass.Fields;

      int fieldndex = -1;

      fields2.FindFieldIgnoreQualification(sqlSyntax, fieldName, out fieldIndex);

 

      // If the field was found, return it.

      if (fieldIndex >= 0)

      {

        return fields2.get_Field(fieldIndex);

      }

       else

      (

        return null ;

      }

}

Posted in Geodata | Tagged , , | Leave a comment

Dot density mapping with ArcMap: Part 2–Defining exclusions and inclusions

By Daniel Smith and Alex Quintero, University of Redlands, Masters of Science In GIS Program

Exclusions Inclusions Part 2 - Thumbnail

In the first dot density mapping blog, we discussed the workflow for creating dot density maps using ArcMap.  In that discussion we emphasized the need for using exclusion or inclusion layers.  Here is an example of how we set up the inclusion and exclusion choices for mapping population density in San Bernardino County, the county with the largest land area in the conterminous United States. Because of its size and the fact that population is not evenly distributed throughout the county (rather, it is concentrated in the southwest corner, around where Redlands is located), this county exemplifies the limitations of dot density mapping without inclusions/exclusions when mapping population density at the county, the state or even the country level. Continue reading

Posted in Mapping | Tagged , , | 1 Comment

New blog focuses on geodatabases and ArcSDE

Last month the ESRI geodatabase development team revealed their new blog Inside the Geodatabase. Visit this blog to get news and tips about ESRI geodatabases directly from development team members.

The blog is moderated by Product Engineers Brent Pierce and Jonathan Murphy, who have already published a number of posts that you’ll find useful if you work with geodatabases and ArcSDE technology. As an example, check out the recent post Five best practices for maintaining an ArcSDE geodatabase.

Be sure to e-mail Brent and Jonathan your ideas for future posts. Just like with this blog, you’ll need to sign in with your ESRI Global Account to send e-mail.

Posted in Services | Tagged , , | Leave a comment

Dot Density Mapping with ArcMap: Part 1

By Alex Quitero and Daniel Smith, University of Redlands, Masters of Science in GIS Program

Several weeks ago, after a colloquium given by Dr. Aileen Buckley on the devolution of cartographic theory, we approached her about research opportunities that she mentioned. She was glad to accept our help and put us in contact with Dr. A. Jon Kimerling from the Oregon State University. The research he was undertaking during his sabbatical in Redlands, CA dealt with a particular mapping method in the cartographer’s bag of tricks – dot density mapping. After discussing the research issues with Dr. Kimerling, we were tasked with developing a series of maps to supplement his research (see his presentation: “Dotting the Dot Map, Revisited” and to document the workflow for creating dot density maps with ArcMap. This seemed to be easy enough and in fact was quite easy given ArcGIS provides the tools necessary for completing this task. Continue reading

Posted in Mapping | Tagged , | Leave a comment

Taskbar scripts for administering services

Bryan Baker, a Product Engineer on the ArcGIS Server development team, contributed this post:

Working with ArcGIS Server requires you to stop and start services on occasion. In fact, the server object manager (SOM)itself is represented by the Windows service ArcGIS Server Object Manager, which you may sometimes want to stop or restart. On Windows, it can be painful to open Control Panel, open Administrative Tools, then the Services panel, and finally use the tools there to stop and start the service. You can make this a lot easier on Windows by creating scripts and shortcuts accessible from the desktop, or even better, from a toolbar on your Taskbar. Once created, you click on the toolbar menu in the Taskbar, and then on your script or shortcut, like this:

Shortcuts on Windows taskbar

These examples make it simple to restart, start, and stop ArcGIS Server. These kinds of scripts can perform many operations on your server. Let’s see how to create these toolbar scripts and shortcuts.

Create a toolbar folder

First, use Windows Explorer to create a new folder to hold the shortcuts and scripts. The folder can be anywhere on your system. I’ll create my folder at C:ToolbarsScripts.

Create the script or shortcut

Inside the new Scripts folder, add the script or shortcut you want to appear. A script can use any of several available environments in Windows, including batch files, Windows Script Host, and the new Windows PowerShell. Let’s take the example of the Restart ArcGIS Server item shown above. This is actually a simple batch file. Here’s an easy way to create the batch file:

  1. Open Windows Explorer and navigate to the Scripts folder you created.
  2. In the right side of Windows Explorer, right-click an empty area and choose New – Text Document.
  3. Rename the document: Restart ArcGIS Server.bat. Windows warns you about changing the extension–go ahead and confirm.
  4. To open the batch file for editing, right-click on it and select Edit. It’ll open in Notepad.

Note: You can also add a shortcut to a program, either by copying an existing shortcut or creating a new one (right-click and choose New-Shortcut). For example, you can add a shortcut to ArcCatalog by navigating to it in the Start menu, then right-click and drag the ArcCatalog shortcut into the Windows Explorer folder for Scripts, and in the pop-up menu choose Copy Here.

Enter the script commands

With the script batch file open in Notepad or other text editor, add the commands you want to run. Batch files have a number of commands you can use, and can run anything you can do at a command line. To start and stop services, you can use the Windows “net start” and “net stop” commands. These commands start or stop the service you name in the command. You can get the name of the service from the Services dialog in Control Panel (some services have shorter names, for example, the World Wide Web Publishing Service is also W3SVC).

For the Restart ArcGIS Server batch file, we can enter these commands in the batch file, one per line:


net stop "ArcGIS Server Object Manager"
net start "ArcGIS Server Object Manager"

Save the file and close Notepad.

Note: You might need to add commands for other services that are related to the service. For example, if you use SQL Server in your ArcGIS Server, you can add a command to start or stop that service if necessary.

Add the folder as a new toolbar

Finally, add the toolbar to the Taskbar. To do this:

  1. Right-click on any open spot on the Taskbar.
  2. In the context menu, choose Toolbars – New Toolbar…
  3. In the New Toolbar dialog that opens, navigate to the Scripts folder you created earlier.
  4. Click OK.

The folder should appear in the Taskbar as in the image below. You can then click the >> on the toolbar to run the scripts or shortcuts in it.

Running the batch file from the taskbar

Optional: Set icons for scripts

The example above showed icons for the scripts, rather than the default batch file icon. If you want to change the icon, you need to create a shortcut to the batch file and use the shortcut instead. Here’s one approach:

  1. In Windows Explorer, create a new folder to hold the actual batch files. Within the Scripts folder, create a subfolder called Batch.
  2. Move the batch file(s) to the new Batch folder.
  3. Right-click on the batch file and drag it into the Scripts folder. Upon releasing the mouse, choose to Create Shortcuts Here.
  4. In the Scripts folder, right-click on the new shortcut and choose Properties.
  5. In the Properties dialog, on the Shortcut tab, click Change Icon… (dismiss the warning that no icons are in the batch file).
  6. Navigate to the icon or the program (.exe or .dll) that contains an icon to use. In the example above, I used the ArcCatalog icon, available at <ArcGIS install>binArcCatalog.exe.
  7. Optionally, change the name of the shortcut in the General tab.
  8. Click OK in the two dialogs to confirm the icon selection.

More options

If you create lots of scripts and shortcuts, you can create folders within your toolbar folder, and add scripts or shortcuts within these subfolders. The subfolders will then be available to mouse-over and expand when you click on the toolbar.

These scripts and shortcuts can be very handy for many operations. Other examples include

  • Restarting other services, such as the IIS Web server or ArcIMS
  • Shortcuts to programs, such as ArcCatalog or ArcMap
  • Shortcuts to files or folders, such as a log folder or a configuration file
  • Connecting network drives (“net use” command)
  • Backup commands

As a more complex example, I have a script that starts several services after a delay of 5 minutes (using the Sleep command in the Windows Server 2003 Resource Kit Tools); I have that script set to run on machine startup, so that I can start working on other tasks without the overhead of a lot of service startups, which is useful on a development computer. I’m sure you can think of many more creative uses of toolbars, scripts and shortcuts!

A zip file with the scripts and shortcuts discussed above is available here. It includes some additional sample scripts for ArcIMS and IIS, plus shortcuts to some commonly used Windows utilities.

Posted in Services | Tagged , | 1 Comment

Exploring a Midwest Earthquake Zone with Explorer

Part 1 and Part 2 of a four-part blog post featuring the use of ArcGIS Explorer for taking a closer look at the New Madrid Seismic Zone have been published on ESRI’s GIS Education Community Blog. Posted by George Dailey, ESRI Education Manager, it’s a great example of discovering and aggregating a variety of data and using Explorer to… well… explore!

 

Stay tuned for Parts 3 and 4.

Posted in Uncategorized | Tagged , | Leave a comment

Explorer on Earth Day – April 22, 2008

A Google search for “Earth Day” lists the Earth Day Network as the top (non-sponsored) link. A “Call for Climate” is the call to action listed front and center on that site.

A great site for a variety of content, especially environmental and climate data, is NASA’s Earth Observations site. NEO’s mission (as stated on the site) is to help you picture climate change and environmental changes happening on our home planet. So it seems like a great site to visit with Explorer on Earth Day.

Here we’ve added a couple of KMZ files from the site, one showing land surface temperature at night for the period between February 1 and March 1, 2000, and the other for the same dates in 2008. We’ve used the swipe tool to show the differences (you’ll see the swipe lining splitting the globe at its center). The 2008 data is on the right, with the 2000 data on the left. You’ll see that things were a bit warmer (blue is cooler, red is warmer, hottest is yellow) in the central part of the US during that time period 8 years ago.

Here’s the swipe tool being used again on content from the same February to March time period, but this time for daytime land surface temperatures. Content for 2000 is on the left and 2008 on the right. We’ve also added the February through March 2008 ocean temperatures.

And what would Earth Day be without a look at the earth’s population? Here’s the 2000 world population data, also from the NEO site. Try using the swipe tool and other content from the Explorer Resource Center and Geography Network to consider why there are distinct population lines in the middle of the US and along the northern border of India and Nepal.

If you’ve done some interesting things with Explorer for Earth Day, let us know about it or share what you’ve done on the ArcGIS Explorer Showcase.

Posted in Uncategorized | Tagged , | Leave a comment

Explorer used in Search and Rescue Operation

An article just published in the April, 2008, ArcWatch describes the use of ArcGIS Explorer during the search for a man lost in California’s San Bernardino Mountains. Here’s an excerpt from the article that describes using ArcGIS Explorer:

The 2008 search used a server that accessed a satellite broadband connection to retrieve ArcGIS Explorer 3D visualization enhancements. It was easy to overlay the polyline shapefiles created from the GPS track logs and display them in ArcGIS Explorer to create a 3D map. Aerial imagery or topographic map data was displayed as a background and draped over digital elevation models. Roads and administrative boundaries could be added for reference. This gave a true representation of the terrain difficulty, which was much easier for field teams to understand than a two-dimensional topographic map with contour lines. SBSO personnel were especially impressed that all this information is available for the entire country and can be accessed through the freely downloadable ArcGIS Explorer application.

ArcWatch is a monthly e-Newsletter that provides up to date information on what’s new with ESRI, its software, and the desktop mapping and GIS industry. Subscriptions are free.

Posted in Uncategorized | Tagged , | Leave a comment

Road Ahead – Merge Conflicting Geometries

A conflict on the geometries or the shape attribute of a feature class will arise any time the shape has changed on the same feature in the two different versions being reconciled.

At 9.2 and earlier ArcGIS releases, if there was a conflict on the shape field only one representation could be chosen. We didn’t really think this made sense because there were many cases where the geometry changes occurred in different parts of the shape, why couldn’t these changes be merged together? At 9.3 they now can with new functionality added by the geodatabase team for merging conflicting geometries during a reconcile operation.

 

This conflict occurs at the field level and is associated specifically with the Shape attribute. The option to merge geometries is available when there is a conflict concerning the Shape field. If two editors both edit the geometry of the same feature but do not edit the same area of that feature, they now have the option to resolve the conflict by merging geometries and accepting both edits.

The option to merge geometries is only available on the Shape field shortcut menu.

Once the geometries are merged, the end result is a feature that contains the edits made by both editors:

If the edits made by one editor share a region that was also edited by another editor, their edited areas will overlap. Although the option to merge geometries may be available, trying to do so will fail.

Posted in Geodata | Tagged , , | 4 Comments

Taking a Look at Earthquakes (in many different ways)

This morning a 5.2 quake hit Illinois, shaking a large part of the Midwest, with many aftershocks following the main temblor. The quake was believed by USGS scientists to have involved the Wabash fault, an extension of the New Madrid fault. That fault generated the 1812 New Madrid quake, one of the largest ever recorded in the US.

So this morning we took at look at things using Explorer, first connecting to an ArcIMS service found on the Geography Network. We connected to the Geography Network at www.geographynetwork.com  and added the ESRI_Quake_Rec service to Explorer. That service is updated every 15 minutes by ESRI and the USGS.

We also added the USGS topo service (physical features layer) from the Explorer Resource Center (Contents > Layers) and here’s how things looked.

Next we visited the USGS Hazards Program site, and downloaded the CSV file for magnitude 1+ earthquakes over the last 7 days. We used Explorer’s import capabilities to create results from the lat/long coordinates to add them to our map. We chose the magnitude as the title, and date and time as the description. And below we’ve used the swipe tool on the topo layer to reveal the imagery underneath.

From the same site we also clicked to open the KML file.

 

Next, we imported the CSV file and created a file geodatabase. Why did we do that? You’ll find out in a couple of paragraphs, but here’s the local file geodatabase in Explorer. When we click on the earthquake location point, the attribute information for the quake is displayed.

Using the file geodatabase from above, we decided to be a little more creative. We buffered each point (to create polygons at each quake location for better visualization) then symbolized and extruded each of those polygons based on the earthquake magnitude using ArcGlobe. To make things more visually dramatic, we added a multiplier to the magnitude just to extrude the features further. We saved the ArcGlobe .3DD file, and published it via one of our ArcGIS Servers.

Here’s the area around southern California, and you can clearly see that during the past week this region has been seismically active too.

Finally, we tapped into the USGS “Shakemap” GeoRSS feed for a real time feed of live earthquake information.

Now we’ll have to be honest and let you know we’re cheating a bit with this one, but only just a little bit. The above screenshot showing a GeoRSS connection was created using today’s daily build of Explorer hot off the development machines.

For everyone else, you won’t be able to connect to a GeoRSS feed using the currently released Explorer 450, but you’ll be able to do everything else we’ve shown here. GeoRSS support is just one of the many new features we’ll be releasing with Explorer 480.

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