<?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>Scott Ellington's Blog</title>
	<atom:link href="http://www.salmonsalvo.net/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.salmonsalvo.net/blog</link>
	<description></description>
	<lastBuildDate>Mon, 23 Aug 2010 12:46:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>complex line symbols with cumberland</title>
		<link>http://www.salmonsalvo.net/blog/?p=223</link>
		<comments>http://www.salmonsalvo.net/blog/?p=223#comments</comments>
		<pubDate>Sun, 07 Jun 2009 03:18:47 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=223</guid>
		<description><![CDATA[Back in the day, when I was writing some awesome ArcIMS app, I could create some elaborate line symbology in ArcXML:


...
&#160; &#160; &#160; &#60;LAYER type=&#34;featureclass&#34; name=&#34;ROADS&#34; visible=&#34;true&#34; id=&#34;2&#34;&#62;
&#160; &#160; &#160; &#160; &#60;DATASET name=&#34;ROADS&#34; type=&#34;line&#34; workspace=&#34;shp_ws-0&#34; /&#62;
&#160; &#160; &#160; &#160; &#60;GROUPRENDERER&#62;
&#160; &#160; &#160; &#160; &#160; &#60;SIMPLERENDERER&#62;
&#160; &#160; &#160; &#160; &#160; &#160; &#60;SIMPLELINESYMBOL transparency=&#34;1.0&#34; type=&#34;solid&#34; width=&#34;8&#34; captype=&#34;round&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Back in the day, when I was writing some awesome ArcIMS app, I could create some elaborate line symbology in ArcXML:</p>
<div class="syntax_hilite">
<div id="xml-3">
<div class="xml xml" style="font-family:monospace;">...<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LAYER</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;featureclass&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ROADS&quot;</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DATASET</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ROADS&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;line&quot;</span> <span style="color: #000066;">workspace</span>=<span style="color: #ff0000;">&quot;shp_ws-0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;GROUPRENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SIMPLERENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SIMPLELINESYMBOL</span> <span style="color: #000066;">transparency</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;solid&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #000066;">captype</span>=<span style="color: #ff0000;">&quot;round&quot;</span> <span style="color: #000066;">jointype</span>=<span style="color: #ff0000;">&quot;round&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;0,0,0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SIMPLERENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SIMPLERENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SIMPLELINESYMBOL</span> <span style="color: #000066;">transparency</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;solid&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;6&quot;</span> <span style="color: #000066;">captype</span>=<span style="color: #ff0000;">&quot;round&quot;</span> <span style="color: #000066;">jointype</span>=<span style="color: #ff0000;">&quot;round&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;255,0,0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SIMPLERENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SIMPLERENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SIMPLELINESYMBOL</span> <span style="color: #000066;">transparency</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;solid&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">captype</span>=<span style="color: #ff0000;">&quot;round&quot;</span> <span style="color: #000066;">jointype</span>=<span style="color: #ff0000;">&quot;round&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;255,255,255&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SIMPLERENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/GROUPRENDERER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LAYER<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
...</div>
</div>
</div>
<p>
(<a href="http://edndoc.esri.com/arcims/9.0/">source</a>)</p>
<p>What's nice about this is that it is all built into a single layer element.  Now, you can't do this directly in cumberland map xml, but you can still achieve much of this functionality.  The trick is to just duplicate the layer using different symbology:</p>
<div class="syntax_hilite">
<div id="xml-4">
<div class="xml xml" style="font-family:monospace;">...<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Layer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--Interstates 1--&gt;</span><br />
&nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Styles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Simplify<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Simplify<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SimplifyTolerance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>200<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SimplifyTolerance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MaxScale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>399<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/MaxScale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LineColor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>255,155,56,0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LineColor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LineWidth<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LineWidth<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Styles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Layer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Layer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--Interstates 2--&gt;</span><br />
&nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Styles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ShowLabels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ShowLabels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LabelPixelOffset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LabelPixelOffset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LabelFont<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SansSerif<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LabelFont<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LabelFontEmSize<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LabelFontEmSize<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DrawPointSymbolOnPolyLine<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DrawPointSymbolOnPolyLine<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CalculateLabelAngleForPolyLine<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CalculateLabelAngleForPolyLine<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PointSymbol<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Image<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PointSymbol<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PointSize<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>15<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PointSize<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;FillColor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>255,255,0,0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/FillColor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PointSymbolImagePath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>images/interstate.png<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PointSymbolImagePath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Simplify<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Simplify<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SimplifyTolerance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>200<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SimplifyTolerance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;MaxScale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>399<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/MaxScale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LineColor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>255,255,156,0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LineColor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LineWidth<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LineWidth<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Styles<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Layer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
...</div>
</div>
</div>
<p></p>
<p>This draws the layer twice, giving us our complex symbol effect:</p>
<p><div id="attachment_231" class="wp-caption alignnone" style="width: 266px"><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2009/06/9.png" alt="complex line symbols" title="linesymbols" width="256" height="256" class="size-full wp-image-231" /><p class="wp-caption-text">complex line symbols</p></div></p>
<p>There are additional variations that could be done with this, such as drawing a dashed/dotted line on top of a solid line and so forth.  Full demo and source of this map is <a href="http://salmonsalvo.net/Cumberland:_BaseMap_Test">here</a>.</p>
<p><em>On a side note: Isn't cumberland xml so much cleaner than ArcXML?  Excessive use of attributes is an XML no-no.  Let the <a href="http://www.salmonsalvo.net/blog/?p=199">xml schema</a> take care of preventing duplicates.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=223</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>feature simplification</title>
		<link>http://www.salmonsalvo.net/blog/?p=205</link>
		<comments>http://www.salmonsalvo.net/blog/?p=205#comments</comments>
		<pubDate>Tue, 10 Feb 2009 03:09:56 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=205</guid>
		<description><![CDATA[I have just added an implementation of the Douglas-Peucker algorithm, which provides the ability to simplify complicated lines and polygons.  This can be enabled from within a Style element:


&#60;Style&#62;
&#160; &#160; &#60;Simplify&#62;true&#60;/Simplify&#62;
&#160; &#160; &#60;SimplifyTolerance&#62;0.000000001&#60;/SimplifyTolerance&#62;
&#160; &#160; ...



The advantage of this is you can set styles that are enabled at higher scales (more zoomed out) that will [...]]]></description>
			<content:encoded><![CDATA[<p>I have just added an implementation of the Douglas-Peucker algorithm, which provides the ability to simplify complicated lines and polygons.  This can be enabled from within a Style element:</p>
<div class="syntax_hilite">
<div id="xml-6">
<div class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Simplify<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Simplify<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SimplifyTolerance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.000000001<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SimplifyTolerance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; ...</div>
</div>
</div>
<p></p>
<p>The advantage of this is you can set styles that are enabled at higher scales (more zoomed out) that will draw simpler features.  These look better.  The SimplifyTolerance is in the data's units and will filter out vertices less than it.  For example, I have Florida counties data in meters:</p>
<p><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2009/02/poly_tolerance.png" alt="polygon simplify tolerance examples" title="poly_tolerance" class="size-full wp-image-207" /></p>
<p>As the tolerance increases, the polygons look smoother.  The trade-off is accuracy as you can see, and by a tolerance of 12,800 meters, the features are indistinct polygons.  Finding the right value is an art, but definitely worth the work:</p>
<p>before:</p>
<p><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2009/02/full.png" alt="no simplification" title="full" class="size-full wp-image-209" /></p>
<p>after:</p>
<p><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2009/02/simplified.png" alt="after simplification" title="simplified" class="size-full wp-image-211" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=205</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xml schema for maps</title>
		<link>http://www.salmonsalvo.net/blog/?p=199</link>
		<comments>http://www.salmonsalvo.net/blog/?p=199#comments</comments>
		<pubDate>Wed, 04 Feb 2009 20:37:10 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml schema]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=199</guid>
		<description><![CDATA[I have been playing around a bit with xml schema.
XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content and semantics of XML documents.
One cool thing is that both MonoDevelop and Visual Studio (and I am sure others) provide tag completion [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing around a bit with <a href="http://www.w3.org/XML/Schema">xml schema</a>.</p>
<blockquote><p>XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content and semantics of XML documents.</p></blockquote>
<p>One cool thing is that both MonoDevelop and Visual Studio (and I am sure others) provide tag completion and validation for them.  This is very nice when you have an arbitrary xml format such as I do for <a href="http://http://code.google.com/p/cumberland/wiki/mapXmlFormat">cumberland maps</a>.</p>
<p>Since I have no WYSIWYG editor like ArcMap or something, it is kind of tough to get started building a map. Xml schema provides a way to speed this process up.  So, I used <a href="http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx">Xsd.exe</a> to generate a schema from one of my maps, and then extended it by hand. It's available in the source <a href="http://code.google.com/p/cumberland/source/browse/trunk/cumberland/Cumberland.Tests/maps/cumberland.xsd">here</a>.</p>
<p>Now I'll just run through a quick example with the ubiquitous Visual C# Express:</p>
<p>First, create a project.  Next, add a New item->Xml File.  When this opens we'll get an XML menu item.  Select 'Schemas'.  This will open a dialog listing all available xml schemas, we want to add ours.  Click the 'Add' button and select the above-linked cumberland.xsd (which you will need to download).  The schema will now show up in the schemas:</p>
<p><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2009/02/add_schema_vs.png" alt="Added schema in VS" title="add_schema_vs" class="size-full wp-image-200" /></p>
<p>Press 'Ok' and if you go back to your xml document, and type '&lt;', you should see intellisense pop up with the 'Map' element!  Press tab and it should complete the element and add the namespace.  From there, you can create your map without having to refer to any wiki page.  It will complete tags, show warnings when you are missing required elements or when elements contain invalid values:</p>
<p><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2009/02/vs_xml_schema_warnings.png" alt="Xml schema warnings in VS C# Express" title="vs_xml_schema_warnings" class="size-full wp-image-201" /></p>
<p>And list elements when the values are restricted:</p>
<p><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2009/02/vs_element_values.png" alt="intellisense on xml element values" title="vs_element_values" class="size-full wp-image-202" /></p>
<p>sweet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=199</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using OpenGL to interact with 2D maps, part 3: putting it together</title>
		<link>http://www.salmonsalvo.net/blog/?p=92</link>
		<comments>http://www.salmonsalvo.net/blog/?p=92#comments</comments>
		<pubDate>Mon, 22 Dec 2008 03:48:49 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Appomattox]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=92</guid>
		<description><![CDATA[In the previous post, I went over the basics of setting up OpenGL for drawing our maps.  We got our 2D map rendered onto 3D space, and we were able to interact with it.  The last step is to manage the interaction between the 3D space and the 2D map so that we [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.salmonsalvo.net/blog/?p=89">previous post</a>, I went over the basics of setting up OpenGL for drawing our maps.  We got our 2D map rendered onto 3D space, and we were able to interact with it.  The last step is to manage the interaction between the 3D space and the 2D map so that we can do things like calculate extents, zoom to extents, and other typical mapping functionality.</p>
<p>I mentioned the frustrum, which is how we want to represent the 3D space and project it onto our 2D computer screen.  Well, if we stand on the x axis it would look like so:</p>
<p><div id="attachment_118" class="wp-caption alignnone" style="width: 458px"><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/11/frustrumzy.png" alt="the frustrum on the x axis" title="frustrumzy" width="448" height="249" class="size-full wp-image-118" /><p class="wp-caption-text">the frustrum on the x axis</p></div></p>
<p>The near and far clipping planes (zNear/zFar) are not pictured.  For our purposes, they can be 1 and Integer.MaxValue, respectively.  Neither is the aspect ratio, which will just be set to the aspect ratio of our window (width/height).  That leaves us with the Field of View Y.  We can start that at a value of 90.</p>
<p>I've placed the map in the frustrum, and as you can see, if we want to zoom to the full height of the map, we need to calculate z.  Now, from the diagram, we can create a right triangle from the camera eye, the center of the map, and the top-center of the map.  From there it is simple trigonometry:</p>
<div class="syntax_hilite">
<div id="csharp-10">
<div class="csharp csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// fovy = Field of View Y</span><br />
eye.<span style="color: #0000FF;">Z</span> <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>actualExtents.<span style="color: #0000FF;">Height</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">/</span> Math.<span style="color: #0000FF;">Tan</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>Math.<span style="color: #0000FF;">PI</span><span style="color: #008000;">/</span><span style="color: #FF0000;">180</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">*</span> fovy<span style="color: #008000;">/</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>The X/Y coordinate of the eye/camera is simply the map center, so now we know where to put the camera in 3d space to frame our 2D picture.  We can also now acquire the map scale:</p>
<div class="syntax_hilite">
<div id="csharp-11">
<div class="csharp csharp" style="font-family:monospace;">scale <span style="color: #008000;">=</span> actualExtents.<span style="color: #0000FF;">Height</span> <span style="color: #008000;">/</span> Allocation.<span style="color: #0000FF;">Height</span>; <span style="color: #008080; font-style: italic;">// scale = map units / pixels</span></div>
</div>
</div>
<p></p>
<h3 id="toc-accounting-for-window-resizing">Accounting for window resizing</h3>
<p>I've mentioned the field of view Y, but not X.  Why is that?  Well, the field of view X can be changed by changing the aspect ratio.  That is, if the field of view Y is fixed, and the aspect ratio changes, then the field of view X must change. This causes problems in window resizing.  Say, we expand the window in height, but not in width, since the field of view Y is fixed, we have to shrink the field of view X, which will have the effect of zooming the map in.</p>
<p>The solution is that we must adjust the field of view Y on every window resize by reversing our calculation to get the z value:</p>
<div class="syntax_hilite">
<div id="csharp-12">
<div class="csharp csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// calculate field of view y with our eye.Z, and new map height</span><br />
<span style="color: #008080; font-style: italic;">// field of view x will be taken care of by setting aspect ratio </span><br />
fovy <span style="color: #008000;">=</span> Math.<span style="color: #0000FF;">Atan</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>actualExtents.<span style="color: #0000FF;">Height</span><span style="color: #008000;">/</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">/</span> eye.<span style="color: #0000FF;">Z</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">*</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">180</span><span style="color: #008000;">/</span>Math.<span style="color: #0000FF;">PI</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">*</span> <span style="color: #FF0000;">2</span>; &nbsp; &nbsp; &nbsp;<span style="color: #008080; font-style: italic;">// convert to degrees and double</span></div>
</div>
</div>
<p></p>
<h3 id="toc-enough-math-already">Enough math already!</h3>
<p>Now we have the math to interact with our map.  We can zoom/pan/etc. by moving our 3d coordinate (eye) in space.  If we want to work backwards and figure out our extents from our point, we can simply reverse the function for discovering eye.Z above.</p>
<p>The final post in this series will summarize this topic and how it will be integrated in the next version of <a href="http://salmonsalvo.net/Appomattox">Appomattox</a>.</p>
<p><em>Note: The source code from this post is available <a href="http://code.google.com/p/appomattox/source/browse/trunk/Appomattox/MapWidget.cs">here</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=92</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>labels yo</title>
		<link>http://www.salmonsalvo.net/blog/?p=177</link>
		<comments>http://www.salmonsalvo.net/blog/?p=177#comments</comments>
		<pubDate>Sun, 07 Dec 2008 00:48:17 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=177</guid>
		<description><![CDATA[in the quest to make cumberland contain the bare minimum of map making functionality, I added labelling.  They can be set to angles, positioned relative to a point, and also outlined to make them stick out.  The point in polygons is the centroid.  Polylines are a little trickier.  Ideally, you'd want [...]]]></description>
			<content:encoded><![CDATA[<p>in the quest to make <a href="http://code.google.com/p/cumberland/">cumberland</a> contain the bare minimum of map making functionality, I added labelling.  They can be set to angles, positioned relative to a point, and also outlined to make them stick out.  The point in polygons is the centroid.  Polylines are a little trickier.  Ideally, you'd want to the label to flow with the line, but for now it just looks for the longest segment and sets the angle to its slope and uses its midpoint as the point.</p>
<p><a href="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/12/out1.png"><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/12/out1.png" alt="label examples" title="out1" class="size-medium wp-image-180" /></a></p>
<p><div id="attachment_176" class="wp-caption alignnone" style="width: 410px"><a href="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/12/map.png"><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/12/map.png" alt="labels in action" title="map" width="400" height="400" class="size-full wp-image-176" /></a><p class="wp-caption-text">labels in action</p></div></p>
<p>Also, Go Gators!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=177</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualEarth support</title>
		<link>http://www.salmonsalvo.net/blog/?p=172</link>
		<comments>http://www.salmonsalvo.net/blog/?p=172#comments</comments>
		<pubDate>Thu, 04 Dec 2008 19:30:10 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>
		<category><![CDATA[tilepyramider]]></category>
		<category><![CDATA[virtualearth]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=172</guid>
		<description><![CDATA[I added support for generating tiles for VirtualEarth to cumberland.  I did it because it's super trivial after you have support for Google Maps.  The tiles are the same except they have different min and max zoom levels and you need to save them with their quad key for VE.  Luckily, MSDN [...]]]></description>
			<content:encoded><![CDATA[<p>I added support for generating tiles for VirtualEarth to <a href="http://code.google.com/p/cumberland/">cumberland</a>.  I did it because it's super trivial after you have support for Google Maps.  The tiles are the same except they have different min and max zoom levels and you need to save them with their quad key for VE.  Luckily, MSDN provides <a href="http://msdn.microsoft.com/en-us/library/bb259689.aspx">sample code</a> for calculating this.</p>
<p>As always, a <a href="http://salmonsalvo.net/Cumberland:_VirtualEarth_Test">demo is up</a>.</p>
<p>The TileProvider class has a new TileConsumer, VirtualEarth, and the tilepyramider now excepts a new 've' argument to its consumer option.  This will create a directory full of images named by their quad key.  Then you'll just need to wire up some script:</p>
<div class="syntax_hilite">
<div id="javascript-15">
<div class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> VEMap<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myMap'</span><span style="color: #009900;">&#41;</span>;<br />
&nbsp; &nbsp; map.<span style="color: #660066;">LoadMap</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> VELatLong<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">21</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> bounds <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> VELatLongRectangle<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> VELatLong<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">34</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">120</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> VELatLong<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">12</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">82</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span>;<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> layerID <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;test&quot;</span>;<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> tileSource <span style="color: #339933;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot;ve/%4.png&quot;</span>;<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> tileSourceSpec <span style="color: #339933;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> VETileSourceSpecification<span style="color: #009900;">&#40;</span>layerID<span style="color: #339933;">,</span> tileSource<span style="color: #009900;">&#41;</span>;<br />
&nbsp; &nbsp; tileSourceSpec.<span style="color: #660066;">NumServers</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span>;<br />
&nbsp; &nbsp; tileSourceSpec.<span style="color: #660066;">Bounds</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> bounds;<br />
&nbsp; &nbsp; tileSourceSpec.<span style="color: #660066;">MinZoom</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span>;<br />
&nbsp; &nbsp; tileSourceSpec.<span style="color: #660066;">MaxZoom</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span>;<br />
&nbsp; &nbsp; tileSourceSpec.<span style="color: #660066;">Opacity</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span>;<br />
&nbsp; &nbsp; tileSourceSpec.<span style="color: #660066;">ZIndex</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #CC0000;">110</span>;</p>
<p>&nbsp; &nbsp; map.<span style="color: #660066;">AddTileLayer</span><span style="color: #009900;">&#40;</span>tileSourceSpec<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>;<br />
<span style="color: #009900;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Create the map div and call your method:</p>
<div class="syntax_hilite">
<div id="html4strict-16">
<div class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a> <span style="color: #000066;">onload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;init();&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'myMap'</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;position:absolute; width:400px; height:400px;&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
...</div>
</div>
</div>
<p></p>
<p>And you're good to go!  You'll need to build from SVN to get this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=172</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cumberland + KML = pure fire</title>
		<link>http://www.salmonsalvo.net/blog/?p=166</link>
		<comments>http://www.salmonsalvo.net/blog/?p=166#comments</comments>
		<pubDate>Mon, 01 Dec 2008 22:47:32 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>
		<category><![CDATA[googleearth]]></category>
		<category><![CDATA[kml]]></category>
		<category><![CDATA[map2kml]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=166</guid>
		<description><![CDATA[Keyhole Markup Language (KML) is the xml format used in Google Earth for overlaying data.  I've implemented functionality for creating kml from a cumberland map and a command line tool (map2kml.exe) to use it.  It creates a kml document with folders for each layer using the various styles, including thematic mapping, and adds [...]]]></description>
			<content:encoded><![CDATA[<p>Keyhole Markup Language (KML) is the xml format used in Google Earth for overlaying data.  I've implemented functionality for creating kml from a <a href="http://code.google.com/p/cumberland/">cumberland</a> map and a command line tool (map2kml.exe) to use it.  It creates a kml document with folders for each layer using the various styles, including thematic mapping, and adds the features as defined in the feature source, transforming coordinate systems if necessary.  An example result:</p>
<p><a href="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/12/screenshot-google-earth.jpg"><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/12/screenshot-google-earth.jpg" alt="cumberland generated kml on google earth" title="screenshot-google-earth" class="size-full wp-image-168" /></a></p>
<p>You could use this tool to load up a subset of your data from postgis or sql server and pass it on to a customer with your own specialized symbology.  A future improvement would be to allow importing of kml so that people could make edits in google earth and then load the changes into your database.</p>
<p>You'll need to build from SVN to get this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=166</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cumberland: TMS / OpenLayers support</title>
		<link>http://www.salmonsalvo.net/blog/?p=161</link>
		<comments>http://www.salmonsalvo.net/blog/?p=161#comments</comments>
		<pubDate>Sat, 22 Nov 2008 20:17:53 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[tms]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=161</guid>
		<description><![CDATA[The TileProvider class and the tilepyramider tool have been updated to create tiles for the un-official Tile Map Service specification.  The main reason for this is to use OpenLayers.  
Check out a demo.
It's pretty simple to set up.  There is a new TileConsumer, TileMapService.  tilepyramider has a new 'consumer' option you [...]]]></description>
			<content:encoded><![CDATA[<p>The TileProvider class and the tilepyramider tool have been updated to create tiles for the un-official <a href="http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification">Tile Map Service</a> specification.  The main reason for this is to use <a href="http://openlayers.org/">OpenLayers</a>.  </p>
<p><a href="http://salmonsalvo.net/Cumberland:_OpenLayers_Test">Check out a demo.</a></p>
<p>It's pretty simple to set up.  There is a new TileConsumer, TileMapService.  tilepyramider has a new 'consumer' option you can set to "tms", and it will handle the rest, including creating the tilemapresource.xml file.   (There are some properties in this file you'll need to update manually if you want it to be accurate)</p>
<p><b>OpenLayers</b></p>
<p>Currently, a TMS has to have an EPSG of 4326 and worldwide extents to work in OpenLayers (<a href="http://openlayers.org/pipermail/users/2008-April/005449.html">source</a>).  This means you can't clip to a certain region, so the above example generated a lot of empty tiles.  Given that your map is projecting to epsg 4326, you'll run something like:</p>
<div class="syntax_hilite">
<div id="ini-21">
<div class="ini ini" style="font-family:monospace;">tilepyramider.exe -e<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">-<span style="">180</span>,-<span style="">90</span>,<span style="">180</span>,<span style="">90</span> -o<span style="color: #000066; font-weight:bold;">=</span>/home/scottell/Desktop/tms -c<span style="color: #000066; font-weight:bold;">=</span>tms -x<span style="color: #000066; font-weight:bold;">=</span><span style="">6</span> ../../../Cumberland.Tests/maps/mexico.xml</span></div>
</div>
</div>
<p></p>
<p>Then you'll deploy the resulting 'tms' directory to your website and wire up a page with the following script:</p>
<div class="syntax_hilite">
<div id="javascript-22">
<div class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> initialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; maxExtent<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Bounds</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">180</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">90</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">180</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">90</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; numZoomLevels<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span>;</p>
<p>&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Map</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'map'</span><span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> layer <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Layer</span>.<span style="color: #660066;">TMS</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;Mexico&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;http://localhost/~scottell/&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; layername<span style="color: #339933;">:</span> <span style="color: #3366CC;">'tms'</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; serviceVersion<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; type<span style="color: #339933;">:</span><span style="color: #3366CC;">'png'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; map.<span style="color: #660066;">addLayer</span><span style="color: #009900;">&#40;</span>layer<span style="color: #009900;">&#41;</span>;<br />
&nbsp; &nbsp; map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">LonLat</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">105</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">24</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span>;<br />
<span style="color: #009900;">&#125;</span></div>
</div>
</div>
<p></p>
<p>Add a script reference to OpenLayers:</p>
<div class="syntax_hilite">
<div id="html4strict-23">
<div class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.openlayers.org/api/OpenLayers.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div>
</div>
</div>
<p></p>
<p>Call initialize() on load and add your map div:</p>
<div class="syntax_hilite">
<div id="html4strict-24">
<div class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a> <span style="color: #000066;">onload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;initialize()&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;map&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 500px; height: 300px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div>
</div>
</div>
<p></p>
<p>That's it!  You'll need to build from SVN to get this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=161</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ineffective mapping: an example</title>
		<link>http://www.salmonsalvo.net/blog/?p=153</link>
		<comments>http://www.salmonsalvo.net/blog/?p=153#comments</comments>
		<pubDate>Mon, 17 Nov 2008 16:40:46 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=153</guid>
		<description><![CDATA[So I was about to go on a little hike with my parents, and this park (like many) has a map billboard thing:
Which is good, but we walk up to it and I'm just confused.  What am I a looking at?  It takes me a second to orient myself.  Here is the [...]]]></description>
			<content:encoded><![CDATA[<p>So I was about to go on a little hike with my parents, and this park (like many) has a map billboard thing:</p>
<p><a href="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/11/pict0001-modified-2.jpg"><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/11/pict0001-modified-2.jpg" alt="trail map billboard" title="pict0001-modified-2" class="size-medium wp-image-154" /></a></p>
<p>Which is good, but we walk up to it and I'm just confused.  What am I a looking at?  It takes me a second to orient myself.  Here is the map (complete with my annotations):</p>
<p><a href="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/11/trailmap.jpg"><img src="http://www.salmonsalvo.net/blog/wp-content/uploads/2008/11/trailmap.jpg" alt="trail map with annotations" title="trailmap"  class="size-full wp-image-158" /></a></p>
<p>There a couple of issues:</p>
<ol>
<li>You are looking at the map which is to the east, but the map is north/south, so it is disorienting.  This could be fixed by moving the billboard so that you are facing north when you read it.</li>
<li>The trail which you are probably going on is not actually on the map!.  Doh!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=153</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cumberland 0.1</title>
		<link>http://www.salmonsalvo.net/blog/?p=151</link>
		<comments>http://www.salmonsalvo.net/blog/?p=151#comments</comments>
		<pubDate>Sat, 15 Nov 2008 02:51:39 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[cumberland]]></category>

		<guid isPermaLink="false">http://www.salmonsalvo.net/blog/?p=151</guid>
		<description><![CDATA[I posted cumberland 0.1 on the project page.
I think it's a really elegant and simple API for drawing maps, and it's also under the awesomest, most reasonable, licensing scheme there is.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/cumberland/">I posted cumberland 0.1 on the project page.</a></p>
<p>I think it's a really elegant and simple API for drawing maps, and it's also under the awesomest, most reasonable, licensing scheme there is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.salmonsalvo.net/blog/?feed=rss2&amp;p=151</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
