<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Misspelled nemesis club &#187; arcgis</title>
	<atom:link href="http://moreati.org.uk/blog/category/arcgis/feed/" rel="self" type="application/rss+xml" />
	<link>http://moreati.org.uk/blog</link>
	<description>A blog about life, technology &#38; databases</description>
	<lastBuildDate>Sat, 10 Jul 2010 16:57:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>EuroPython 2009 open for registration</title>
		<link>http://moreati.org.uk/blog/2009/03/04/europython-2009-open-for-registration/</link>
		<comments>http://moreati.org.uk/blog/2009/03/04/europython-2009-open-for-registration/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 00:01:14 +0000</pubDate>
		<dc:creator>Alex Willmer</dc:creator>
				<category><![CDATA[arcgis]]></category>
		<category><![CDATA[confereneces]]></category>
		<category><![CDATA[pyconuk]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://moreati.org.uk/blog/?p=104</guid>
		<description><![CDATA[If you&#8217;ve enjoyed PyCon UK the last 2 years, the bad news is that it won&#8217;t be happening this year. The good news is that  EuroPython 2009 is coming to sunny Birmingham instead, for 3 days from Tues 30th June to Thurs 2nd July and registration is now open. The even better news is that]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve enjoyed <a href="http://pyconuk.org/">PyCon UK</a> the last 2 years, the bad news is that it won&#8217;t be happening this year. The good news is that  <a href="http://www.europython.eu/">EuroPython 2009</a> is coming to sunny Birmingham instead, for 3 days from Tues 30th June to Thurs 2nd July and <a href="http://www.europython.eu/registration/">registration is now open</a>. The even better news is that until 14th March it&#8217;s <em>really cheap</em>, like 50% off cheap making the 3 day conference only £95.</p>
<p>As a warm up, from Sunday we have 2 days of tutorials at the bargain price of £70. To close there will be sprints from Friday 3rd July, and in case any Django coders get home sick it all coincides with the <a href="http://www.birminghamjazzfestival.com/">Birmingham International Jazz Festival</a>.</p>
<p>My talk on <a href="http://moreati.org.uk/blog/2009/01/27/from-esriarcgis-import-geodatabase/">ArcGIS and IronPython</a> has been approved. So I&#8217;ll see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://moreati.org.uk/blog/2009/03/04/europython-2009-open-for-registration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Shapefile 2.0 manifesto</title>
		<link>http://moreati.org.uk/blog/2009/03/01/shapefile-20-manifesto/</link>
		<comments>http://moreati.org.uk/blog/2009/03/01/shapefile-20-manifesto/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 13:13:44 +0000</pubDate>
		<dc:creator>Alex Willmer</dc:creator>
				<category><![CDATA[arcgis]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://moreati.org.uk/blog/?p=54</guid>
		<description><![CDATA[Geographic Information Systems (GIS) are by their nature data driven. The data comes in a wide variety of raster and vector formats. Rasters hold raw, continuous data recorded striaght from the real world. An example is Satellite/aerial imagery, this is a commonly held in an open format with broad support, such as GeoTIFF or GeoJPEG.]]></description>
			<content:encoded><![CDATA[<p>Geographic Information Systems (GIS) are by their nature data driven. The data comes in a wide variety of  raster and vector formats. Rasters  hold raw, continuous data recorded striaght from the real world. An example is Satellite/aerial imagery, this is a commonly held in an open format with broad support, such as <a href="http://en.wikipedia.org/wiki/GeoTIFF">GeoTIFF</a> or <a href="http://en.wikipedia.org/wiki/JPEG">GeoJPEG</a>.</p>
<p><a href="http://en.wikipedia.org/wiki/GIS_file_formats#Vector_formats">Vector formats</a> hold refined, discrete data, which has been manually traced or otherwise derived other data sources. Examples include  building outlines, contours, road routes, pipe networks land land parcels and locations. Vector data is usually traced or derived, at great expense from raster data, to encode business information &#8211; as a result it&#8217;s usually highly valuable.</p>
<p>Unfortunately, there are many GIS  vector file formats,  and most are proprietary. They can only be used to their full in their native software. Three of the biggest are AutoCAD <a href="http://en.wikipedia.org/wiki/AutoCAD_DXF">DXF</a>, MapInfo <a href="http://en.wikipedia.org/wiki/MapInfo_TAB_format">TAB</a> and ArcGIS <a href="http://en.wikipedia.org/w/index.php?title=Personal_Geodatabase">Personal Geodatabase</a>. One vector format is unique &#8211;  both an open standard, and in wide use: Shapefile</p>
<p><a href="http://en.wikipedia.org/wiki/Shapefile">Shapefile</a> is publicly documented  in <a href="http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf">ESRI Shapefile Technical Description</a> by <a href="http://www.esri.com">ESRI Inc.</a>, it&#8217;s creator. Any GIS software worth it&#8217;s salt can read and write to the format, so it&#8217;s become the least common denominator. It is <em>the</em> format for storing and exchanging vector data between teams, departments, businesses and government. In my opinion this makes Shapefile the best thing ever to happen to GIS, without it the GIS market would be a fraction of it&#8217;s current size.<span id="more-54"></span></p>
<p>Despite it&#8217;s popularity, Shapefile does have some serious limitations, mainly due to it&#8217;s DBF heritage:</p>
<ul>
<li>A shapefile is limited to <span style="text-decoration: line-through;">2</span> 4 GB or <span style="text-decoration: line-through;">65535</span> 4 billion/len(record) records.<br />
Where len(record) is greater of either the average feature length in bytes, or the length of a DBF record.</li>
<li>Records are limited to <span style="text-decoration: line-through;">1000</span> 65536 bytes or <span style="text-decoration: line-through;">32</span> between 257 &amp; 2038 fields.</li>
<li>Field names are limited to <span style="text-decoration: line-through;">8</span> 10 characters, character fields can hold up to 254 bytes.</li>
<li>Unicode is <span style="text-decoration: line-through;">not supported</span> not widely supported.</li>
</ul>
<p>Currently the only real alternative, for data exchange, is <a href="http://en.wikipedia.org/wiki/Geography_Markup_Language">Geography Markup Language (GML)</a> as defined by the <a href="http://www.opengeospatial.org/">Open Geospatial Consortium (OGC)</a>. An XML dialect, GML has none of the limitations of Shapefile this is why Ordnance Survey use GML to supply <a href="http://www.ordnancesurvey.co.uk/oswebsite/products/osmastermap/">MasterMap</a>, a highly detailed vector map of Great Britain. Support for GML in software is growing, but  it&#8217;s unsuitable as a storage format.</p>
<p>Viewing and editing vector data requires support for random access by attribute and by spatial extent. As an XML dialect GML cannot do this, to find one record, the entire file must be parsed from beginning to end. GML is almost always converted to another format, or loaded into a spatial database before it is used.</p>
<p>A spatial database is a database with data types and functions able to handle geospatial data. For the major databases there is <a href="http://www.oracle.com/technology/products/spatial/index.html">Oracle Spatial</a>, <a href="http://postgis.refractions.net/">PostgreSQL PostGIS</a>, <a href="http://www.microsoft.com/sqlserver/2008/en/us/spatial-data.aspx">SQL Server Spatial</a>, <a href="http://dev.mysql.com/doc/refman/5.1/en/spatial-extensions.html">MySQL Spatial</a> and <a href="http://www-01.ibm.com/software/data/spatial/">DB2 Spatial Extender</a>. All are based on <a href="http://en.wikipedia.org/wiki/Simple_Features">Simple Features for SQL</a> an open standard, meaning spatial data can be queried and updated with SQL like any other data type.</p>
<p>I believe that a portable, standalone spatial database, would make a very good successor to Shapefile.  Such a format would drive the GIS market forward, increasing usage of GIS by making it easier to share edit, publish and share GIS data. A portable spatial database would negate the need for the import, view, edit, export cycle that GML imposes.</p>
<p>At the moment I see 3 contenders for the crown:</p>
<ol>
<li><a href="http://www.esri.com/software/arcgis/geodatabase/about/file-gdbs.html">File Geodatabase</a> is a format from ESRI, it is natively supported by ArcGIS. ESRI proclaim it &#8220;Allow[s] users to easily exchange geodatabases.&#8221; That is true only if both users are running ESRI&#8217;s ArcGIS software. File Geodatabase is a proprietary format, despite promises by ESRI when it was launched.</li>
<li><a href="http://fdo.osgeo.org/fdosdf/index.html">Spatial Data Format</a> (SDF) is a format from Autodesk, it is native support . Support is included as part of their Feature Data Objects library, released as Open Source. SDF is based on the popular SQLite embedded database engine.</li>
<li><a href="http://www.gaia-gis.it/spatialite/">Spatialite</a> is another format based on SQLite, by an Alessandro Furieri. Spatialite is in it&#8217;s infancy still, it&#8217;s first release was 11 months ago.</li>
</ol>
<p>Unfortunately none of these looks like it will become a clear winner any time soon. Each is supported by only one application currently. If ESRI releases the specification for File Geodatabase, I expect it will quickly gain widespread support due to their position as market leader. As open source applications such as <a href="http://lists.osgeo.org/pipermail/qgis-developer/2009-January/005791.html">QGIS  gain Spatialite support</a>, it could slowly achieve dominance in a grass roots fashion. SDF seems to be going nowhere.</p>
<p>So ESRI, please publish the details of File Geodatabase. At it&#8217;s launch, during the 2006 ESRI User Conference, you promised that File Geodatabase would be an interoperable format. You promised to release a software library, so we  could read and write them without ArcGIS. Neither has happened. So File Geodatabase is just another closed format, another pretender to the throne that&#8217;s achieved only 1% of it&#8217;s true potential.</p>
<p>Publish File Geodatabase, or we&#8217;ll take the Shapefile crown by force.</p>
<p>Update 27 Mar 2009: Corrected Shapefile limits, based on <a href="http://www.clicketyclick.dk/databases/xbase/format/dbf.html">Xbase file structure</a> rather than <a href="http://www.clicketyclick.dk/databases/xbase/format/dbase_spec.html">dBASE software specifications</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://moreati.org.uk/blog/2009/03/01/shapefile-20-manifesto/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>MXDPERFSTAT</title>
		<link>http://moreati.org.uk/blog/2009/02/14/mxdperfstat/</link>
		<comments>http://moreati.org.uk/blog/2009/02/14/mxdperfstat/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 13:25:28 +0000</pubDate>
		<dc:creator>Alex Willmer</dc:creator>
				<category><![CDATA[arcgis]]></category>

		<guid isPermaLink="false">http://moreati.org.uk/blog/?p=85</guid>
		<description><![CDATA[Investigating the performance of an intranet mapping website this week, I was introduced MXDPERFSTAT. It&#8217;s a fantastic tool for investigating map display performance. Given an ArcMap document (a .mxd file) it runs ArcMap and loops over the map layers, displaying each at a list of  scales (e.g.  1:100000, 1:10000, 1:2500,  1:500) automatically. Scale cut-offs are]]></description>
			<content:encoded><![CDATA[<p>Investigating the performance of an intranet mapping website this week, I was introduced <a href="http://arcscripts.esri.com/details.asp?dbid=15570">MXDPERFSTAT</a>. It&#8217;s a fantastic tool for investigating map display performance. Given an ArcMap document (a .mxd file) it runs ArcMap and loops over the map layers, displaying each at a list of  scales (e.g.  1:100000, 1:10000, 1:2500,  1:500) automatically. Scale cut-offs are followed, in the same way ArcMap would.</p>
<p>Once done, MXDPERFSTAT writes an html report, of the time taken and features retrieved to display each layer at each scale. Since it runs in situ, network delays and other real world bottlenecks are accounted for. It even highlights layers that are abnormally slow, or that fetch an excessive number of features. Perfect for diagnosing a slow map, or guiding a tune up of the infrastructure.</p>
<p>Supporting ArcGIS installations, I&#8217;m a regular searcher on <a href="http://arcscripts.esri.com">ArcScripts</a>. How did I miss this for the last 4 years, and what other gems are there? What GIS utilities do you find indispensable?</p>
]]></content:encoded>
			<wfw:commentRss>http://moreati.org.uk/blog/2009/02/14/mxdperfstat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>from ESRI.ArcGIS import Geodatabase</title>
		<link>http://moreati.org.uk/blog/2009/01/27/from-esriarcgis-import-geodatabase/</link>
		<comments>http://moreati.org.uk/blog/2009/01/27/from-esriarcgis-import-geodatabase/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 22:55:59 +0000</pubDate>
		<dc:creator>Alex Willmer</dc:creator>
				<category><![CDATA[arcgis]]></category>

		<guid isPermaLink="false">http://moreati.org.uk/blog/?p=69</guid>
		<description><![CDATA[A couple of years ago I tried to use ArcObjects, through IronPython. It didn&#8217;t quite work. Last week I tried again, using the newly released IronPython 2.0. This time it worked better. create_sde_conn_file.py is based on CreateSDEConnFile.java, from Creating ArcSDE connection files on the fly using Python and ArcObjects on ESRI&#8217;s Geoprocessing blog. For those]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago <a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2007-February/004588.html">I tried to use ArcObjects, through IronPython</a>. It didn&#8217;t quite work.</p>
<p>Last week I tried again, using the newly released IronPython 2.0. This time it worked better.</p>
<p><a href="http://moreati.org.uk/blog/wp-content/uploads/2009/01/create_sde_conn_filepy.txt">create_sde_conn_file.py</a> is based on CreateSDEConnFile.java, from <a href="http://blogs.esri.com/Dev/blogs/geoprocessing/archive/2008/09/24/Tips-and-Tricks-_2D00_-Creating-ArcSDE-connection-files-on-the-fly-using-Python-and-ArcObjects.aspx">Creating ArcSDE connection files on the fly using Python and ArcObjects</a> on ESRI&#8217;s Geoprocessing blog.</p>
<p>For those not already familiar, <a href="http://en.wikipedia.org/wiki/ArcGIS">ArcGIS</a> is by accounts the market leader for Geographic Information System (GIS) software. The core of the suite comprises ArcGIS Desktop, and ArcGIS Server.</p>
<p>On the desktop ArcMap is used to create map documents (.mxd file), whilst ArcCatalog is used to manage data sources. ArcGIS Server can (amongst other things) serve a map document, as a service for web client, Google Earth or remote ArcMap users.</p>
<p>ArcGIS may be automated to an extent, through an interface known as ArcGIS Geoprocessing. But this covers only some cases, delving deeper provides much greater opportunities.</p>
<p>ArcGIS is built on a COM object library named <a href="http://resources.esri.com/arcgisdesktop/index.cfm?fa=forDevelopers">ArcObjects</a>. Native ArcGIS files, such as an ArcSDE connection (.sde file) are the in memory COM object, serialised to disk as binary. It is difficult to edit or create such files in an automated fashion, without calling ArcObjects.</p>
<p>So, like the Java code CreateSDEConnFile.py calls ArcObjects directly. It can produce an ArcSDE connection file, suitable for ArcCatalog. It works by calling the .NET bindings, through Interop assemblies. Anything that can be done through VBA, or C# should be possible through IronPython.</p>
<p>There are a couple of rough edges. ArcObjects is verbose, and IronPython requires some boilerplate to deal with interfaces. Instead of writing</p>
<p><code>conn_props['SERVER'] = sys.argv[2]</code></p>
<p>or even</p>
<p><code>conn_props.SetProperty('SERVER', sys.argv[2])</code></p>
<p>one needs to write:</p>
<p><code>esriSystem.IPropertySet.SetProperty(conn_props, 'SERVER', sys.argv[2])</code></p>
<p>This is explained properly in IronPython bug <a href="http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=1506">1506</a> and <a href="http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=4538">4538</a>.</p>
<p>To run the script call it as:</p>
<p><code>"c:Program FilesIronPythonipy.exe" create_sde_conn_file.py<br />
filename.sde hostname 5151 username password SDE.DEFAULT ""<br />
</code></p>
<p>My intention is to take this proof of concept further. To do the same with layer files and map documents. Ultimately to create a build system, able to automatically generate a complete ArcMap document, from textual source files (e.g. json2mxd.py, mxd2xml.py).  This would allow proper version control of the source material, and automatic deployment of ArcGIS Server map services.</p>
<p>In the wider scheme, it should be possible to create custom GIS applications with Python, using the full capabilities ArcObjects and ArcGIS.</p>
<p>Updated 29 Jan 2009: Added some context, for those coming to this post from a Python background. Expanded goals.</p>
]]></content:encoded>
			<wfw:commentRss>http://moreati.org.uk/blog/2009/01/27/from-esriarcgis-import-geodatabase/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Notes on using sdelayer to mosaic data into ArcSDE</title>
		<link>http://moreati.org.uk/blog/2008/03/27/notes-on-using-sdelayer-to-mosaic-data-into-arcsde/</link>
		<comments>http://moreati.org.uk/blog/2008/03/27/notes-on-using-sdelayer-to-mosaic-data-into-arcsde/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 23:30:39 +0000</pubDate>
		<dc:creator>Alex Willmer</dc:creator>
				<category><![CDATA[arcgis]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://www.moreati.org.uk/blog/2008/03/27/notes-on-using-sdelayer-to-mosaic-data-into-arcsde/</guid>
		<description><![CDATA[For those who aren&#8217;t familiar, ArcSDE is server software that sits atop a database to spatially enable it. The resulting geodatabase is able to store geographic features (e.g. roads, buildings, endangered habitats) along with more common SQL data types. ArcSDE can also store georeferenced rasters such as scanned plans/maps or satellite/aerial imagery. To load raster]]></description>
			<content:encoded><![CDATA[<p>For those who aren&#8217;t familiar, ArcSDE is server software that sits atop a database to spatially enable it. The resulting geodatabase is able to store geographic features (e.g. roads, buildings, endangered habitats) along with more common SQL data types. ArcSDE can also store georeferenced rasters such as scanned plans/maps or satellite/aerial imagery.</p>
<p>To load raster data as a continuous layer one typically mosaics many images, using ArcGIS Desktop or the sderaster command. ArcGIS Desktop is more flexible, it accepts many image formats and can resample images that don&#8217;t perfectly align, but it&#8217;s slow and struggles with large jobs. The sderaster command is faster and scriptable, but it accepts only tiffs and it&#8217;s <em>very fussy</em> about them.<br />
<span id="more-25"></span><br />
What follows are some notes that will remind me the next time and possibly help others.</p>
<ol>
<li>If the real world pixel size (i.e. units m/px or ft/px) on lines 1 &amp; 4 of the world file are not exactly equalt to the value you calculate then correct the world files. If present also correct the geotiff headers. Ordnance Survey 10K tiles may need this correction.</li>
<li>Pyramidding is only visually effective if it can create pixels with averaged colour values. Monochrome or colour mapped images do not satisfy this requirement.</li>
<li>The documentation states that ArcSDE cannot mosaic images with a colour map. This also applies in some cases where no colourmap is present, such as 4 bit greyscale. Use the -N switch to be safe and then reapply the colour map with sderaster -o colormap, once all images are mosaiced.</li>
<li>Geotiff headers are tricky to remove in place, en masse. When preprocessing images be sure that either the world file and/or geotiff tags are correct, or generate your tiffs without getiff tags.</li>
<li>GDAL is much faster than ImageMagick for altering bit depth. The libtiff utilities are faster yet.</li>
<li>Until ArcSDE 8.3 SP, sderaster required that the top left image be loaded into a raster first, or it wouldn&#8217;t mosaic anything.</li>
</ol>
<p>Those wishing to save the effort of loading images into ArcSDE, might wish to look into ArcGIS ImageServer or a WMS server.</p>
<p>To update world files in a batch try the following python script:</p>
<pre>
import os
import sys
import fileinput
import re
import glob

def replace_in_files(filenames, pattern, rterm):
    '''Replace all occurances of regex pattern with rterm in sequence of filenames'''
    regex = re.compile(pattern)
    for line in fileinput.input(filenames, inplace=True):
        sys.stdout.write(re.sub(rterm, line))

if __name__ == '__main__':
    pattern = sys.argv[1]
    rterm = sys.argv[2]
    filenames = glob.glob(sys.argv[3])

    replace_in_files(filenames, pattern, rterm)</pre>
]]></content:encoded>
			<wfw:commentRss>http://moreati.org.uk/blog/2008/03/27/notes-on-using-sdelayer-to-mosaic-data-into-arcsde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
