<?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>Numpty&#039;s Progress</title>
	<atom:link href="http://glaikit.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://glaikit.org</link>
	<description>lost, to five decimal places</description>
	<lastBuildDate>Tue, 15 Jan 2013 13:03:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>QGIS: Getting your ClickFu back</title>
		<link>http://glaikit.org/2013/01/15/qgis-getting-your-clickfu-back/</link>
		<comments>http://glaikit.org/2013/01/15/qgis-getting-your-clickfu-back/#comments</comments>
		<pubDate>Tue, 15 Jan 2013 13:03:59 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[clickfu]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[qgis]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=825</guid>
		<description><![CDATA[Since QGIS 1.8 took the rather boneheaded move of hiding all the plugin sources except the official one, here&#8217;s how to get the other repositories back: Consult the External Author Repositories list In QGIS, go to Plugins -&#62; Fetch Python &#8230; <a href="http://glaikit.org/2013/01/15/qgis-getting-your-clickfu-back/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://glaikit.org/2013/01/08/geouris-for-fun-and-profit/' rel='bookmark' title='GeoURIs for fun and profit'>GeoURIs for fun and profit</a> <small>Behold the GeoURI: geo:37.22976,-93.28663 It&#8217;s just a simple lat/long pair...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.
</div>
]]></description>
				<content:encoded><![CDATA[<p>Since QGIS 1.8 took the <a href="http://osgeo-org.1560.n6.nabble.com/Python-plugins-for-1-8-td4984257.html">rather boneheaded move of hiding all the plugin sources except the official one</a>, here&#8217;s how to get the other repositories back:</p>
<ul>
<li>Consult the <a href="http://hub.qgis.org/projects/quantum-gis/wiki/Python_Plugin_Repositories#External-Author-Repositories">External Author Repositories</a> list</li>
<li>In QGIS, go to Plugins -&gt; Fetch Python Plugins &#8230;, / Repositories, Add &#8230;, then add the name and URL, such as <a href="http://www.maths.lancs.ac.uk/~rowlings/Qgis/Plugins/plugins.xml">http://www.maths.lancs.ac.uk/~rowlings/Qgis/Plugins/plugins.xml</a></li>
</ul>
<p>Now you can add all the plugins!</p>
<p>ClickFu is kind of magic. It allows you to choose an online map service, click anywhere on your GIS viewport, and the correct location link opens in your browser. Very handy for sharing locations with people who don&#8217;t have a GIS setup. It properly takes coordinate reference systems into account, too, so no messing about with datum shifts and the like.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://glaikit.org/2013/01/08/geouris-for-fun-and-profit/' rel='bookmark' title='GeoURIs for fun and profit'>GeoURIs for fun and profit</a> <small>Behold the GeoURI: geo:37.22976,-93.28663 It&#8217;s just a simple lat/long pair...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2013/01/15/qgis-getting-your-clickfu-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeoURIs for fun and profit</title>
		<link>http://glaikit.org/2013/01/08/geouris-for-fun-and-profit/</link>
		<comments>http://glaikit.org/2013/01/08/geouris-for-fun-and-profit/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 12:55:20 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[geouri]]></category>
		<category><![CDATA[qrcode]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=820</guid>
		<description><![CDATA[Behold the GeoURI: geo:37.22976,-93.28663 It&#8217;s just a simple lat/long pair which some browsers (mostly mobile) will parse as locations. It probably won&#8217;t work in your desktop browser, but here&#8217;s an example as a link: Askinosie Chocolate — Springfield, MO. You &#8230; <a href="http://glaikit.org/2013/01/08/geouris-for-fun-and-profit/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p>Behold the <a href="https://www.ietf.org/rfc/rfc5870.txt">GeoURI</a>:</p>
<pre>geo:37.22976,-93.28663</pre>
<p>It&#8217;s just a simple lat/long pair which some browsers (mostly mobile) will parse as locations. It probably won&#8217;t work in your desktop browser, but here&#8217;s an example as a link: <a href="geo:37.22976,-93.28663">Askinosie Chocolate — Springfield, MO</a>.</p>
<p>You can encode case-insensitive URIs very efficiently as QR Codes. If you&#8217;re okay with ~10m resolution on your locations, you can make very tiny QR Codes indeed:</p>
<pre>qrencode -i -o Askinosie.png 'geo:37.2298,-93.2866'</pre>
<p><a href="http://glaikit.org/wp-content/uploads/2013/01/Askinosie.png"><img class="aligncenter size-full wp-image-821" alt="Askinosie location" src="http://glaikit.org/wp-content/uploads/2013/01/Askinosie.png" width="87" height="87" /></a>I&#8217;ve half a mind to make a little GPS-enable box that prints QR Code stickers with the current location, and the caption <strong>You are here</strong>.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2013/01/08/geouris-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Styling GeoBase land cover data</title>
		<link>http://glaikit.org/2012/11/18/styling-geobase-land-cover-data/</link>
		<comments>http://glaikit.org/2012/11/18/styling-geobase-land-cover-data/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 04:01:13 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[canada]]></category>
		<category><![CDATA[land_cover]]></category>
		<category><![CDATA[sld]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=803</guid>
		<description><![CDATA[GeoBase provides the free Land Cover, Circa 2000 &#8211; Vector product which contains 1:250,000 land cover categories (water, ice, crops, urban, trees, &#8230;) for all of Canada. It has some use in wind energy development, as you can use it &#8230; <a href="http://glaikit.org/2012/11/18/styling-geobase-land-cover-data/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://glaikit.org/2012/05/28/convert-manifold-aux-files-to-esri-world-files/' rel='bookmark' title='Convert Manifold aux files to ESRI world files'>Convert Manifold aux files to ESRI world files</a> <small>The great thing about geospatial metadata standards is that there...</small></li>
<li><a href='http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/' rel='bookmark' title='Awesome USGS orthoimagery &#8230; in Canada?'>Awesome USGS orthoimagery &#8230; in Canada?</a> <small>Detail of Erie Shores Wind Farm showing USGS orthophotos from...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.
</div>
]]></description>
				<content:encoded><![CDATA[<p>GeoBase provides the free <a href="http://www.geobase.ca/geobase/en/data/landcover/index.html">Land Cover, Circa 2000 &#8211; Vector</a> product which contains 1:250,000 land cover categories (water, ice, crops, urban, trees, &#8230;) for all of Canada. It has some use in wind energy development, as you can use it to classify the <a href="https://en.wikipedia.org/wiki/Roughness_length">roughness length</a> of terrain for flow modelling.</p>
<p>The data are provided as very large shape files, indexed by National Topographic System (NTS) codes. These aren&#8217;t the easiest to remember, so I keep finding myself going back to the <a href="http://geogratis.cgdi.gc.ca/geogratis/en/option/select.do?id=FF31D53A-32E6-61CF-B61A-8387737A45DA">Vector Indexes of the National Topographi</a><a href="http://geogratis.cgdi.gc.ca/geogratis/en/option/select.do?id=FF31D53A-32E6-61CF-B61A-8387737A45DA">c System of Canada</a>, especially the handy Google Earth version. Toronto is in NTS 030M, so I downloaded that. Here is what a cropped part looks like loaded over the local Toporama WMS tiles:</p>
<p><a href="http://glaikit.org/wp-content/uploads/2012/11/blort.jpg"><img class="aligncenter size-medium wp-image-804" title="an ugly blort of khaki unclassified land cover data" src="http://glaikit.org/wp-content/uploads/2012/11/blort-512x362.jpg" alt="" width="512" height="362" /></a></p>
<p>The fun stuff is hidden in the attribute table:</p>
<p><a href="http://glaikit.org/wp-content/uploads/2012/11/Screen-Shot-2012-11-18-at-22.43.40-.png"><img class="aligncenter size-medium wp-image-805" title="land cover attributes" src="http://glaikit.org/wp-content/uploads/2012/11/Screen-Shot-2012-11-18-at-22.43.40--512x323.png" alt="" width="512" height="323" /></a>So the COVTYPE field is clearly holding something about the land cover type. But what?</p>
<p>GeoBase helpfully <a href="http://www.geobase.ca/geobase/en/data/landcover/csc2000v/utilisation.html">provide</a> a <a title="Importing a symbology to a Land Cover dataset with ArcGIS. Guide to import, 2009-09-01" href="&lt;a href=&quot;http://www.geobase.ca/doc/specs/pdf/GeoBase_LCC2000V_Guide_import_symbology.pdf&quot;&gt;pdf&lt;/a&gt;">PDF key</a> and a style file — which <em>only</em> works with ArcGIS products. As a dedicated (okay, yes, <em>cheap</em>) user of Open GIS systems, this could not stand! So I dug through the <a href="http://www.opengeospatial.org/standards/sld">Styled Layer Descriptor</a> (SLD) format, and came up with style files (in both English &amp; French) that work with QGIS: <a href="http://glaikit.org/wp-content/uploads/2010/03/SLD_LCC2000-V-en_CSC2000-V-fr.zip">SLD_LCC2000-V-en_CSC2000-V-fr.zip</a>.</p>
<p>To use them with QGIS, open up the layer properties, and go to the <em>Style</em> tab. You want to use the <em>New Symbology</em> option, then <em>Load Style &#8230;</em> From here, you can open the SLD file (changing the file type from QGIS&#8217;s default QML to SLD), which should appear like this:</p>
<p><a href="http://glaikit.org/wp-content/uploads/2012/11/Screen-Shot-2012-11-18-at-22.54.55-.png"><img class="aligncenter size-medium wp-image-806" title="SLD style attributes" src="http://glaikit.org/wp-content/uploads/2012/11/Screen-Shot-2012-11-18-at-22.54.55--499x512.png" alt="" width="499" height="512" /></a>This makes the layer look much better:</p>
<p><a href="http://glaikit.org/wp-content/uploads/2012/11/better.jpg"><img class="aligncenter size-medium wp-image-807" title="much better colour" src="http://glaikit.org/wp-content/uploads/2012/11/better-512x362.jpg" alt="" width="512" height="362" /></a></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://glaikit.org/2012/05/28/convert-manifold-aux-files-to-esri-world-files/' rel='bookmark' title='Convert Manifold aux files to ESRI world files'>Convert Manifold aux files to ESRI world files</a> <small>The great thing about geospatial metadata standards is that there...</small></li>
<li><a href='http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/' rel='bookmark' title='Awesome USGS orthoimagery &#8230; in Canada?'>Awesome USGS orthoimagery &#8230; in Canada?</a> <small>Detail of Erie Shores Wind Farm showing USGS orthophotos from...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/11/18/styling-geobase-land-cover-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making weird composite shapes with Shapely</title>
		<link>http://glaikit.org/2012/10/29/making-weird-composite-shapes-with-shapely/</link>
		<comments>http://glaikit.org/2012/10/29/making-weird-composite-shapes-with-shapely/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 01:05:51 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[canwea]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[microwave]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rabc]]></category>
		<category><![CDATA[shapely]]></category>
		<category><![CDATA[windfarm]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=786</guid>
		<description><![CDATA[Let&#8217;s say you operate microwave radio links, and you want to see if you could build a link between, say, the huge comms tower at Clear Creek, ON and your tower just south of Aylmer. You know that Erie Shores &#8230; <a href="http://glaikit.org/2012/10/29/making-weird-composite-shapes-with-shapely/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p>Let&#8217;s say you operate microwave radio links, and you want to see if you could build a link between, say, the huge comms tower at Clear Creek, ON and your tower just south of Aylmer. You know that <a href="http://www.erieshores.ca/">Erie Shores Wind Farm</a> is in the middle of the route. Do the 77m diameter turbines attenuate your signal to nothing?</p>
<p style="text-align: center;"><a href="http://glaikit.org/wp-content/uploads/2012/10/mwpath.jpg"><img class="size-medium wp-image-787 aligncenter" title="microwave path" src="http://glaikit.org/wp-content/uploads/2012/10/mwpath-512x362.jpg" alt="" width="512" height="362" /></a></p>
<p>This is a real issue I have to deal with every day, except in reverse: when I&#8217;m planning wind farms, I don&#8217;t want to be blocking existing licensed links. I use <a href="http://www.ic.gc.ca/eic/site/sd-sd.nsf/eng/Home">Spectrum Direct</a> to find these links (and precisely two years ago, I showed you how to <a href="http://glaikit.org/2010/10/29/got-a-receiver-inside-my-head-writing-spectrum-direct-data-as-csv/">write Spectrum Direct data as CSV</a>), but up until now I worked out affected zones (called &#8220;consultation zones&#8221;) by hand.</p>
<p>The <a href="http://www2.rabc-cccr.ca/home.cfm">Radio Advisory Board of Canada</a> and the <a href="http://www.canwea.ca/">Canadian Wind Energy Association</a> developed a joint protocol on sizing consultation zone for wind turbines, documented in the <a href="http://www2.rabc-cccr.ca/Files/RABC%20CANWEA%20Guidelines%2Epdf">RABC CANWEA Guidelines</a>. The one for a microwave link comprises:</p>
<ul>
<li>A 1km buffer around the start and end points of the link;</li>
<li>A distance-, frequency- and wind-turbine diameter-specific path width between the points.</li>
</ul>
<p>Here I&#8217;m only going to consider the 2D geometry of the path. Lots of people in the radio industry get paid money to do line-of-sight terrain analysis, and I&#8217;m ignoring this for now. All I&#8217;m doing here is using Python&#8217;s <a href="http://toblerity.github.com/shapely/manual.html">Shapely</a> library to make the dumb-bell shaped buffer around the path and endpoints. I learned of Shapely from Erik Westra&#8217;s book <a href="http://www.packtpub.com/python-geospatial-development/book">Python Geospatial Development</a>. Here&#8217;s some code that outputs pipe-separated <a href="http://docs.geotools.org/stable/javadocs/org/opengis/referencing/doc-files/WKT.html">well-known text</a> that imports nicely into QGIS:</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Calculate RABC/CanWEA Microwave Link Consultation Zone
# scruss - 2012-10-29

import pyproj
import shapely.geometry
from shapely.wkt import dumps

# hard-coded details (sorry)
startlat = 42.582892  # Clear Creek
startlong = -80.603875
endlat = 42.731776  # South Aylmer
endlong = -80.98768
frequency = 6e9  # 6 GHz
rotor = 77.0  # wtg rotor diameter, m

# calculate distance between points
g = pyproj.Geod(ellps='WGS84')
(az12, az21, dist) = g.inv(startlong, startlat, endlong, endlat)

# Width of microwave link fresnel zone
Lc = rotor + 52 * ((dist / 1000) / (frequency / 1e9)) ** 0.5

# calculate line string along path with segments &lt;= 1 km
lonlats = g.npts(startlong, startlat, endlong, endlat,
                 1 + int(dist / 1000))

# npts doesn't include start/end points, so prepend/append them
lonlats.insert(0, (startlong, startlat))
lonlats.append((endlong, endlat))

# translate line string into projected coordinates
utms = []
srcp = pyproj.Proj(init='epsg:4326')  # WGS84
destp = pyproj.Proj(init='epsg:32617')  # WGS84 UTM Zone 17N
for (lon, lat) in lonlats:
    (utmx, utmy) = pyproj.transform(srcp, destp, lon, lat)
    utms.append((utmx, utmy))

# turn start and end points into Shapely point objects
startpt = shapely.geometry.Point(utms[0])
endpt = shapely.geometry.Point(utms[-1])

# draw a 1km buffer around start/end points
startb = startpt.buffer(1000)
endb = endpt.buffer(1000)

# convert microwave path to a Shapely LineString
path = shapely.geometry.LineString(utms)
pathb = path.buffer(Lc / 2) # buffer it to fresnel zone width

# join the buffers into one shape
zone = startb.union(pathb).union(endb)

# output the shape as well known text
print 'id|wkt'
print '|'.join(('1', dumps(zone)))
</pre>
<p>That little snippet creates the buffer in projected coordinates from two geographic coordinates as inputs. Grabbing the Erie Shores coordinates from OpenStreetMap and the <a href="http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/" target="_blank">USGS WMS</a>, let&#8217;s see if the beam will pass:</p>
<p><a href="http://glaikit.org/wp-content/uploads/2012/10/blockedmwpath.jpg"><img class="aligncenter size-medium wp-image-791" title="blockedmwpath" src="http://glaikit.org/wp-content/uploads/2012/10/blockedmwpath-512x362.jpg" alt="" width="512" height="362" /></a></p>
<p>Uh, no. That&#8217;s three turbines in the path in that little section alone. Back to the drawing board.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/10/29/making-weird-composite-shapes-with-shapely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Invisible City</title>
		<link>http://glaikit.org/2012/10/21/the-invisible-city/</link>
		<comments>http://glaikit.org/2012/10/21/the-invisible-city/#comments</comments>
		<pubDate>Sun, 21 Oct 2012 14:49:15 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[canada]]></category>
		<category><![CDATA[osm]]></category>
		<category><![CDATA[vandalism]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=771</guid>
		<description><![CDATA[There&#8217;s not a whole lot north of North Bay. Highway 11 winds through some extensive geometry, but few habitations. Until something wonderful (and quite a bit wrong) happened at 46° 31&#8242; 21&#8243; N, 79° 33&#8242; 9&#8243; W on OpenStreetMap. A &#8230; <a href="http://glaikit.org/2012/10/21/the-invisible-city/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/' rel='bookmark' title='Awesome USGS orthoimagery &#8230; in Canada?'>Awesome USGS orthoimagery &#8230; in Canada?</a> <small>Detail of Erie Shores Wind Farm showing USGS orthophotos from...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.
</div>
]]></description>
				<content:encoded><![CDATA[<div id="attachment_773" class="wp-caption alignleft" style="width: 170px"><a href="http://glaikit.org/wp-content/uploads/2012/10/1.jpg"><img class="size-thumbnail wp-image-773" title="Now you see it ..." src="http://glaikit.org/wp-content/uploads/2012/10/1-160x160.jpg" alt="" width="160" height="160" /></a><p class="wp-caption-text">Now you see it &#8230;</p></div>
<p style="text-align: left;">There&#8217;s not a whole lot north of North Bay. Highway 11 winds through some extensive geometry, but few habitations. Until something wonderful (and quite a bit wrong) happened at <a href="http://www.openstreetmap.org/?lat=46.5224969387054&amp;lon=-79.5525169372559&amp;zoom=14"><em>46° 31&#8242; 21&#8243; N, 79° 33&#8242; 9&#8243; W</em></a> on <a href="http://openstreetmap.org/">OpenStreetMap</a>. A whole new town about 25 minutes out of North Bay sprung up overnight — and was as quickly deleted as mappers caught and reverted the vandalism.</p>
<div id="attachment_772" class="wp-caption alignright" style="width: 170px"><a href="http://glaikit.org/wp-content/uploads/2012/10/2.jpg"><img class="size-thumbnail wp-image-772" title="Now you don't." src="http://glaikit.org/wp-content/uploads/2012/10/2-160x160.jpg" alt="" width="160" height="160" /></a><p class="wp-caption-text">Now you don&#8217;t.</p></div>
<p style="text-align: left;">The misguided mapper put quite a lot of work into this ephemeral town. It&#8217;s got urban rail, parklands, residential areas and more. You can see the detail on this <a href="http://glaikit.org/wp-content/uploads/2012/10/visible_city.png">large image of the town</a> (650 KB PNG). If you want to play with the data, here&#8217;s a <a href="http://glaikit.org/wp-content/uploads/2012/10/invisible_city.zip">zipped OSM XML file</a> of the area before it was reverted. But please, don&#8217;t re-upload it; OpenStreetMap should be for real features on the ground, and not for confusing map data consumers.</p>
<p style="text-align: left;">Thanks to <a href="http://www.openstreetmap.org/user/Bootprint">Bootprint</a> for noticing this, and to <a href="http://www.openstreetmap.org/user/rw__">rw__</a> for reverting the edits.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/' rel='bookmark' title='Awesome USGS orthoimagery &#8230; in Canada?'>Awesome USGS orthoimagery &#8230; in Canada?</a> <small>Detail of Erie Shores Wind Farm showing USGS orthophotos from...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/10/21/the-invisible-city/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awesome USGS orthoimagery &#8230; in Canada?</title>
		<link>http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/</link>
		<comments>http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/#comments</comments>
		<pubDate>Sat, 11 Aug 2012 15:27:22 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[canada]]></category>
		<category><![CDATA[orthophotos]]></category>
		<category><![CDATA[osm]]></category>
		<category><![CDATA[USGS]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=752</guid>
		<description><![CDATA[Detail of Erie Shores Wind Farm showing USGS orthophotos from WMS I was trying to do some OpenStreetMap edits in rural southern Ontario, but the default Bing background aerial imagery is very poor. Clicking around in semi-plokta mode to find &#8230; <a href="http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://glaikit.org/wp-content/uploads/2012/08/eswf_detail.jpg"><img class="aligncenter size-medium wp-image-753" title="erie shores wind farm detail" src="http://glaikit.org/wp-content/uploads/2012/08/eswf_detail-512x362.jpg" alt="" width="512" height="362" /></a></p>
<p style="text-align: center;"><em><a href="http://www.openstreetmap.org/?box=yes&amp;bbox=-80.7301230,42.6243255,-80.7130678,42.6364099">Detail</a> of <a href="http://www.erieshores.ca/">Erie Shores Wind Farm</a> showing <a href="http://www.usgs.gov/">USGS</a> orthophotos from <a href="http://raster.nationalmap.gov/ArcGIS/services/TNM_Large_Scale_Imagery/MapServer/WMSServer?request=GetCapabilities&amp;service=WMS">WMS</a></em></p>
<p>I was trying to do some <a href="http://www.openstreetmap.org/">OpenStreetMap</a> edits in rural southern Ontario, but the default Bing background aerial imagery is very poor. Clicking around in semi-<abbr title="Press Lots Of Keys To Abort">plokta</abbr> mode to find better images, I happened upon &#8220;OSM US USGS Large Scale Aerial Imagery&#8221;, which loaded up some beautiful and recent pictures. I guess that since we&#8217;re close to the border, the USGS doesn&#8217;t bother to trim its images too close.</p>
<p><a href="http://www.openstreetmap.org/user/iandees">Ian Dees</a>, who admins the particular OSM server, confirmed that these are from <a href="http://nationalmap.gov/">The National Map</a>&#8216;s <a href="http://raster.nationalmap.gov/ArcGIS/rest/services/TNM_Large_Scale_Imagery/MapServer">TNM_Large_Scale_Imagery</a> service; thanks, Ian! These images are at least as good for my purposes as the <a href="http://www.swoop2010.ca/">SWOOP</a> data — except not $50/km2, and without elaborate usage restrictions.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/08/11/awesome-usgs-orthoimagery-in-canada/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mephisto&#8217;s Oriental Mystery — solved!</title>
		<link>http://glaikit.org/2012/08/03/mephistos-oriental-mystery-solved/</link>
		<comments>http://glaikit.org/2012/08/03/mephistos-oriental-mystery-solved/#comments</comments>
		<pubDate>Sat, 04 Aug 2012 03:02:20 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[garmin]]></category>
		<category><![CDATA[shoes]]></category>
		<category><![CDATA[wat]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=745</guid>
		<description><![CDATA[I bought a pair of Mephisto shoes today, and to go with their wayfaring imagery, the insoles are decked out with map-like symbols. Prominent is a map coordinate: N 38° 51.343&#8242; E 94° 47.963&#8242;. If you look at a map &#8230; <a href="http://glaikit.org/2012/08/03/mephistos-oriental-mystery-solved/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://glaikit.org/wp-content/uploads/2012/08/09874b5edddc11e1a9be22000a1e8b1a_7.jpg"><img class="aligncenter size-full wp-image-746" title="mephisto allrounder insole with coordinate 38° 51.343' N, 94° 47.963' E" src="http://glaikit.org/wp-content/uploads/2012/08/09874b5edddc11e1a9be22000a1e8b1a_7.jpg" alt="" width="612" height="612" /></a></p>
<p>I bought a pair of <a href="http://www.mephisto.com/en">Mephisto</a> shoes today, and to go with their wayfaring imagery, the insoles are decked out with map-like symbols. Prominent is a map coordinate: <a href="http://www.openstreetmap.org/?lat=38.855717&amp;lon=94.799383&amp;zoom=11&amp;layers=M">N 38° 51.343&#8242; E 94° 47.963&#8242;</a>.</p>
<p>If you look at a map there, it&#8217;s a <a href="http://www.bing.com/maps/?v=2&amp;cp=38.855740~94.799383&amp;lvl=10&amp;dir=0&amp;sty=h&amp;where1=38.8557166666667%2C%2094.7993833333333&amp;form=LMLTCC">fairly empty mountainous place</a> near the border of Qinghai and Gansu. It&#8217;s definitely not where the shoes are made, unless Mephisto have a stealth factory there.</p>
<p>There was something familiar about the coordinate, through. I thought I&#8217;d try flipping it to the western hemisphere:</p>
<p><a href="http://www.openstreetmap.org/?lat=38.855717&amp;lon=-94.799383&amp;zoom=11&amp;layers=M"><img class="aligncenter size-full wp-image-747" title="openstreetmap image of 38° 51.343' N, 94° 47.963' W" src="http://glaikit.org/wp-content/uploads/2012/08/map-2.png" alt="" width="632" height="511" /></a></p>
<p>It&#8217;s the <a href="http://www.garmin.com/us/">Garmin</a> headquarters in Olathe, KS! Every Garmin GPS I&#8217;ve ever owned has had the HQ as a default waypoint. I&#8217;m guessing a designer at Mephisto was looking to add something legitimately mappy to the graphics, and picked up their satnav to pull out a coordinate. Guessing that <a href="http://www.olatheks.org/">Olathe</a> isn&#8217;t a very mysterious, rugged destination, they flipped the hemisphere to give it more eastern promise.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/08/03/mephistos-oriental-mystery-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Manifold aux files to ESRI world files</title>
		<link>http://glaikit.org/2012/05/28/convert-manifold-aux-files-to-esri-world-files/</link>
		<comments>http://glaikit.org/2012/05/28/convert-manifold-aux-files-to-esri-world-files/#comments</comments>
		<pubDate>Mon, 28 May 2012 17:15:03 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[bitmap]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[manifold]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[wld]]></category>
		<category><![CDATA[world]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=712</guid>
		<description><![CDATA[The great thing about geospatial metadata standards is that there are so many to choose from. When slinging files about from user to user, it seems that mostly the ESRI stuff (well, the stuff we can pick apart, anyway) is &#8230; <a href="http://glaikit.org/2012/05/28/convert-manifold-aux-files-to-esri-world-files/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p>The great thing about geospatial metadata standards is that there are so many to choose from.  When slinging files about from user to user, it seems that mostly the ESRI stuff (well, the stuff we can pick apart, anyway) is used, plus some sedimentary layers deposited as good ideas from other systems. Commercial GIS systems are much less liberal, because all of them have the inertia of user investment.</p>
<p><a href="http://www.manifold.net/">Manifold</a> does things its own way. Rather than using broadly standard <a href="http://hub.qgis.org/wiki/17/Getting_Started_with_CRS_and_Projections">prj</a> or <a href="https://en.wikipedia.org/wiki/World_file">wld</a> files, Manifold accompanies every exported file with an XML metafile in its own format. I get sent a lot of bitmaps from Manifold, and if I want to do more than view them on the screen, I need to convert the metadata.</p>
<p>Below is a small Awk program to convert a Manifold XML metadata file for a bitmap into an ESRI World file:</p>
<pre class="brush: plain; title: ; notranslate">
#!/bin/awk -f
# convert Manifold xml metadata to ESRI world file
# nb: this is not a general-purpose XML parser
# scruss - 20120508

BEGIN {
    indata = 0;
}

/&lt;coordinateSystem&gt;/ {
    indata = 1;			# in metadata section of file
}

/&lt;\/coordinateSystem&gt;/ {
    indata = 0;			# no longer in metadata
}

/&lt;/ &amp;&amp; (indata == 1) {
    # build array of items
    sub(/&lt;\/[^&gt;]*&gt;/, &quot;&quot;, $0);	# remove end tag
    tagloc=match($0, /&lt;[^&gt;]*&gt;/);
    if ((RSTART == 0) &amp;&amp; (RLENGTH == -1)) { 
	# no match!
    }
    else {
	tag=substr($0, RSTART, RLENGTH);
	sub(/&lt;/, &quot;&quot;, tag);	# remove &lt; and &gt; from tag
	sub(/&gt;/, &quot;&quot;, tag);
	value=substr($0, RSTART + RLENGTH); # value is rest of string
	params[tag] = value;
    }
}

END {
    # output six values for ESRI world file
    # all the &quot;+ 0.0&quot; stuff is just to force numeric output
    OFMT=&quot;%.10f&quot;;
    print params[&quot;localScaleX&quot;] + 0.0;
    print params[&quot;rotationX&quot;] + 0.0; # these will almost always be zero
    print params[&quot;rotationY&quot;] + 0.0;
    print (params[&quot;localScaleY&quot;] + 0.0) * -1.0; # negate Manifold value
    print params[&quot;localOffsetX&quot;] + 0.0;
    print params[&quot;localOffsetY&quot;] + 0.0;
}
</pre>
<p>Note that I&#8217;m doing what you&#8217;re supposed never to do&nbsp;&mdash; parse XML as if it were just some text format. If Manifold change their file format even slightly, this program will fail. The above seems to work on all the data I&#8217;ve thrown at it, although none of those test files included rotation terms. I don&#8217;t think I&#8217;ve ever actually seen a world file with rotation defined, so this may be a minor limitation.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/05/28/convert-manifold-aux-files-to-esri-world-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>geocoder.ca&#8217;s excellent database</title>
		<link>http://glaikit.org/2012/04/15/geocoder-cas-excellent-database/</link>
		<comments>http://glaikit.org/2012/04/15/geocoder-cas-excellent-database/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 17:37:54 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[canada]]></category>
		<category><![CDATA[odbl]]></category>
		<category><![CDATA[ogr]]></category>
		<category><![CDATA[postal codes]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shapefile]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=703</guid>
		<description><![CDATA[geocoder.ca provides a crowdsourced postal code geocoder under the ODbL. You can download the database as CSV directly. Here&#8217;s a bash script to convert that text file into a (very large) point shapefile: Though the script is a bit Unix-centric, &#8230; <a href="http://glaikit.org/2012/04/15/geocoder-cas-excellent-database/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://geocoder.ca/">geocoder.ca</a> provides a crowdsourced postal code geocoder under the ODbL. You can <a href="http://geocoder.ca/?freedata=1#postal">download</a> the database as CSV directly. Here&#8217;s a bash script to convert that text file into a (very large) point shapefile:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
# geocoder2shp.sh - convert geocoder.ca CSV to a shape file
# NB: input CSV is UTF-8; it is passed through unchanged
# Needs &gt;= v1.7 of GDAL
# scruss - 2012/04/15

if [ ! -f Canada.csv.gz ]
then
    echo &quot;&quot;
    echo &quot; &quot; Download \&quot;Canada.csv.gz\&quot; into the current directory from
    echo &quot;  &quot; http://geocoder.ca/onetimedownload/Canada.csv.gz
    echo &quot; &quot; and try again.
    echo &quot;&quot;
    exit 1
fi

# make input file with header
echo PostalCode,Latitude,Longitude,City,Province &gt; Canada2.csv
gunzip -c Canada.csv.gz &gt;&gt; Canada2.csv

# create GDAL VRT file
cat &gt; Canada2.vrt &lt;&lt;EOF
&lt;OGRVRTDataSource&gt;
  &lt;!-- note that OGRVRTLayer name must be basename of source file --&gt;
  &lt;OGRVRTLayer name=&quot;Canada2&quot;&gt;
    &lt;SrcDataSource&gt;Canada2.csv&lt;/SrcDataSource&gt;
    &lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;
    &lt;LayerSRS&gt;EPSG:4326&lt;/LayerSRS&gt;
    &lt;GeometryField encoding=&quot;PointFromColumns&quot; x=&quot;Longitude&quot; y=&quot;Latitude&quot;/&gt;
    &lt;Field name=&quot;PostalCode&quot; type=&quot;String&quot; width=&quot;6&quot; /&gt;
    &lt;Field name=&quot;Latitude&quot; type=&quot;Real&quot; /&gt;
    &lt;Field name=&quot;Longitude&quot; type=&quot;Real&quot; /&gt;
    &lt;Field name=&quot;City&quot; type=&quot;String&quot; width=&quot;60&quot; /&gt;
    &lt;Field name=&quot;Province&quot; type=&quot;String&quot; width=&quot;2&quot; /&gt;
  &lt;/OGRVRTLayer&gt;
&lt;/OGRVRTDataSource&gt;
EOF

# create shapefile
ogr2ogr PostalCodes.shp Canada2.vrt

# clean up
rm -f Canada2.csv	Canada2.vrt
</pre>
<p>Though the script is a bit Unix-centric, it&#8217;s just a simple list of instructions which could be run on any command line. What it does is add some headers to the geocoder.ca file, then sets up an OGR <a href="http://www.gdal.org/ogr/drv_vrt.html">Virtual Format</a> to convert the text into a fairly well-defined shapefile. When you use this shapefile, you should credit geocoder.ca as the ODbL requires.</p>
<p>Eek! <a href="http://geocoder.ca/?sued=1">geocoder.ca has been sued by Canada Post</a>! (News responses: <a href="http://www.michaelgeist.ca/content/view/6415/125/">Michael Geist</a>, <a href="http://boingboing.net/2012/04/13/canada-post-sues-crowdsourced.html">Boing Boing</a>, <a href="http://www.cbc.ca/news/technology/story/2012/04/13/technology-canada-post-postal-code-copyright.html">CBC</a>) I&#8217;ve donated to defend this useful service.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/04/15/geocoder-cas-excellent-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Georeferencing QGIS output rasters</title>
		<link>http://glaikit.org/2012/04/05/georeferencing-qgis-output-rasters/</link>
		<comments>http://glaikit.org/2012/04/05/georeferencing-qgis-output-rasters/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 04:49:03 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[georeference]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[qgis]]></category>
		<category><![CDATA[raster]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=698</guid>
		<description><![CDATA[Some of the design packages I rely on use very crude GIS facilities. In fact, all they can support is a georeferenced raster as a background image, so it&#8217;s more of a rough map than GIS. It helps if these &#8230; <a href="http://glaikit.org/2012/04/05/georeferencing-qgis-output-rasters/">Continue reading <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p>Some of the design packages I rely on use very crude GIS facilities. In fact, all they can support is a georeferenced raster as a background image, so it&#8217;s more of a rough map than GIS. It helps if these rasters are at a decent resolution, typically 1m/pixel or better.</p>
<p>A while back, I <a href="http://forum.qgis.org/viewtopic.php?f=2&amp;t=6045&amp;p=10338&amp;hilit=scruss&amp;sid=951ab6b0dee051719866ac477c5fa9bf#p10335">asked</a> on the QGIS forum if the package could output high resolution georeferenced rasters. I received a rather terse response that no, it couldn&#8217;t (and I inferred from the tone that the poster thought that it shouldn&#8217;t, and I was wrong to want such a thing). I shelved the idea at the time.</p>
<p>After having to fix a lot of paths in a QGIS project file I&#8217;d moved to a new system, I noticed that all the map composer attributes are rather neatly defined in the XML file structure. Some messing around with Perl, <a href="http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm">XML::Simple</a> and <a href="http://search.cpan.org/~ovid/Data-Dumper-Simple-0.11/lib/Data/Dumper/Simple.pm">Data::Dumper::Simple</a>, and I had a little script that would spit out an ESRI World File for the map composer raster defined in the project.</p>
<p>To run this, you have to create a project with just one Print Composer page, save the composed map as an image, save the project, then run the script like this:</p>
<pre>
./geoprint.pl project.qgs &gt; image.pngw
</pre>
<p>There are some caveats:</p>
<ul>
<li>This probably won&#8217;t work for projects with multiple print composers</li>
<li>It doesn&#8217;t quite get the scale right, but it&#8217;s within a pixel or so. I may not have corrected for image borders.</li>
</ul>
<p>Though there&#8217;s some fairly hideous XML-mungeing in the code, what the script does is entirely trivial. If you feel you can use it, good; if you feel you can improve it, be my guest.</p>
<pre class="brush: perl; title: ; notranslate">
#!/usr/bin/perl -w
# geoprint - georef a QGIS output image by creating a world file
# one arg: qgis project file (xml)
# $Id: geoprint.pl,v 1.3 2012/04/06 03:32:01 scruss Exp $

use strict;
use XML::Simple;
use constant MM_PER_INCH =&gt; 25.4;

my $qgis = $ARGV[0];
die &quot;$qgis must exist\n&quot; unless ( -f $qgis );

my $q = XMLin($qgis) or die &quot;$!\n&quot;;
my %composer = %{ $q-&gt;{Composer} };
my $image_width =
  int( $composer{Composition}-&gt;{paperWidth} *
    $composer{Composition}-&gt;{printResolution} /
    MM_PER_INCH );
my $image_height =
  int( $composer{Composition}-&gt;{paperHeight} *
    $composer{Composition}-&gt;{printResolution} /
    MM_PER_INCH );

# we need xpixelsize, ypixelsize, ulx and uly
my $xpixelsize =
  ( $composer{ComposerMap}-&gt;{Extent}-&gt;{xmax} -
    $composer{ComposerMap}-&gt;{Extent}-&gt;{xmin} ) /
  int( $composer{ComposerMap}-&gt;{ComposerItem}-&gt;{width} *
    $composer{Composition}-&gt;{printResolution} /
    MM_PER_INCH );
my $ypixelsize =
  -1.0 *
  ( $composer{ComposerMap}-&gt;{Extent}-&gt;{ymax} -
    $composer{ComposerMap}-&gt;{Extent}-&gt;{ymin} ) /
  int( $composer{ComposerMap}-&gt;{ComposerItem}-&gt;{height} *
    $composer{Composition}-&gt;{printResolution} /
    MM_PER_INCH );
my $ulx =
  $composer{ComposerMap}-&gt;{Extent}-&gt;{xmin} -
  $xpixelsize *
  int( $composer{ComposerMap}-&gt;{ComposerItem}-&gt;{x} *
    $composer{Composition}-&gt;{printResolution} /
    MM_PER_INCH ) - $xpixelsize;
my $uly =
  $composer{ComposerMap}-&gt;{Extent}-&gt;{ymax} -
  $ypixelsize *
  int( $composer{ComposerMap}-&gt;{ComposerItem}-&gt;{y} *
    $composer{Composition}-&gt;{printResolution} /
    MM_PER_INCH ) - $ypixelsize;

printf( &quot;%.12f\n%.12f\n%.12f\n%.12f\n%.12f\n%.12f\n&quot;,
  $xpixelsize, 0.0, 0.0, $ypixelsize, $ulx, $uly );

# FIXME? pixel scale seems a tiny bit off - allow for border?
exit;
</pre>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2012/04/05/georeferencing-qgis-output-rasters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.686 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-24 16:27:44 -->
