<?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>Chris' GISmo's &#187; Tutorial</title>
	<atom:link href="http://blog.webmapper.com.au/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.webmapper.com.au</link>
	<description>Not another GIS blog</description>
	<lastBuildDate>Tue, 01 Jun 2010 05:22:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Generic Web Proxies</title>
		<link>http://blog.webmapper.com.au/2007/11/30/generic-web-proxies/</link>
		<comments>http://blog.webmapper.com.au/2007/11/30/generic-web-proxies/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 13:12:09 +0000</pubDate>
		<dc:creator>Chris Tweedie</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://chris.narx.net/2007/11/30/generic-web-proxies/</guid>
		<description><![CDATA[In my quest for increased adoption of geospatial web services, I would constantly bash my head against the wall trying to debug GIS applications. So if you have suffered from &#8220;what the&#8221; behaviour such as &#8230;

weird uri encoding
apps pretending to talk SSL but only on some requests
not supporting BASIC authentication when they say they do
clients [...]


Related posts:<ol><li><a href='http://blog.webmapper.com.au/2006/03/23/new-wms-flash-client/' rel='bookmark' title='Permanent Link: New WMS Flash client'>New WMS Flash client</a></li>
<li><a href='http://blog.webmapper.com.au/2006/07/09/google-earths-issue-logging/' rel='bookmark' title='Permanent Link: Google Earth&#8217;s Issue logging &#8230;'>Google Earth&#8217;s Issue logging &#8230;</a></li>
<li><a href='http://blog.webmapper.com.au/2005/12/14/build-your-own-routing-solution/' rel='bookmark' title='Permanent Link: Build your own routing solution'>Build your own routing solution</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In my quest for increased adoption of geospatial web services, I would constantly bash my head against the wall trying to debug GIS applications. So if you have suffered from &#8220;what the&#8221; behaviour such as &#8230;</p>
<ul>
<li>weird uri encoding</li>
<li>apps pretending to talk SSL but only on some requests</li>
<li>not supporting BASIC authentication when they say they do</li>
<li>clients not sending the required STYLES WMS kvp</li>
<li>sending hundreds upon hundreds of chunked requests &#8230;</li>
</ul>
<p>then these scripts/apps may be for you. They are pretty generic and can be applied to any AJAX-type cross-domain restriction. The only OGC specific type line is the string replace of the online resource with the proxy uri (for obvious reasons for the getcapabilities document).</p>
<p>Other recommends ..</p>
<ol>
<li>For desktop based apps, i highly recommend <a href="http://www.fiddler2.com/">fiddler2</a> as man in the middle proxy interceptor for debugging HTTP. It even does HTTPS mitm <img src='http://blog.webmapper.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>If you want to enable HTTPS/BASIC authentication on a desktop client that doesnt support it, check out <a href="http://inteproxy.wald.intevation.org/">InteProxy</a> or email me for my own &#8220;Gismo&#8221; command line version. This will allow apps such as GRASS or QGIS which only has standard WMS support to magically start working on these services</li>
</ol>
<p>But if you are just trying to get your poor <a href="http://www.openlayers.org">OpenLayers </a>application talking to that lonesome WFS server sitting on the interweb, these might come in handy!</p>
<blockquote><p>Note that these are open proxies by default!</p></blockquote>
<pre line="0" lang="php">&lt; ?php
	$urlparams = urldecode($_SERVER['QUERY_STRING']);
         $ch = curl_init();
	curl_setopt($ch, CURLOPT_URL,$url."&amp;Styles=");
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);
 	curl_setopt($ch, CURLOPT_USERAGENT, "Openlayers proxy - CTweedie hax"); // Set a different user-agent so we can track usage easier
	curl_setopt($ch, CURLOPT_FAILONERROR,1);
	//curl_setopt($ch, CURLOPT_VERBOSE, 1);
   	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  // the next 3 lines makes it work through https SSL3 with authorization.
	curl_setopt($ch, CURLOPT_SSLVERSION, 3);
	curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
	$data = curl_exec($ch); // Execute query
        $data = str_replace("https://www.wms.com/server/to/reflect/to?","https://www.wms.com/server/proxy?", $data)
        $content_type = curl_getinfo( $ch, CURLINFO_CONTENT_TYPE );
	header('Content-Type: '.$content_type);
	echo $data;
	curl_close($ch);
&gt;</pre>
<p>Python equivalent &#8230; almost identical to the OpenLayers version. In most situations, py urllib runs hands down quicker than php curl but it could well be my dodgy code!</p>
<pre line="0" lang="python">
#!/usr/bin/env python -u

import urllib
import urllib2
import cgi
import socket
import msvcrt
import os
import sys
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
# timeout in seconds
timeout = 15
socket.setdefaulttimeout(timeout)

fs = cgi.FieldStorage()
urlt = "https://www.wms.com/server/to/reflect/to?"

for i in fs.keys():
  urlt += i+"="+fs[i].value+"&amp;"
url = urllib.unquote(urlt)
try:
    if url.startswith("http://") or url.startswith("https://"):
           passman = urllib2.HTTPPasswordMgrWithDefaultRealm()      # this creates a password manager
           passman.add_password(None, urlt, 'user', 'password')      # because we have put None at the start it will always use this username/password combination
           authhandler = urllib2.HTTPBasicAuthHandler(passman)                 # create the AuthHandler
           opener = urllib2.build_opener(authhandler)
           urllib2.install_opener(opener)
        y = urllib2.urlopen(url)

        headers = str(y.info()).split('\n')
        for h in headers:
            if h.startswith("Content-Type:"):
                print h
        print
        print y.read().replace("https://www.wms.com/server/to/reflect/to?","https://www.wms.com/server/proxy?")
        y.close()
    else:
        print """Content-Type: text/plain Illegal request."""
except Exception, E:
    print "Status: 500 Unexpected Error"
    print "Content-Type: text/plain"
    print
    print url
    print "Some unexpected error occurred. Error text was:", E</pre>


<p>Related posts:<ol><li><a href='http://blog.webmapper.com.au/2006/03/23/new-wms-flash-client/' rel='bookmark' title='Permanent Link: New WMS Flash client'>New WMS Flash client</a></li>
<li><a href='http://blog.webmapper.com.au/2006/07/09/google-earths-issue-logging/' rel='bookmark' title='Permanent Link: Google Earth&#8217;s Issue logging &#8230;'>Google Earth&#8217;s Issue logging &#8230;</a></li>
<li><a href='http://blog.webmapper.com.au/2005/12/14/build-your-own-routing-solution/' rel='bookmark' title='Permanent Link: Build your own routing solution'>Build your own routing solution</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.webmapper.com.au/2007/11/30/generic-web-proxies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Geoserver KML output</title>
		<link>http://blog.webmapper.com.au/2006/02/13/geoserver-kml-output/</link>
		<comments>http://blog.webmapper.com.au/2006/02/13/geoserver-kml-output/#comments</comments>
		<pubDate>Mon, 13 Feb 2006 05:02:01 +0000</pubDate>
		<dc:creator>Chris Tweedie</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://chris.narx.net/2006/02/13/geoserver-kml-output/</guid>
		<description><![CDATA[As mentioned a while back, Geoserver had some experimental code for KML output. The latest PR1 release has vastly improved KML support, largely submitted by James MacGill.
There was a recent question on the GS-Users list about how to use the sucker inside Google Earth. My personal preference is still for WMS overlays, but if for [...]


Related posts:<ol><li><a href='http://blog.webmapper.com.au/2007/04/20/geoserver-testing/' rel='bookmark' title='Permanent Link: Geoserver testing ..'>Geoserver testing ..</a></li>
<li><a href='http://blog.webmapper.com.au/2006/04/13/mapserver-gif-transparency/' rel='bookmark' title='Permanent Link: Mapserver GIF Transparency'>Mapserver GIF Transparency</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/13/adding-wms-overlays-to-google-earth/' rel='bookmark' title='Permanent Link: Adding WMS overlays to Google Earth'>Adding WMS overlays to Google Earth</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As mentioned a while back, <a href="http://geoserver.sf.net">Geoserver</a> had some experimental code for KML output. The latest PR1 release has vastly improved KML support, largely submitted by James MacGill.</p>
<p>There was a recent question on the GS-Users list about how to use the sucker inside Google Earth. My personal preference is still for <a href="http://chris.narx.net/2005/08/03/adding-wms-overlays-to-google-earth/"><acronym title="Web Mapping Service">WMS</acronym> overlays</a>, but if for some reason you’d like your live data outputted as KML, read on.</p>
<p><strong>1.</strong> First things first, grab the <a href="http://docs.codehaus.org/display/GEOS/Latest">PR1 release</a>.</p>
<p><strong>2.</strong> Setup your desired datastore using the GS web interface. In my case i will configure a new ArcSDE datastore.</p>
<p><strong>3.</strong> Add your new featuretype, making sure you set the SRS as 4326 and generate the corresponding bounding box.</p>
<p><img alt="Featuretype config" src="http://chris.narx.net/wp-content/uploads/2006/02/kml1.JPG" /></p>
<p><strong>4.</strong> Do the old Apply/Save/Load trick to load your changes.</p>
<p><strong>5.</strong> Now our data is ready to go, we better check KML output is supported. Send a <acronym title="Web Mapping Service">WMS</acronym> (yes, <acronym title="Web Mapping Service">WMS</acronym>) GetCapabilities to your service and check that you have the following,</p>
<p><code><br />
image/png<br />
image/jpeg<br />
image/svg+<acronym title="eXtensible Markup Language">XML</acronym><br />
image/gif<br />
<strong>application/vnd.google-earth.kml+<acronym title="eXtensible Markup Language">XML</acronym></strong></p>
<p></code></p>
<p>6. We’re almost done. Now all we need to do is setup a corresponding network link to point to the “KML document” (which is in fact, just a <acronym title="Web Mapping Service">WMS</acronym> call to the KML output format).</p>
<p>Add the following in the location box for a new network link,</p>
<blockquote><p>http://localhost:8080/geoserverpr1/wms?service=<acronym title="Web Mapping Service">WMS</acronym>&#038;version=1.0.0&#038;request=GetMap&#038;format=application/vnd.google-earth.kml+<acronym title="eXtensible Markup Language">XML</acronym>&#038;width=500&#038;height=500&#038;srs=EPSG:4326&#038;layers=topp:lga&#038;styles=green</p>
</blockquote>
<p>and set the refresh parameters to fly-based refresh after “4 secs”</p>
<p><a class="imagelink" title="Refresh params" href="http://chris.narx.net/wp-content/uploads/2006/02/kml2.JPG"><img width="68" height="96" id="image58" alt="Refresh params" src="http://chris.narx.net/wp-content/uploads/2006/02/kml2.thumbnail.JPG" /></a></p>
<p>7. Assuming all went ok, you should now have a feature for each polygon which can be toggled individually.</p>
<p><img id="image59" alt="Final" src="http://chris.narx.net/wp-content/uploads/2006/02/final.JPG" /></p>
<p>If you are feeling lucky, try adding label definitions and view scales to your <acronym title="Styled Layer Definition">SLD</acronym>. Otherwise you may be unintentially trying to retrieve a KML file containing your whole road dataset <img alt=":)" class="wp-smiley" src="http://chris.narx.net/wp-includes/images/smilies/icon_smile.gif" /></p>
<p>Be aware that due to the way GS extracts each feature, the polygon extents can and will extend beyond the requested BBOX, which can be a good or a bad thing i guess.</p>
<p>Things that could well be added in the future: KMZ support, more customisable KML output (such as Z/height attributes) … the list goes on. The flexibility in using the available Geoserver datastores certainly makes this a viable alternative to using the 100 different “arc exporters”. You just can’t beat live data getting sucked straight from your database</p>
<p>If this article interests you, please swing by the <a href="http://sourceforge.net/mailarchive/forum.php?forum_id=37206">GS-Users list</a> and say gday, they are always keen to get more contributors on board.</p>


<p>Related posts:<ol><li><a href='http://blog.webmapper.com.au/2007/04/20/geoserver-testing/' rel='bookmark' title='Permanent Link: Geoserver testing ..'>Geoserver testing ..</a></li>
<li><a href='http://blog.webmapper.com.au/2006/04/13/mapserver-gif-transparency/' rel='bookmark' title='Permanent Link: Mapserver GIF Transparency'>Mapserver GIF Transparency</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/13/adding-wms-overlays-to-google-earth/' rel='bookmark' title='Permanent Link: Adding WMS overlays to Google Earth'>Adding WMS overlays to Google Earth</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.webmapper.com.au/2006/02/13/geoserver-kml-output/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Adding routing overlays to kamap</title>
		<link>http://blog.webmapper.com.au/2006/02/05/adding-routing-overlays-to-kamap/</link>
		<comments>http://blog.webmapper.com.au/2006/02/05/adding-routing-overlays-to-kamap/#comments</comments>
		<pubDate>Sun, 05 Feb 2006 04:45:36 +0000</pubDate>
		<dc:creator>Chris Tweedie</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://chris.narx.net/2006/02/05/adding-routing-overlays-to-kamap/</guid>
		<description><![CDATA[Finally, my promised follow up to my build your own routing solution article. For those who have had success massaging their data to work the pgdjikstra module, lets rock and roll. I’m writing this on the fly so hopefully by the end we can get a usable, user-friendly routing solution into Kamap.

  1. Kamap [...]


Related posts:<ol><li><a href='http://blog.webmapper.com.au/2006/03/21/kamap-wfs-point-overlays/' rel='bookmark' title='Permanent Link: Kamap WFS point overlays'>Kamap WFS point overlays</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/13/adding-wms-overlays-to-google-earth/' rel='bookmark' title='Permanent Link: Adding WMS overlays to Google Earth'>Adding WMS overlays to Google Earth</a></li>
<li><a href='http://blog.webmapper.com.au/2005/12/14/build-your-own-routing-solution/' rel='bookmark' title='Permanent Link: Build your own routing solution'>Build your own routing solution</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Finally, my promised follow up to my <a href="http://chris.narx.net/2005/12/14/build-your-own-routing-solution/">build your own routing solution</a> article. For those who have had success massaging their data to work the <a href="http://www.cartoweb.org">pgdjikstra</a> module, lets rock and roll. I’m writing this on the fly so hopefully by the end we can get a usable, user-friendly routing solution into Kamap.</p>
<p><a id="more-53"></a></p>
<p><a id="more-53"> </a><a id="more-53"><strong> 1. Kamap install.</strong></a></p>
<p><a id="more-53">  </a><a id="more-53">Grab the latest stable (or <acronym title="Concurrent Versions System">CVS</acronym> if you’re feeling lucky) release and follow the instructions to get it up an running. Paul and the rest of the crew have made this possibly the easiest frontend to get up and running in a flash, but if you do run into problems please contact </a><a href="http://lists.maptools.org/pipermail/ka-map-users/">the list</a>.</p>
<p>Ignore my setup / mess, this was an existing mapfile used for benchmarks. This is possibly what you shouldn’t have setup, but its got the road centrelines so it’ll do for our purposes.<br />
<a href="http://chris.narx.net/wp-content/uploads/2006/02/kamap11.JPG" onclick="doPopup(50);return false;" class="imagelink" title="kamap"><img src="http://chris.narx.net/wp-content/uploads/2006/02/kamap11.thumbnail.JPG" id="image50" alt="kamap" height="74" width="128" /></a></p>
<p><strong>2. Create a database handler</strong></p>
<p>Since we would like the users to be able to interface with our db, we need to create a little interface to query the roads and execute the shortest_path_as_geometry call. For the sake of simplicity, the following should give you somewhere to start. (Source: <a href="http://chris.narx.net/wp-content/uploads/2006/02/querydb.txt" id="p51">querydb.php</a>, if the output below gets munged)</p>
<p>Dont worry if the output format doesnt really make much sense at the moment, we’ll touch on this in the next step.</p>
<pre line="1" lang="php">
&lt; ?php
//SQL query
$query = "SELECT astext(the_geom) FROM shortest_path_as_geometry('roads', ".$start.", ".$end.");";
$result = pg_query($query) or die('Query failed: ' . pg_last_error()); // output
echo "n";
echo "n";
echo "	<label>Startn";
echo "  ";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
      foreach ($line as $col_value) {
               $col_value = str_replace("MULTILINESTRING((", " ", "$col_value");
               $col_value = str_replace("))", ", ", "$col_value");
               echo "$col_value";
      }
}
echo "n";
echo "n";
echo "n";  // Free resultset
pg_free_result($result);  // Closing connection
pg_close($dbconn);
} ?&gt;</label></pre>
<p><strong>3. Integrating PG’s kaXmlOverlay code</strong></p>
<p>PG has done some great work looking into how best to integrate vector overlays on kamap, much like google maps does. Technically, there are lots of different options, but PG’s latest code uses a mix of the wz_jsgraphics and the <acronym title="Hypertext PreProcessing">PHP</acronym> GD library.</p>
<p>This option has arguably the best cross browser support in that the route is actually rendered and thus positioned, as a <acronym title="Portable Network Graphics">PNG</acronym>/gif image. But more on that later.</p>
<p>PG has posted a demo of the capabilities at his site (<a href="http://sistel.dyndns.info/ka-map/indext.html">http://sistel.dyndns.info/ka-map/indext.html</a>).</p>
<p>You will need to download the <a href="http://sistel.dyndns.info/ka-map/kaXmlOverlay.js">kaXmlOverlay.js</a>, <a href="http://sistel.dyndns.info/ka-map/drawgeom.php.txt">drawGeom.php</a> and the <a href="http://sistel.dyndns.info/ka-map/wz_jsgraphics.js">wz_jsgraphics</a> library.</p>
<p>Edit your existing kamap index.html and add,</p>
<pre line="1" lang="javascript">
<script type="text/javascript"> 
var myCoordinates = myFixedOverlay = myMovingOverlay = myInterval = null; 
function localOnLoad() { 	
    myOnLoad(); 	
    myKaMap.registerForEvent( KAMAP_MAP_INITIALIZED, null, localMapInitialized );     
    myFixedOverlay = new kaXmlOverlay( myKaMap, 200 ); 
}  
function localMapInitialized( eventID, mapName ) { 
          myFixedOverlay.loadXml('querydb.php?ST=219102&#038;EN=183552'); 
} 
</script></pre>
<p>The code is pretty self explanatory, we simply define the path to the <acronym title="eXtensible Markup Language">XML</acronym> (querydb.php) and attach it to the map initialised handler. PG has a slightly alternative setup on his demo website, adding a refresh function to automatically refresh the <acronym title="eXtensible Markup Language">XML</acronym> doc at a set period. This is a real handy feature if you’re tracking a live GPS feed, but in our case it just adds extra overhead.</p>
<p><strong>4. Time to test</strong></p>
<p>Since the code contains a few point of failures its best to start at the beginning,</p>
<ol>
<li>Chose a start and end edge id from your postgis table and try running http://your.host/kamap/querydb.php?ST=startid&amp;EN=endid. You should get a well formatted text/xml response with the routing coordinates. If the edge ids dont exist or the geometry function did not work, you will get an error here.</li>
<li>Now you have determined that you have got the coords, time to try kamap. Load up the modified index from step #3 and tail the apache logs. Amongst all the js queries, there should be one eventual request for the querydb, and then for the drawgeom (something like drawgeom.php?gt=L&amp;st=5&amp;bp=5&amp;sc=25&amp;cl=15,1800,0..). If after 30 seconds or so you dont appear to see any overlays, strip out the exact request from your log and try to run it in isolation. eg. http://localhost/kamap/drawgeom.php?gt=L&amp;st=5&amp;bp=5&amp;… if GD is configured properly you should get an image output like below (<acronym title="Portable Network Graphics">PNG</acronym>)</li>
<p><a href="http://chris.narx.net/wp-content/uploads/2006/02/gdoutput.png" title="gdoutput.png" class="imagelink"><img src="http://chris.narx.net/wp-content/uploads/2006/02/gdoutput.thumbnail.png" alt="gdoutput.png" id="image54" height="96" width="66" /></a></p>
<li>If its still not working, there probably just a <acronym title="Uniform Resource Locator">URL</acronym> thats throwing a 404. Keep checking the logs for what its requesting just to make sure its not trying to find a file in / and not /kamap</li>
</ol>
<p><strong>5. The result</strong></p>
<p><img src="http://chris.narx.net/wp-content/uploads/2006/02/kamap2.JPG" /></p>
<p>Apologies in advance as i just didnt have time to implement a more dynamic approach such as a user entering a start/end address. I hope someone else out there has the time and the inclination to extend this stuff. The possiblities are endless.</p>
<p><strong>6. Problems and future additions?</strong></p>
<ol>
<li>Needs a better way of converting geo2pix. The existing js function has meant that potentially you could have 40 + coordinate pairs being converted (DB-&gt;XML-&gt;JS-&gt;Drawgeom-&gt;Image) to pixel space, and then passed via a <acronym title="Uniform Resource Locator">URL</acronym> parameter to drawgeom.php. <strong>Very inefficient, and can also go beyond the <acronym title="Uniform Resource Locator">URL</acronym> size limit</strong> … maybe short term the use of POST might be more suitable?</li>
<li>Line simplification. Further work needs to see how suitable the PostGIS simplify() function is. Conceptually, a function to guesstimate a suitable tolerance for the zoom level, and then retrieve the new coords would be suitable but how easy at guessing said tolerance would be interesting.</li>
<li>JS bloat. I’d prefer to move as much code as possible server side, especially for “calculations”. Being able to pass the current client params such as pixel/cell size, coords, scale etc. would mean much of the xmlOverlay.js code done by PG could be done server side, and potentially drawn in the same thread (eg. no need for a separate drawgeom.php … the initial query would pass the results direct)</li>
<li>An extension to the current querying abilities, where users can click on the map for their start and end points, and the click points would be translated into geo and then fed back into a postgis function to grab the closest road edge. This was what i wanted to do for this article, but alas theres never time.</li>
</ol>


<p>Related posts:<ol><li><a href='http://blog.webmapper.com.au/2006/03/21/kamap-wfs-point-overlays/' rel='bookmark' title='Permanent Link: Kamap WFS point overlays'>Kamap WFS point overlays</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/13/adding-wms-overlays-to-google-earth/' rel='bookmark' title='Permanent Link: Adding WMS overlays to Google Earth'>Adding WMS overlays to Google Earth</a></li>
<li><a href='http://blog.webmapper.com.au/2005/12/14/build-your-own-routing-solution/' rel='bookmark' title='Permanent Link: Build your own routing solution'>Build your own routing solution</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.webmapper.com.au/2006/02/05/adding-routing-overlays-to-kamap/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WMS Service Mining</title>
		<link>http://blog.webmapper.com.au/2006/01/19/wms-service-mining/</link>
		<comments>http://blog.webmapper.com.au/2006/01/19/wms-service-mining/#comments</comments>
		<pubDate>Thu, 19 Jan 2006 05:02:44 +0000</pubDate>
		<dc:creator>Chris Tweedie</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://chris.narx.net/2006/01/19/wms-service-mining/</guid>
		<description><![CDATA[Services such as Jeremy’s mapdex has certainly raised the profile or rather, the ease of use in finding geospatial web services. Although limited to picking up ArcIMS at the moment, i eagerley await his next installment of WMS service support *hint hint*.
In the mean time, i had a query from a collegue about how to [...]


Related posts:<ol><li><a href='http://blog.webmapper.com.au/2007/01/22/google-earth-wms-still-undercooked/' rel='bookmark' title='Permanent Link: Google Earth WMS still undercooked'>Google Earth WMS still undercooked</a></li>
<li><a href='http://blog.webmapper.com.au/2006/09/15/google-half-bakes-wms-support/' rel='bookmark' title='Permanent Link: Google half bakes WMS support'>Google half bakes WMS support</a></li>
<li><a href='http://blog.webmapper.com.au/2006/07/09/google-earths-issue-logging/' rel='bookmark' title='Permanent Link: Google Earth&#8217;s Issue logging &#8230;'>Google Earth&#8217;s Issue logging &#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Services such as Jeremy’s <a href="http://mapdex.org">mapdex</a> has certainly raised the profile or rather, the ease of use in finding geospatial web services. Although limited to picking up ArcIMS at the moment, i eagerley await his next installment of <acronym title="Web Mapping Service">WMS</acronym> service support *hint hint*.</p>
<p>In the mean time, i had a query from a collegue about how to go about finding some open <acronym title="Web Mapping Service">WMS</acronym> services so he could test out one of his apps. While <a href="http://www.opengeospatial.org">CS-W (Catalogue Services &#8211; Web)</a> is brewing away in the never never, lets use Mr Google,</p>
<blockquote><p><a href="http://www.google.com.au/search?q=allinurl:+">http://www.google.com/search?q=allinurl:+”Request=getcapabilities”</a></p></blockquote>
<p><font size="-1">12,100 results</font>. A good enough start. Although be weary that pagerank doesnt really help us,</p>
<ol>
<li>in determining the more “popular” services</li>
<li>if the service is still alive</li>
<li>if the service is even supposed to be public</li>
</ol>
<p>I’d highly advise contacting the owner <strong>before</strong> using any servers in a non-test environment <img class="wp-smiley" alt=":)" src="http://chris.narx.net/wp-includes/images/smilies/icon_smile.gif" /><br />
Lets narrow it down to country,</p>
<p>(Aus) <a href="http://www.google.com/search?q=allinurl:+%22Request=getcapabilities%22&#038;meta=cr=countryAU">http://www.google.com/search?q=allinurl:+”Request=getcapabilities”&#038;meta=cr=countryAU</a></p>
<ul>
<li>30 results. Ouch</li>
</ul>
<p><a href="http://www.google.com.au/search?q=allinurl:+"> </a><a href="http://www.google.com.au/search?q=allinurl:+">(US) </a><a href="http://www.google.com/search?q=allinurl:+%22Request=getcapabilities%22&#038;meta=cr=countryUS">http://www.google.com/search?q=allinurl:+”Request=getcapabilities”&#038;meta=cr=countryUS</a></p>
<ul>
<li>980 results … better</li>
</ul>
<p>(UK) <a href="http://www.google.com/search?q=allinurl:+%22Request=getcapabilities%22&#038;meta=cr=countryUK">http://www.google.com/search?q=allinurl:+”Request=getcapabilities”&#038;meta=cr=countryUK</a></p>
<ul>
<li>16 results. Surprising.</li>
</ul>
<p>Sure it’s hit and miss but at least it gives you somewhere to start. Who knows, you might even find a service which is documented and actually has metadata!</p>
<p>Skylab Mobilesystems has a <a href="http://www.skylab-mobilesystems.com/en/wms_serverlist.html">rather large list</a> available which was collected using their “<acronym title="Web Mapping Service">WMS</acronym>-Crawler”. No idea on how it actually collects the servers, but i suspect its much the same as what we use with google.</p>
<p>If there are further resources on public services, please leave a comment for others to use.</p>
<p>It raises an interesting point on <acronym title="Web Mapping Service">WMS</acronym> security though. Mapdex honours any ACL restrictions on ArcIMS services … but with no such alternative for most <acronym title="Web Mapping Service">WMS</acronym> apps, anyone who visits a getCapabilities document and then visits google is potentially opening up the server to the googlebot crawler.</p>
<p>I guess if you’re really that worried, you should look into adding your <acronym title="Web Mapping Service">WMS</acronym> applications to your robots.txt, or using some rewrite rule to deny access to identified crawlers.</p>
<p>Interesting point none the less.</p>


<p>Related posts:<ol><li><a href='http://blog.webmapper.com.au/2007/01/22/google-earth-wms-still-undercooked/' rel='bookmark' title='Permanent Link: Google Earth WMS still undercooked'>Google Earth WMS still undercooked</a></li>
<li><a href='http://blog.webmapper.com.au/2006/09/15/google-half-bakes-wms-support/' rel='bookmark' title='Permanent Link: Google half bakes WMS support'>Google half bakes WMS support</a></li>
<li><a href='http://blog.webmapper.com.au/2006/07/09/google-earths-issue-logging/' rel='bookmark' title='Permanent Link: Google Earth&#8217;s Issue logging &#8230;'>Google Earth&#8217;s Issue logging &#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.webmapper.com.au/2006/01/19/wms-service-mining/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ArcIMS stress test</title>
		<link>http://blog.webmapper.com.au/2006/01/16/arcims-stress-test/</link>
		<comments>http://blog.webmapper.com.au/2006/01/16/arcims-stress-test/#comments</comments>
		<pubDate>Mon, 16 Jan 2006 04:59:01 +0000</pubDate>
		<dc:creator>Chris Tweedie</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://chris.narx.net/2006/01/16/arcims-stress-test/</guid>
		<description><![CDATA[Arcscripts can be a funny place. It can either annoy you with commercial “shareware” or 8 year old avenue code or sometimes, just sometimes you stumble upon an extremely useful tool. I have been involved in an upgrade of ArcIMS from 4 to 9.1 and obviously i was looking into performance testing before we moved [...]


Related posts:<ol><li><a href='http://blog.webmapper.com.au/2006/08/17/arcims-security-hole-fixed/' rel='bookmark' title='Permanent Link: ArcIMS Security hole fixed?'>ArcIMS Security hole fixed?</a></li>
<li><a href='http://blog.webmapper.com.au/2005/10/16/securing-your-geometry-in-arcims/' rel='bookmark' title='Permanent Link: Securing your geometry in Arcims'>Securing your geometry in Arcims</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/10/useful-arcims-tools/' rel='bookmark' title='Permanent Link: Useful ArcIMS tools'>Useful ArcIMS tools</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://arcscripts.esri.com">Arcscripts</a> can be a funny place. It can either annoy you with commercial “shareware” or 8 year old avenue code or sometimes, just sometimes you stumble upon an extremely useful tool. I have been involved in an upgrade of ArcIMS from 4 to 9.1 and obviously i was looking into performance testing before we moved the new infrastructure into production.</p>
<p>I was *this* close to writing my own jmeter script when i found <a href="http://arcscripts.esri.com/details.asp?dbid=12388">ArcIMS Stress Test</a> which effectively did every thing i was looking for,</p>
<ul>
<li>Parses an existing image/queryserver logfile to re-use for the test</li>
<li>Ability to use the same time between requests as in the log file or a preset delay</li>
<li>Ability to view the ouput of the sent requests</li>
<li>Ability to log test summary information to file</li>
</ul>
<p><img width="249" height="195" id="image42" alt="Stress dialog" src="http://chris.narx.net/wp-content/uploads/2006/01/stress.jpg" /></p>
<p>Sure, it doesnt log the hardware performance on the server or uses any special threading / multi-user system, but for my case all i wanted to do was test a “typical day” on the new rig. <strong>Highly recommended</strong></p>
<p>Kudos to the author,  			<a title="email Milos van Leeuwen" href="http://arcscripts.esri.com/ContactAuthor.asp?dbid=12388">Milos van Leeuwen</a></p>


<p>Related posts:<ol><li><a href='http://blog.webmapper.com.au/2006/08/17/arcims-security-hole-fixed/' rel='bookmark' title='Permanent Link: ArcIMS Security hole fixed?'>ArcIMS Security hole fixed?</a></li>
<li><a href='http://blog.webmapper.com.au/2005/10/16/securing-your-geometry-in-arcims/' rel='bookmark' title='Permanent Link: Securing your geometry in Arcims'>Securing your geometry in Arcims</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/10/useful-arcims-tools/' rel='bookmark' title='Permanent Link: Useful ArcIMS tools'>Useful ArcIMS tools</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.webmapper.com.au/2006/01/16/arcims-stress-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spatial indexing</title>
		<link>http://blog.webmapper.com.au/2006/01/12/spatial-indexing/</link>
		<comments>http://blog.webmapper.com.au/2006/01/12/spatial-indexing/#comments</comments>
		<pubDate>Thu, 12 Jan 2006 05:07:02 +0000</pubDate>
		<dc:creator>Chris Tweedie</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://chris.narx.net/2006/01/12/spatial-indexing/</guid>
		<description><![CDATA[Update: Further investigation revealed that my GiST indexes weren’t built correctly and so i have since updated the timings on the postgis results. Thanks to Sean for pointing out my boo boo.
I have noticed a bit of interest especially on PostGIS‘ new implementation of a GiST spatial index to speed up its performance. What i [...]


Related posts:<ol><li><a href='http://blog.webmapper.com.au/2005/09/01/new-orleans-satellite-imagery/' rel='bookmark' title='Permanent Link: New Orleans Satellite Imagery'>New Orleans Satellite Imagery</a></li>
<li><a href='http://blog.webmapper.com.au/2007/04/25/wfs-feature-paging-yes-please/' rel='bookmark' title='Permanent Link: WFS Feature paging &#8230; yes please'>WFS Feature paging &#8230; yes please</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/12/10-utils-to-make-opensource-gis-that-little-bit-easier/' rel='bookmark' title='Permanent Link: 10 utils to make opensource gis that little bit easier'>10 utils to make opensource gis that little bit easier</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><u><strong>Update:</strong> </u>Further investigation revealed that my GiST indexes weren’t built correctly and so i have since updated the timings on the postgis results. Thanks to Sean for pointing out my boo boo.</p>
<p>I have noticed a bit of interest especially on <a href="http://postgis.refractions.net">PostGIS</a>‘ new implementation of a GiST spatial index to speed up its performance. What i think is lacking is that there is little to no documentation on how “much” faster spatial indexing (not to be confused with attribute indexes) performs.</p>
<p>So here we go, a simple benchmark in less than 15 mins <img class="wp-smiley" alt=":)" src="http://chris.narx.net/wp-includes/images/smilies/icon_smile.gif" /></p>
<p>First up, my datasets. For the base data, i will use the roads dataset from my previous routing article.</p>
<p>The benchmark tests in this case will be a simple, arbitrary bbox on the following datasets interfacing with Mapserver 4.6 (win32). <span style="font-style: italic" /></p>
<p><span style="font-style: italic"><em><u>Word of warning:</u></em> Please dont take these results as gospel, its merely to highlight the performance differences across the board.</span></p>
<p>FYI:</p>
<ul>
<li>All data is in CRS 4326 (WGS84)</li>
<li>The timings will be extracted using the debug output from mapserver</li>
<li>Note the number of features in each query, the first obviously not being very realistic</li>
<li>A <acronym title="Web Mapping Service">WMS</acronym> requests are for single layers only with the BBOX values below</li>
</ul>
<ol>
<li>115.69402,-32.1273,116.09642,-31.86770 <strong>Features:</strong> 57564</li>
<li>115.82508,-32.0358,115.93653,-31.97567 <strong>Features:</strong> 8408</li>
<li>115.81400,-32.0493,115.86604,-32.02131 <strong>Features:</strong> 1389</li>
<li>115.82171,-32.0405,115.84112,-32.03009 <strong>Features:</strong> 338</li>
</ol>
<table width="560" style="height: 30px">
<tr>
<td>&nbsp;</td>
<td><strong>Shapefile (no index)</strong></td>
<td><strong>Shapefile (qix index^)</strong></td>
<td><strong>PostGIS 8.1 (no index)</strong></td>
<td><strong>PostGIS 8.1 (GiST index)*</strong></td>
</tr>
<tr>
<td>1.</td>
<td style="vertical-align: top">2.938s</td>
<td style="vertical-align: top">2.201s</td>
<td style="vertical-align: top">5.297s</td>
<td style="vertical-align: top">4.275s</td>
</tr>
<tr>
<td valign="top">2.</td>
<td valign="top">0.694s</td>
<td valign="top">0.294s</td>
<td valign="top">2.812s</td>
<td valign="top">1.656s</td>
</tr>
<tr>
<td valign="top">3.</td>
<td valign="top">0.601s</td>
<td valign="top">0.140s</td>
<td valign="top">1.796s</td>
<td valign="top">0.987s</td>
</tr>
<tr>
<td valign="top">4.</td>
<td valign="top">0.219s</td>
<td valign="top">0.032s</td>
<td valign="top">0.914s</td>
<td valign="top">0.223s</td>
</tr>
</table>
<ul>
<li>^ Created with the standard quadtree sizes determine by the shptree utility</li>
<li>* Created with “CREATE INDEX roadsindex ON roadsindex USING GIST( the_geom GIST_GEOMETRY_OPS );” as per <a href="http://postgis.refractions.net/docs/ch04.html#id2900380">postgis documentation</a></li>
</ul>
<p>I think the table speaks for itself, but im a little bit cautious about drawing too many conclusions. Most people are aware that PostGIS is slower than shapefiles, but thats a given. Most users who use PostGIS are using it for other reasons (such as for its geoprocessing functions).</p>
<p>The PostGIS guys have claimed about a 10% performance loss over shapefiles. In this little test it was indeed more than this, but i have no doubts that in the hands of a more experienced postGIS expert that they could certainly narrow down the gap further.<br />
Fact of the matter is, spatial indexing is an important part of performance optimisation but should be considered with other methods such as view scale limiting, simplified symbolisation and feature generalisation. Unfortunately i dont have access to a mapserver hooked up with ArcSDE 9 or Oracle Spatial … could of made things interesting <img class="wp-smiley" alt=":)" src="http://chris.narx.net/wp-includes/images/smilies/icon_smile.gif" /></p>
<p>Please, i make no attempts at claiming i am the master of all that is postgis and mapserver. If there is something glaringly obvious that i did not configure or did not include, please let me know and i will be happy to update the results.</p>


<p>Related posts:<ol><li><a href='http://blog.webmapper.com.au/2005/09/01/new-orleans-satellite-imagery/' rel='bookmark' title='Permanent Link: New Orleans Satellite Imagery'>New Orleans Satellite Imagery</a></li>
<li><a href='http://blog.webmapper.com.au/2007/04/25/wfs-feature-paging-yes-please/' rel='bookmark' title='Permanent Link: WFS Feature paging &#8230; yes please'>WFS Feature paging &#8230; yes please</a></li>
<li><a href='http://blog.webmapper.com.au/2005/08/12/10-utils-to-make-opensource-gis-that-little-bit-easier/' rel='bookmark' title='Permanent Link: 10 utils to make opensource gis that little bit easier'>10 utils to make opensource gis that little bit easier</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.webmapper.com.au/2006/01/12/spatial-indexing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
