Geotiff issue in version 10
If you are having issues with GeoTIFF images that were viewable in ArcGIS 9.3.1 but not visible in ArcGIS 10 read on!
- Click Customize on the Main menu and click ArcMap Options (or ArcCatalog Options, depending on the application you are using).
- Click the Raster tab in the Options window.
- Within the Raster tab, click Raster Dataset and check the Use world file to define the coordinates of the raster check box.
- Click OK.
The Tif images are now viewable in ArcGIS Desktop 10! See this help item for more information.
Melbourne Developer Meetup
Thanks to those that attended the Developer Meetup in Melbourne last night. Even bigger thanks to the speakers that did some excellent presentations.
- Thom Mackey kicked the night off with an interesting talk around the new stuff with Python at 10.1.
- Allison McKnight followed with a talk around ArcGIS Runtime which led to some discussion around ArcObjects/Engine/MapObjects.
- Simon Hope from Geoplex did a talk on their exporter extension for ArcGIS Server which allows you to export your data into GeoRSS format. slides here.
- (Pizza/beer break)
- Stephen Salathiel from DSE presented some history on how they developed their Burns Assessment Tool and how they were making use of Python/ArcPy/TKinter to achieve this.
- Nav Sushil from Lonely Planet talked about how they come up with their beautiful maps by making use of ArcGIS Desktop/Adobe Illustrator/Microsoft Excel & Word and issues they encountered along the way.
Was great to have such a good turnout and great talks for our first dev meetup. You can see some photos from the event here.
We will aim to have another one later in the year, so please register interest via our Meetup page.
Continue Feature Tool to continue digitising an existing line
The continue feature tool allows you to continue digitising an existing polygon or line without having to create a new feature and merge that back into the existing feature. Prior to version 10 the sketch tool was used to do this but this has since been replaced by feature templates.
To access the tool you will need to install service pack 2:
http://resources.arcgis.com/content/patches-and-service-packs?fa=viewPatch&PID=17&MetaID=1752
Then add the tool from the customize menu:
Once the tool has been added you can select and continue digitising an existing feature (line or polygon) so its shape can be updated.
What to learn more? Visit our training website for information on our 1 day What’s New in Editing training course:
http://esriaustralia.com.au/training
Uninstalling service packs at 10
Need to roll back to a previous service pack or uninstall a patch? A new function with version 10 is the ability to unistall service packs. This is helpful if you run into an error or performance issue and need to test if the service pack is involved.
If you are using Windows XP, you can use the Add/Remove Programs window to view and uninstall service packs or patches. For more details visit this link.
But if you’re using Windows 7, the workflow is slightly different.
i) Open Control Panel
ii) Navigate ‘Programs and Features’-> ‘View installed updates’
iii) Navigate ‘ArcGIS Desktop 10 Service Pack x’-> Right Click and Uninstall.
Keera P
Creating Inverted Buffers
Did you know you can create a buffer inside a polygon? To do this place a negative in front of the buffer distance.
A few ways to share your custom geoprocessing toolbox
Let’s consider a situation when you’re creating a custom toolbox which must be shared with your colleagues or users in remote offices.
There are quite a few ways to distribute this custom toolbox:
1. If the Tool is only required in the System Toolboxes section of the Catalog Window, one can simply place the ToolBox in the location C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes
2. If the tool box is required in the MyToolboxes section of the Catalog window, then the custom toolboxes can be placed here:
C:\Users\<Current User>\AppData\Roaming\ESRI\Desktop10.0\ArcToolbox\My Toolboxes
3. Another way to get the toolboxes (from a custom location) to show up in the My Toolboxes section is to specify a custom location of the “MyToolboxes” folder in the registry:
A PDF Version of ArcGIS 9.3 Style Galleries
Recently, I had the task of symbolising a road reporting map for a local client. To help this client choose appropriate symbololgy to create the look and feel they wanted for the map, I needed a document showing the contents of Esri’s style galleries. After a bit of digging, I found this PDF showing a catalog of the symbols included with the 9.3 release:
It’s an excellent starting point if you need to plan or document symbology at the beginning of a project.
[Note: Even though ArcGIS 10 does not yet have a version of this 9.3 document, many of the symbols are the same. If a version of this document becomes available for ArcGIS 10, we will be sure to post it---so stay tuned!]For more reading see this link
Keera P.
Using Python to calculate NDVI with multiband imagery
The following is a helpful section of python code to assist with calculating NDVI (Normalised Difference Vegetation Index) using the arcpy site package. The Image Analysis Window allows you to see this visually, but if you want the values in the raster itself, then you will need to use this code.
Thanks go to the Esri team for explaining this new notation in the Spatial Analyst module of arcpy (arcpy.sa). The arcpy.sa module calculates rasters more effectively than the Raster Calculator at 9.x, as it uses the number crunching power of Python. Also, dot notation for multiple bands no longer works in the Raster Calculator at 10, so this code is a optimised replacement for this loss in functionality.
In this example, Band 3 is Red, Band 5 is Near IR.
To run this script, open IDLE or another IDE (like PythonWin, PyChecker, or WingIDE), and create a new script. Copy and paste the below script and paste into that new script. Then you need to read the green comments, and replace the CAPITALISED sections. It will create a few outputs, like NDVI and Red band rasters. These can be deleted once you are happy with the result.
Formatting Python Strings for SQL Queries
One of the trickiest aspects of Python, especially for beginners, is string formatting, particularly building SQL statements for use in tools like Select_analysis or as a query parameter to MakeFeatureLayer. The combination of single- and double-quotes, along with using variables for field names and values, is enough to trip up the most experienced of programmers. Here’s a tip to make it a bit easier.
I find the easiest way to create dynamic SQL query strings in Python is to use the string formatting syntax (official documentation; clearer tutorial). As a quick overview, it means you can do something like:
variable_name = "I am a variable"
print "This string has a variable coming up next: %s" % variable_name
which prints
"This string has a variable coming up next: I am a variable"
So that’s exactly the same as saying
"This string has a variable coming up next: " + variable_name
Except it is a little more formal, and a little more clear in certain circumstances. In particular when you’re constructing long strings out of many variables, it’s a little easier to handle, e.g.
var_1 + " " + var_2 + " some static text " + var_3 + "!"
becomes
"%s %s some static text %s!"%(var_1,var_2,var_3)
It’s particularly handy for SQL queries which involve all that nasty '"'+var_1+'"'+"'"+val_1+"'" business! So in the most basic case you’d say
sql_query = '"%s" = \'%s\'' % (field_name,value_to_select)
Which, while still not easy on the eye, is a little more intelligible. Note the escaping-out of the single quotes around the %s because we used single quotes to define the string. You could just as easily use
sql_query = "\"%s\" = '%s'" % (field_name,value_to_select)
Up to you. You can expand the concept as needed to involve as many fields and variables as you need, and the result is basically always more readable than any combination of quotes, plusses, spaces, and backslashes!
There are more advanced methods for string formatting in Python, too; the link at the top is a good place to start.
It’s also worth noting that as of Python 2.6 (used in ArcGIS 10.0), the method of string formatting discussed in this post is technically old hat. If you’re using ArcGIS 10.0 and/or Python 2.6 or greater, you should be using the new str.format() method detailed here. To quote the documentation:
This method of string formatting is the new standard in Python 3.0, and should be preferred to the % formatting … in new code.
However, it’s not supported in Python versions <= 2.5, so if you’re in an ArcGIS 9.3.1 environment you’ll need to use the % formatting as detailed in this post. The % formatting will work just fine in 10.0, and will still work in code run under ArcGIS 10.1, which uses Python 2.7.
Thom M
Replacing Rasters in an Image Service
In some cases it might be necessary to replace a source image in an Image Server service (.ISDef) and then to rebuild the overviews for the affected area. This might be in situations where new imagery has become available or where there were problems with an original. This blog details the steps required for doing this (without having to rebuild the service from scratch):
- First make a back up of your image service (.ISDef).
- Using the ArcMap selection tools, select the source image to replace (this should select all associated overviews at the same time). You might need to zoom to the source image to achieve this.
- Remove the selected images from the service: Image Service > Advanced > Remove Raster Dataset. In the dialogue box that comes up, tick ‘Remove raster data set’, ‘Delete raster process definition files’ (as long as the selected files are not being used by another service) and ‘Delete derived images’.
- Once the images are removed, build the service: Image Service > Advanced > Build. In the dialogue box, tick on the ‘Compute pixel size’ and ‘Create service boundary tick’ options.
- On completion of the build, add in the replacement source image: Image Service > Advanced > Add Raster Data Set.
- Build the overviews once more: Image Service > Advanced > Build. Again tick on the ‘Compute pixel size’ and ‘Create service boundary tick’ options.
- Next define the overviews: Image Service > Advanced > Optimise > Service Overviews > Define (accept default options)
- Make sure the overviews look correct and then build overviews a final time: Image Service > Advanced > Build. This time in the dialogue box, tick on the ‘Generate derived image’ and ‘Compile service’ options.
- Your image service is now updated
John H








