<?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>ozblog</title>
	<atom:link href="http://ozblog.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://ozblog.com.au</link>
	<description>If your vocation is your vacation you&#039;ll never work a day in your life</description>
	<lastBuildDate>Tue, 06 Dec 2011 00:36:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Styled Layer Descriptor (SLD)</title>
		<link>http://ozblog.com.au/2011/12/06/styled-layer-descriptor-sld/</link>
		<comments>http://ozblog.com.au/2011/12/06/styled-layer-descriptor-sld/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 00:36:40 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Style Document Layer (.sld)]]></category>
		<category><![CDATA[Web Mapping & GIS]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=610</guid>
		<description><![CDATA[Introduction GeoServer uses Styled Layer Descriptor (SLD) to visualize geospatial data. SLD is a XML-based standard created by the Open Geospatial Consortium (OGC). For more information on the SLD schema, please see the OGC page on Styled Layer Descriptor at [...]]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>GeoServer uses Styled Layer Descriptor (SLD) to visualize geospatial data. SLD is a XML-based standard created by the Open Geospatial Consortium (OGC). For more information on the SLD schema, please see the OGC page on Styled Layer Descriptor at <a title="http://www.opengeospatial.org/standards/sld" href="http://www.opengeospatial.org/standards/sld" target="_blank">http://www.opengeospatial.org/standards/sld</a>.</p>
<h1>SLD structure</h1>
<p>An SLD file contains the following hierarchical structure:</p>
<ul>
<li>Header</li>
<ul>
<li>FeatureTypeStyles</li>
<ul>
<li>Rules</li>
<ul>
<li>Symbolizers</li>
</ul>
</ul>
</ul>
</ul>
<p>The header of the SLD contains metadata about XML namespaces, and is usually identical among different SLDs. The details of the header are beyond the scope of this workshop.</p>
<p>A <strong>FeatureTypeStyle</strong> is a group of styling rules. (Recall that a <a href="http://workshops.opengeo.org/geoserver-intro/moreinfo/glossary.html#term-featuretype"><em>featuretype</em></a> is another word for a <a href="http://workshops.opengeo.org/geoserver-intro/moreinfo/glossary.html#term-layer"><em>layer</em></a>.) Grouping by FeatureTypeStyle affects rendering order; the first FeatureTypeStyle will be rendered first, followed by the second, etc.</p>
<p>A <strong>Rule</strong> is a single styling directive. It can apply globally to a layer, or it can have filter logic associated with it so that the rule is conditionally applied. These conditions can be based on the attributes of the data, or based on the scale (zoom) level of the data being rendered.</p>
<p>A <strong>Symbolizer</strong> is the actual style instruction. There are five types of symbolizers:</p>
<ul>
<li><strong>PointSymbolizer</strong></li>
<li><strong>LineSymbolizer</strong></li>
<li><strong>PolygonSymbolizer</strong></li>
<li><strong>RasterSymbolizer</strong></li>
<li><strong>TextSymbolizer</strong></li>
</ul>
<p>There can be one or more FeatureTypeStyles per SLD, one or more Rules per FeatureTypeStyles, and one or more Symbolizers per Rule.</p>
<h1>Example</h1>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;?</span><span style="color: #dc143c;">xml</span> version=<span style="color: #483d8b;">&quot;1.0&quot;</span> encoding=<span style="color: #483d8b;">&quot;ISO-8859-1&quot;</span><span style="color: #66cc66;">?&gt;</span>
<span style="color: #66cc66;">&lt;</span>StyledLayerDescriptor version=<span style="color: #483d8b;">&quot;1.0.0&quot;</span>
 xsi:schemaLocation=<span style="color: #483d8b;">&quot;http://www.opengis.net/sld StyledLayerDescriptor.xsd&quot;</span>
 xmlns=<span style="color: #483d8b;">&quot;http://www.opengis.net/sld&quot;</span>
 xmlns:ogc=<span style="color: #483d8b;">&quot;http://www.opengis.net/ogc&quot;</span>
 xmlns:xlink=<span style="color: #483d8b;">&quot;http://www.w3.org/1999/xlink&quot;</span>
 xmlns:xsi=<span style="color: #483d8b;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span><span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>NamedLayer<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>Name<span style="color: #66cc66;">&gt;</span>Simple Point<span style="color: #66cc66;">&lt;</span>/Name<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>UserStyle<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>Title<span style="color: #66cc66;">&gt;</span>Simple Point<span style="color: #66cc66;">&lt;</span>/Title<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>Rule<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>PointSymbolizer<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>Graphic<span style="color: #66cc66;">&gt;</span>
              <span style="color: #66cc66;">&lt;</span>Mark<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>WellKnownName<span style="color: #66cc66;">&gt;</span>circle<span style="color: #66cc66;">&lt;</span>/WellKnownName<span style="color: #66cc66;">&gt;</span>
                <span style="color: #66cc66;">&lt;</span>Fill<span style="color: #66cc66;">&gt;</span>
                  <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FF0000&lt;/CssParameter&gt;</span>
                <span style="color: #66cc66;">&lt;</span>/Fill<span style="color: #66cc66;">&gt;</span>
              <span style="color: #66cc66;">&lt;</span>/Mark<span style="color: #66cc66;">&gt;</span>
              <span style="color: #66cc66;">&lt;</span>Size<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">6</span><span style="color: #66cc66;">&lt;</span>/Size<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>/Graphic<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>/PointSymbolizer<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/Rule<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/UserStyle<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>/NamedLayer<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/StyledLayerDescriptor<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>The first 11 lines are the header, which contain XML namespace information, as well as the Name and Title of the SLD. The actual styling happens inside the &lt;FeatureTypeStyle&gt; tag (<strong>lines 12-26</strong>), of which there is only one in this example. The tag contains one &lt;Rule&gt; (<strong>lines 13-25</strong>) and the rule contains one symbolizer, a &lt;PointSymbolizer&gt; (<strong>lines 14-24</strong>). The symbolizer directive creates a graphic mark of a “well known name”, in this case a circle (<strong>line 17</strong>). This shape has a &lt;Fill&gt; parameter of #FF0000 (<strong>line 19</strong>), which is an RGB color code for 100% red. The shape also has a &lt;Size&gt; of 6 (<strong>line 22</strong>), which is the diameter of the circle in pixels.</p>
]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/12/06/styled-layer-descriptor-sld/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uDig DMG Work</title>
		<link>http://ozblog.com.au/2011/10/11/udig-dmg-work/</link>
		<comments>http://ozblog.com.au/2011/10/11/udig-dmg-work/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 06:32:05 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=602</guid>
		<description><![CDATA[I tarted work on a Mac DMG version of the current uDig release it is available for download from the uDig project Download Page.]]></description>
			<content:encoded><![CDATA[<p>I tarted work on a Mac DMG version of the current uDig release it is available for download from the uDig project <a title="uDig Downloads" href="http://udig.refractions.net/download/" target="_blank">Download Page</a>. <a href="http://ozblog.com.au/files/2011/10/uDig-DMG.png"><img class="aligncenter size-full wp-image-601" title="uDig DMG" src="http://ozblog.com.au/files/2011/10/uDig-DMG.png" alt="" width="614" height="456" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/10/11/udig-dmg-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Put your .SLD file on a diet</title>
		<link>http://ozblog.com.au/2011/10/10/put-your-sld-file-on-a-diet/</link>
		<comments>http://ozblog.com.au/2011/10/10/put-your-sld-file-on-a-diet/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 12:19:23 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Style Document Layer (.sld)]]></category>
		<category><![CDATA[Web Mapping & GIS]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=564</guid>
		<description><![CDATA[Introduction Traditionally when building an SLD the best approach was to build a set of several different filtered rules. Whilst this works fine, if the only thing that changes between rules is the colour it creates a lot of unnecessary [...]]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>Traditionally when building an SLD the best approach was to build a set of several different filtered rules. Whilst this works fine, if the only thing that changes between rules is the colour it creates a lot of unnecessary duplicate work. Typically, the traditional multi-rule SLD can be very large and become difficult to maintain. </p>
<p>Imagine you are styling a road layer that contains 25 different rules and you need to change the font on the labels, this would require you to update all 25 rules.</p>
<h1>Symbology Encoding Functions</h1>
<p>The <a href="http://www.opengeospatial.org/standards/filter" title="OGC Filter encoding specification" target="_blank">OGC Filter encoding specification</a> contains a generic concept of <em>Symbology Encoding</em> or <em>Filter</em> functions.</p>
<p><em>Symbology Encoding Functions</em> or <em>Filter Functions</em> are a function, with arguments, that can be called inside of a filter or, more generically, an expression, to perform specific calculations. Using filter functions we can compress our 25 filtered rules into one easy to maintain rule.</p>
<h1>Example</h1>
<p><a href="http://ozblog.com.au/files/2011/10/Filter-Function-Example.png"><img class="aligncenter size-full wp-image-590" title="Filter Function Example" src="http://ozblog.com.au/files/2011/10/Filter-Function-Example.png" alt="" width="590" /></a></p>
<p>For this example we will use the <a href="http://ozblog.com.au/2011/03/23/sld-fence-symbol/fence_symbol-sld/">lines shapefile</a> provided by the GeoServer Cookbook. </p>
<p>To keep this example simple we will shrink our 25 different filtered rules into 3 but the concept can be scaled up to as large as required. </p>
<h2>Multiple Rule Approach</h2>
<p>Our original SLD uses a typical SLD 1.0 multiple rule and filter style where we make a rule for every style alteration we wish to create. In this case we are making three rules one for each road type: Local road, Secondary and Highway.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>Feature<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Rule<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>local-road<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>ogc:Filter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>ogc:PropertyIsEqualTo<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>type<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>local-road<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/ogc:PropertyIsEqualTo<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/ogc:Filter<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Stroke<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#009933&lt;/sld:CssParameter&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke-width&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">2</span><span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Stroke<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Label<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Label<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Font<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-family&quot;</span><span style="color: #66cc66;">&gt;</span>Arial<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-size&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">10</span><span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-style&quot;</span><span style="color: #66cc66;">&gt;</span>normal<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-weight&quot;</span><span style="color: #66cc66;">&gt;</span>bold<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Font<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">0.0</span><span style="color: #66cc66;">&lt;</span>/sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Halo<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Radius<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>/sld:Radius<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FFFFFF&lt;/sld:CssParameter&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Halo<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#000000&lt;/sld:CssParameter&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxAngleDelta&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">90</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;followLine&quot;</span><span style="color: #66cc66;">&gt;</span>true<span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;repeat&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">200</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxDisplacement&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">400</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>/sld:Rule<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>Feature<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Rule<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>secondary<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>ogc:Filter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>ogc:PropertyIsEqualTo<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>type<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>secondary<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/ogc:PropertyIsEqualTo<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/ogc:Filter<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Stroke<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#0055CC&lt;/sld:CssParameter&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke-width&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">3</span><span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Stroke<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Label<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Label<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Font<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-family&quot;</span><span style="color: #66cc66;">&gt;</span>Arial<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-size&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">10</span><span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-style&quot;</span><span style="color: #66cc66;">&gt;</span>normal<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-weight&quot;</span><span style="color: #66cc66;">&gt;</span>bold<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Font<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">0.0</span><span style="color: #66cc66;">&lt;</span>/sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Halo<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Radius<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>/sld:Radius<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FFFFFF&lt;/sld:CssParameter&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Halo<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#000000&lt;/sld:CssParameter&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxAngleDelta&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">90</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;followLine&quot;</span><span style="color: #66cc66;">&gt;</span>true<span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;repeat&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">200</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxDisplacement&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">400</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>/sld:Rule<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>Feature<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Rule<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>highway<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>ogc:Filter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>ogc:PropertyIsEqualTo<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>type<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>highway<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/ogc:PropertyIsEqualTo<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/ogc:Filter<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Stroke<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FF0000&lt;/sld:CssParameter&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke-width&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">6</span><span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Stroke<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Label<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Label<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Font<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-family&quot;</span><span style="color: #66cc66;">&gt;</span>Arial<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-size&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">10</span><span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-style&quot;</span><span style="color: #66cc66;">&gt;</span>normal<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-weight&quot;</span><span style="color: #66cc66;">&gt;</span>bold<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Font<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">0.0</span><span style="color: #66cc66;">&lt;</span>/sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Halo<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Radius<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>/sld:Radius<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FFFFFF&lt;/sld:CssParameter&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Halo<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#000000&lt;/sld:CssParameter&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxAngleDelta&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">90</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;followLine&quot;</span><span style="color: #66cc66;">&gt;</span>true<span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;repeat&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">200</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxDisplacement&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">400</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>/sld:Rule<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p><a class="download" rel="" href="http://ozblog.com.au/files/2011/10/line-rule.sld">Download the full SLD</a></p>
<h2>Function Approach</h2>
<p>Our new compact SLD will make use of the <em>Recode</em> function to select different stroke based on the value of the <em>&#8220;type&#8221;</em> property.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>Feature<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeName<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>sld:Rule<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:Name<span style="color: #66cc66;">&gt;</span>local-road<span style="color: #66cc66;">&lt;</span>/sld:Name<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
&nbsp;
      <span style="color: #66cc66;">&lt;</span>sld:Stroke<span style="color: #66cc66;">&gt;</span>
&nbsp;
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke&quot;</span><span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>ogc:Function name=<span style="color: #483d8b;">&quot;Recode&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>type<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>local-road<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#009933&lt;/ogc:Literal&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>secondary<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#0055CC&lt;/ogc:Literal&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>highway<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FF0000&lt;/ogc:Literal&gt;</span>
          <span style="color: #66cc66;">&lt;</span>/ogc:Function<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
&nbsp;
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;stroke-width&quot;</span><span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>ogc:Function name=<span style="color: #483d8b;">&quot;Recode&quot;</span><span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>type<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>local-road<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">2</span><span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>secondary<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">3</span><span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span>highway<span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
            <span style="color: #66cc66;">&lt;</span>ogc:Literal<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">6</span><span style="color: #66cc66;">&lt;</span>/ogc:Literal<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>/ogc:Function<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
&nbsp;
      <span style="color: #66cc66;">&lt;</span>/sld:Stroke<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:LineSymbolizer<span style="color: #66cc66;">&gt;</span>
&nbsp;
    <span style="color: #66cc66;">&lt;</span>sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Label<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>ogc:PropertyName<span style="color: #66cc66;">&gt;</span>name<span style="color: #66cc66;">&lt;</span>/ogc:PropertyName<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Label<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Font<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-family&quot;</span><span style="color: #66cc66;">&gt;</span>Arial<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-size&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">10</span><span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-style&quot;</span><span style="color: #66cc66;">&gt;</span>normal<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;font-weight&quot;</span><span style="color: #66cc66;">&gt;</span>bold<span style="color: #66cc66;">&lt;</span>/sld:CssParameter<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Font<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">0.0</span><span style="color: #66cc66;">&lt;</span>/sld:PerpendicularOffset<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:LinePlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:LabelPlacement<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Halo<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Radius<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>/sld:Radius<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
          <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FFFFFF&lt;/sld:CssParameter&gt;</span>
        <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Halo<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:Fill<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;</span>sld:CssParameter name=<span style="color: #483d8b;">&quot;fill&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#000000&lt;/sld:CssParameter&gt;</span>
      <span style="color: #66cc66;">&lt;</span>/sld:Fill<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxAngleDelta&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">90</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;followLine&quot;</span><span style="color: #66cc66;">&gt;</span>true<span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;repeat&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">200</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
      <span style="color: #66cc66;">&lt;</span>sld:VendorOption name=<span style="color: #483d8b;">&quot;maxDisplacement&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">400</span><span style="color: #66cc66;">&lt;</span>/sld:VendorOption<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>/sld:TextSymbolizer<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>/sld:Rule<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/sld:FeatureTypeStyle<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p><a class="download" rel="" href="http://ozblog.com.au/files/2011/10/line-function.sld">Download the full SLD</a></p>
<h1>Performance implications</h1>
<p>Assuming we have 45 lines per rule in our original SLD, now if we are styling a layer with 200 style variations we would end up with an SLD with roughly 9,000 lines of XML. Alternatively, if we use the function approach we are only adding 4 extra lines per style variation.  Therefore, we end up with an SLD with roughly 845 lines of XML. Now say we want to change the font type across all our styles, in the one rule per variation approach we need to update 200 lines, one per rule. In the function approach we only need to update 1 line.</p>
<p>Finally, to render a map using the multiple rule approach all 200 rules must be evaluated for each feature you render, whereas the function approach requires only 1 rule be evaluated per feature. This can make a significantly noticeable difference to performance and render time.</p>
<h1>References</h1>
<ul>
<li><a href="http://geo-solutions.blogspot.com/2011/08/developer-corner-compact-choropleth-map.html" title="Developer corner: Compact choropleth map styles with the Categorize function" target="_blank">Andrea Aime</a> &#8211; Developer corner: Compact choropleth map styles with the Categorize function</li>
<li><a href="http://www.opengeospatial.org/standards/symbol" title="penGIS Symbology Encoding Implementation Specification" target="_blank">OpenGIS</a> &#8211; OpenGIS Symbology Encoding Implementation Specification
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/10/10/put-your-sld-file-on-a-diet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hard link vs. Soft link in Linux</title>
		<link>http://ozblog.com.au/2011/09/21/hard-link-vs-soft-link-in-linux/</link>
		<comments>http://ozblog.com.au/2011/09/21/hard-link-vs-soft-link-in-linux/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 23:43:13 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=558</guid>
		<description><![CDATA[Symbolic links (also called symlinks or softlinks) most resemble Windows shortcuts. They contain a pathname to a target file. Hard links are a bit different. They are listings that contain information about the file. Linux files don&#8217;t actually live in [...]]]></description>
			<content:encoded><![CDATA[<p>Symbolic links (also called symlinks or softlinks) most resemble Windows shortcuts. They contain a pathname to a target file. Hard links are a bit different. They are listings that contain information about the file.</p>
<p>Linux files don&#8217;t actually live in directories. They are assigned an inode number, which Linux uses to locate files.</p>
<h1>Hard Links</h1>
<ul>
<li>Hard links cannot links directories</li>
<li>Cannot cross file system boundaries</li>
</ul>
<h1>Soft Links</h1>
<p>Soft or symbolic links are just like hard links. It allows to associate multiple filenames with a single file. However, symbolic links allows:</p>
<ul>
<li>To create links between directories</li>
<li>Can cross file system boundaries</li>
</ul>
<h1>Create symbolic link</h1>
<p>You can create symbolic link with ln command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>originalFile.txt <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>symFile.txt</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/09/21/hard-link-vs-soft-link-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Git Notes</title>
		<link>http://ozblog.com.au/2011/08/23/basic-git-notes/</link>
		<comments>http://ozblog.com.au/2011/08/23/basic-git-notes/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 23:09:36 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=534</guid>
		<description><![CDATA[Saving State About to attempt something drastic? Before you do, take a snapshot of all files in the current directory and manage it with git. $ git init $ git add . $ git commit -m &#34;My git backup&#34; Now [...]]]></description>
			<content:encoded><![CDATA[<h1>Saving State</h1>
<p>About to attempt something drastic? Before you do, take a snapshot of all files in the current directory and manage it with git.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> init
$ <span style="color: #c20cb9; font-weight: bold;">git</span> add .
$ <span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;My git backup&quot;</span></pre></div></div>

<p>Now if something went bad, restore the pristine version.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> reset <span style="color: #660033;">--hard</span></pre></div></div>

<h1>Add, Delete, Rename</h1>
<p>If you add new files or subdirectories to your git project, you’ll have to tell Git.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> add readme.txt</pre></div></div>

<p>Similarly, if you want Git to forget about certain files.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> readme.txt</pre></div></div>

<p>Renaming a file is the same as removing the old name and adding the new name. There’s also the shortcut git mv.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> readme.txt readme.htm</pre></div></div>

<h1>What Have I Done?</h1>
<p>Find out what changes you’ve made since the last commit.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">diff</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/08/23/basic-git-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Force Overwrite</title>
		<link>http://ozblog.com.au/2011/08/10/git-force-overwrite/</link>
		<comments>http://ozblog.com.au/2011/08/10/git-force-overwrite/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 01:41:22 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=526</guid>
		<description><![CDATA[This one is hard to find out there so here it is. If you have an uncommitted change (its only in your working copy) that you wish to revert (in SVN terms) to the copy in your latest commit, do [...]]]></description>
			<content:encoded><![CDATA[<p>This one is hard to find out there so here it is. If you have an uncommitted change (its only in your working copy) that you wish to revert (in SVN terms) to the copy in your latest commit, do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> checkout HEAD filename
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Overwrite old file from remote HEAD&quot;</span></pre></div></div>

<p>This will checkout the file from HEAD, overwriting your change.</p>
<p>You can also do this with files from other branches, and such. <code>man git-checkout</code> has the details.</p>
<p>The rest of the Internet will tell you to use git <code>reset --hard</code>, but this resets all uncommitted changes you’ve made in your working copy. <strong>Type this with care.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/08/10/git-force-overwrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordTest</title>
		<link>http://ozblog.com.au/2011/07/26/wordtest/</link>
		<comments>http://ozblog.com.au/2011/07/26/wordtest/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 01:45:42 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=505</guid>
		<description><![CDATA[NOTE: This Project is currently in development, feel free to add any suggestions or feedback to the comment box below. Introduction Amongst software development, a unit tester is the one closest to the developer. In the context of agile development [...]]]></description>
			<content:encoded><![CDATA[<p class="alert"><strong>NOTE:</strong> This Project is currently in development, feel free to add any suggestions or feedback  to the comment box below. </p>
<h2>Introduction</h2>
<p>Amongst software development, a unit tester is the one closest to the developer. In the context of agile development the test code sits right next to the source code as both are written simultaneously. WordTest aims to provide a simple API and UI for plugin developers to write test cases to help streamline the process of updating plugins as new versions of WordPress release.</p>
<h2>Unit Test Case Class</h2>
<table>
<tbody>
<tr>
<td><code>assertTrue($x)</code></td>
<td>Fail if $x is false</td>
</tr>
<tr>
<td><code>assertFalse($x)</code></td>
<td>Fail if $x is true</td>
</tr>
<tr>
<td><code>assertNull($x)</code></td>
<td>Fail if $x is set</td>
</tr>
<tr>
<td><code>assertNotNull($x)</code></td>
<td>Fail if $x not set</td>
</tr>
<tr>
<td><code>assertIsA($x, $t)</code></td>
<td>Fail if $x is not the class or type $t</td>
</tr>
<tr>
<td><code>assertNotA($x, $t)</code></td>
<td>Fail if $x is of the class or type $t</td>
</tr>
<tr>
<td><code>assertEqual($x, $y)</code></td>
<td>Fail if $x == $y is false</td>
</tr>
<tr>
<td><code>assertNotEqual($x, $y)</code></td>
<td>Fail if $x == $y is true</td>
</tr>
<tr>
<td><code>assertWithinMargin($x, $y, $m)</code></td>
<td>Fail if abs($x &#8211; $y) &lt; $m is false</td>
</tr>
<tr>
<td><code>assertOutsideMargin($x, $y, $m)</code></td>
<td>Fail if abs($x &#8211; $y) &lt; $m is true</td>
</tr>
<tr>
<td><code>assertIdentical($x, $y)</code></td>
<td>Fail if $x == $y is false or a type mismatch</td>
</tr>
<tr>
<td><code>assertNotIdentical($x, $y)</code></td>
<td>Fail if $x == $y is true and types match</td>
</tr>
<tr>
<td><code>assertReference($x, $y)</code></td>
<td>Fail unless $x and $y are the same variable</td>
</tr>
<tr>
<td><code>assertClone($x, $y)</code></td>
<td>Fail unless $x and $y are identical copies</td>
</tr>
<tr>
<td><code>assertPattern($p, $x)</code></td>
<td>Fail unless the regex $p matches $x</td>
</tr>
<tr>
<td><code>assertNoPattern($p, $x)</code></td>
<td>Fail if the regex $p matches $x</td>
</tr>
<tr>
<td><code>expectError($x)</code></td>
<td>Fail if matching error does not occour</td>
</tr>
<tr>
<td><code>expectException($x)</code></td>
<td>Fail if matching exception is not thrown</td>
</tr>
<tr>
<td><code>ignoreException($x)</code></td>
<td>Swallows any upcoming matching exception</td>
</tr>
<tr>
<td><code>assert($e)</code></td>
<td>Fail on failed <a local="expectation_documentation">expectation</a> object $e</td>
</tr>
</tbody>
</table>
<p>All assertion methods can take an optional description as a last parameter. This is to label the displayed result with. If omitted a default message is sent instead, which is usually sufficient. This default message can still be embedded in your own message if you include &#8220;%s&#8221; within the string. All the assertions return true on a pass or false on failure.</p>
<h2>Examples</h2>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> SimplePluginTest <span style="color: #000000; font-weight: bold;">extends</span> UnitTestCase <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> testNullValueString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$variable</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assertNull</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$variable</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Should be cleared [%s]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>If test passes normally no message will be shown. If the test fails the message will be shown. The &#8220;%s&#8221; part is replaced by the default error message that would have been shown if we had not supplied our own.</p>
<p>This Plugin is targeted at other Plugin developers and is not for production environments.</p>
]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/07/26/wordtest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect iPhones, iPods and other mobile devices</title>
		<link>http://ozblog.com.au/2011/07/25/detect-iphones-ipods-and-other-mobile-devices/</link>
		<comments>http://ozblog.com.au/2011/07/25/detect-iphones-ipods-and-other-mobile-devices/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 20:24:09 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[CSS tips & trick]]></category>
		<category><![CDATA[Mobile Web App]]></category>
		<category><![CDATA[Web Design and Trends]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=489</guid>
		<description><![CDATA[Introduction When developing for the iPhone, iPad, iPod Touch and other mobile devices, the first thing we have to do is obviously detect it, so we can apply specific code or styles to it. The following code snippets will detect [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>When developing for the iPhone, iPad, iPod Touch and other mobile devices, the first thing we have to do is obviously detect it, so we can apply specific code or styles to it. The following code snippets will detect iPhones and iPods using various methods, depending on your situation you can use one or a combination of these methods. </p>
<h2>JavaScript</h2>
<p>Whether your developing a web application or just making a iPhone compatible version of your website it can be very beneficial to target specific JavaScript to help create a rich interactive UI.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/iPhone/i</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/iPod/i</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/iPad/i</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Mobile Website'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>PHP</h2>
<p>For security reasons you may prefer to use PHP in order to detect iPhones, iPad and iPods touch on the server side.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strstr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iPhone'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">strstr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iPod'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">strstr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iPad'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Mobile Website&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>CSS</h2>
<p>Browser sniffing can be useful, but for many reasons it isn’t the best practice to detect a browser as there are many types of mobile device out there and you don&#8217;t want to have to target your code at every specific device. My preferred option is to target css to a device with and orientation with css, this can make design complicated as you have to think about how your layout will adjust however </p>
<p>If you’re looking for a cleaner way to apply CSS styles to the iPhone or small mobile devices only, you should use the following.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media screen and (max-device-width: 480px){</span>
    <span style="color: #808080; font-style: italic;">/* iPhone specific CSS goes here */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>You can extend this technique to build a css file that adjusts for specifics width of device.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media only screen and (device-width: 768px) {</span>
  <span style="color: #808080; font-style: italic;">/* For general iPad layouts */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Device Orientation</h2>
<p>You can even build css for device orientation. This example will draw the menu on the left when in landscape and on the bottom when in portrat.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) {</span>
  <span style="color: #808080; font-style: italic;">/* For portrait layouts only */</span>
	<span style="color: #cc00cc;">#menu</span> <span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">width</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#body</span> <span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">width</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #a1a100;">@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) {</span>
  <span style="color: #808080; font-style: italic;">/* For landscape layouts only */</span>
&nbsp;
<span style="color: #cc00cc;">#menu</span> <span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">width</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">30%</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">float</span> <span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#body</span> <span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">width</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">70%</span><span style="color: #00AA00;">;</span>
		<span style="color: #000000; font-weight: bold;">float</span> <span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>iPhone Images</h2>
<p>Most website images are above 500 pixels wide. Due to the iPhone small size, there’s a strong chance that images will break out of the view aria. I recommend automatically re-size all website images to max 100% device width.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media screen and (max-device-width: 480px){</span>
    img<span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">max-width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Defining a Viewport</h2>
<p>The width=device-width statement allows you to define the document width as being the same than the width of the iPhone or mobile device screen.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;meta name<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;viewport&quot;</span> <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;width=device-width; initial-scale=1.0; maximum-scale=1.0;&quot;</span><span style="color: #00AA00;">&gt;</span></pre></div></div>

<h2>Font Size</h2>
<p>When you change device orientation, Safari and some other mobile browsers adjust the font size. If you’d like to prevent this effect, simply use the following CSS declaration.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">html<span style="color: #00AA00;">,</span> body<span style="color: #00AA00;">,</span> form<span style="color: #00AA00;">,</span> fieldset<span style="color: #00AA00;">,</span> p<span style="color: #00AA00;">,</span> div<span style="color: #00AA00;">,</span> h1<span style="color: #00AA00;">,</span> h2<span style="color: #00AA00;">,</span> h3<span style="color: #00AA00;">,</span> h4<span style="color: #00AA00;">,</span> h5<span style="color: #00AA00;">,</span> h6 <span style="color: #00AA00;">&#123;</span>
    -webkit-text-size-adjust<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Special Links</h2>
<p>Finally do you remember those “mailto” link that were very popular some years ago? This prefix automatically open the default email client used by the person who clicked on it. The iPhone has introduced two similar prefixes, tel and sms, which allows the person who clicked on it to phone or text automatically.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>a href=<span style="color: #483d8b;">&quot;tel:12345678900&quot;</span><span style="color: #66cc66;">&gt;</span>Call me<span style="color: #66cc66;">&lt;</span>/a<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>a href=<span style="color: #483d8b;">&quot;sms:12345678900&quot;</span><span style="color: #66cc66;">&gt;</span>Send me a text<span style="color: #66cc66;">&lt;</span>/a<span style="color: #66cc66;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/07/25/detect-iphones-ipods-and-other-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to web applications</title>
		<link>http://ozblog.com.au/2011/07/07/welcome-to-web-applications/</link>
		<comments>http://ozblog.com.au/2011/07/07/welcome-to-web-applications/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 05:25:11 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Mobile Web App]]></category>
		<category><![CDATA[Web Design and Trends]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=449</guid>
		<description><![CDATA[Introduction It hase been a few months since I last published so I thought I would start with a quick and simple one. Web applications or web apps combine the power of the Internet with the simplicity with the ease [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>It hase been a few months since I last published so I thought I would start with a quick and simple one. </p>
<p>Web applications or web apps combine the power of the Internet with the simplicity with the ease of access of the internet, all on a 3.5-inch screen. iPhone and iPod touch let you build complex web apps using CSS, JavaScript and Html. Web apps are web pages, but the iPhone and iPod add several extra CSS and HTML extensions. Web apps have the potential to be very powerful and provide similar if not greater functionality than there installed application cousins. In this quick introduction to web apps we are going to turn our simple website into a web app for the iPhone and iPod without too many headaches. We are going to keep this simple and skip over some of the more complicated Web App concepts for later tutorials.</p>
<h2>Application Icon</h2>
<p>An iPhone application is not and application unless you can launch it from your iPhone home screes. So lets start by adding an Icon to your home screen.</p>
<p>We have two ways to design a custom icon that we can add to the home screen. The first let the iPhone automatically add some visual effects to your icon (Rounded Corners, Drop Shadow, Reflective Shine), the second is provide an already designhed icon that the iPhone can display as is. For this tutorial I am going to use the second approach as I want to control the look of my icon.</p>
<p>This is the image I an using as my icon<br />
<a href="http://ozblog.com.au/files/2011/07/iconWeb.png"><img class="aligncenter size-full wp-image-462" title="iconWeb" src="http://ozblog.com.au/files/2011/07/iconWeb.png" alt="" width="57" height="57" /></a></p>
<p>now we add a link element to the webpage header</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>link rel=<span style="color: #483d8b;">&quot;apple-touch-icon-precomposed&quot;</span> href=<span style="color: #483d8b;">&quot;/iPhone.icon.png&quot;</span>/<span style="color: #66cc66;">&gt;</span></pre></div></div>

<h2>Splash Screen</h2>
<p>On iPhone OS, similar to native applications, you can specify a startup image (Splash Screen) that is displayed while your web application/website launches. By default, this image is a screenshot of the web application with the page that the user has visited the last time. If you to want customize it, add a link element to the webpage, like this:   <a href="http://ozblog.com.au/files/2011/07/splash.png"><img class="aligncenter size-full wp-image-456" title="splash" src="http://ozblog.com.au/files/2011/07/splash.png" alt="" width="320" height="460" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>link rel=<span style="color: #483d8b;">&quot;apple-touch-startup-image&quot;</span> href=<span style="color: #483d8b;">&quot;/iphone.startup.png&quot;</span><span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>The image must be a png file and its dimensions 320 x 460 pixels in portrait orientation.<br />
NOTE: this option works only if apple-mobile-web-app-capable is set to yes</p>
<h2>Hide Safari Components</h2>
<p>You don&#8217;t want the safari user interface components (e.g address bar) showing in your web app. Adding this line will hide the components.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>meta name=<span style="color: #483d8b;">&quot;apple-mobile-web-app-capable&quot;</span> content=<span style="color: #483d8b;">&quot;yes&quot;</span> /<span style="color: #66cc66;">&gt;</span></pre></div></div>

<h2>Try It Out</h2>
<p>This website uses these options. To add a website to your Home screen</p>
<ul>
<li>On your iPhone visit www.ozblog.com.au in Safari.</li>
<li>Tap the Go To icon at the bottom of the Safari window.</li>
<li>Tap Add to Home Screen.</li>
<li>Now click on the new Home Screen Icon to launch the app.</li>
</ul>
<p>I’m using wordpress so there isn’t a customization to load all site with ajax so you can see the home page like web application, but if you click on a post link you will be redirect to safari.</p>
<h2>Note &amp; Conclusion</h2>
<p>All these tips only works for web pages that have been saved to the home screens and opened from there, if you access to your website using safari you don’t have this customizations. Remember also that any new link will be open in new browser tab so you lost these settings. The best option is to develop an strongly ajax-oriented web application, so to avoid the users from stressing clicking and page refresh, allowing them to use just the “first page”</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/07/07/welcome-to-web-applications/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Line Hashing</title>
		<link>http://ozblog.com.au/2011/03/23/line-hashing/</link>
		<comments>http://ozblog.com.au/2011/03/23/line-hashing/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 06:52:00 +0000</pubDate>
		<dc:creator>Levi Putna</dc:creator>
				<category><![CDATA[Style Document Layer (.sld)]]></category>
		<category><![CDATA[Web Mapping & GIS]]></category>

		<guid isPermaLink="false">http://ozblog.com.au/?p=440</guid>
		<description><![CDATA[This example uses hatching to create a railroad style. First we draw a 5 pixel thickness grey line used as our two rail lines, second we draw a 2 pixel thickness line with the same colour as our map background [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">This example uses hatching to create a railroad style. First we draw a 5 pixel thickness grey line used as our two rail lines, second we draw a 2 pixel thickness line with the same colour as our map background (hopefully this will appear transparent) finally we add a 1 pixel perpendicular hatches.<br />
<a href="http://ozblog.com.au/files/2011/03/rail_lines.jpg"><img class="aligncenter size-full wp-image-441" title="rail_lines" src="http://ozblog.com.au/files/2011/03/rail_lines.jpg" alt="" width="590" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
   <span style="color: #66cc66;">&lt;</span>Rule<span style="color: #66cc66;">&gt;</span>
       <span style="color: #66cc66;">&lt;</span>LineSymbolizer<span style="color: #66cc66;">&gt;</span>
           <span style="color: #66cc66;">&lt;</span>Stroke<span style="color: #66cc66;">&gt;</span>
               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#333333&lt;/CssParameter&gt;</span>
               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke-width&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">5</span><span style="color: #66cc66;">&lt;</span>/CssParameter<span style="color: #66cc66;">&gt;</span>
               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke-linecap&quot;</span><span style="color: #66cc66;">&gt;</span>round<span style="color: #66cc66;">&lt;</span>/CssParameter<span style="color: #66cc66;">&gt;</span>
           <span style="color: #66cc66;">&lt;</span>/Stroke<span style="color: #66cc66;">&gt;</span>
       <span style="color: #66cc66;">&lt;</span>/LineSymbolizer<span style="color: #66cc66;">&gt;</span>
   <span style="color: #66cc66;">&lt;</span>/Rule<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>FeatureTypeStyle<span style="color: #66cc66;">&gt;</span>
   <span style="color: #66cc66;">&lt;</span>Rule<span style="color: #66cc66;">&gt;</span>
       <span style="color: #66cc66;">&lt;</span>LineSymbolizer<span style="color: #66cc66;">&gt;</span>
           <span style="color: #66cc66;">&lt;</span>Stroke<span style="color: #66cc66;">&gt;</span>
               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#FCF3EC&lt;/CssParameter&gt;</span>
               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke-width&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">3</span><span style="color: #66cc66;">&lt;</span>/CssParameter<span style="color: #66cc66;">&gt;</span>
               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke-linecap&quot;</span><span style="color: #66cc66;">&gt;</span>round<span style="color: #66cc66;">&lt;</span>/CssParameter<span style="color: #66cc66;">&gt;</span>
           <span style="color: #66cc66;">&lt;</span>/Stroke<span style="color: #66cc66;">&gt;</span>
       <span style="color: #66cc66;">&lt;</span>/LineSymbolizer<span style="color: #66cc66;">&gt;</span>
       <span style="color: #66cc66;">&lt;</span>LineSymbolizer<span style="color: #66cc66;">&gt;</span>
           <span style="color: #66cc66;">&lt;</span>Stroke<span style="color: #66cc66;">&gt;</span>
               <span style="color: #66cc66;">&lt;</span>GraphicStroke<span style="color: #66cc66;">&gt;</span>
                   <span style="color: #66cc66;">&lt;</span>Graphic<span style="color: #66cc66;">&gt;</span>
                       <span style="color: #66cc66;">&lt;</span>Mark<span style="color: #66cc66;">&gt;</span>
                           <span style="color: #66cc66;">&lt;</span>WellKnownName<span style="color: #66cc66;">&gt;</span>shape://vertline<span style="color: #66cc66;">&lt;</span>/WellKnownName<span style="color: #66cc66;">&gt;</span>
                           <span style="color: #66cc66;">&lt;</span>Stroke<span style="color: #66cc66;">&gt;</span>
                               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #808080; font-style: italic;">#333333&lt;/CssParameter&gt;</span>
                               <span style="color: #66cc66;">&lt;</span>CssParameter name=<span style="color: #483d8b;">&quot;stroke-width&quot;</span><span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">&lt;</span>/CssParameter<span style="color: #66cc66;">&gt;</span>
                           <span style="color: #66cc66;">&lt;</span>/Stroke<span style="color: #66cc66;">&gt;</span>
                       <span style="color: #66cc66;">&lt;</span>/Mark<span style="color: #66cc66;">&gt;</span>
                       <span style="color: #66cc66;">&lt;</span>Size<span style="color: #66cc66;">&gt;</span><span style="color: #ff4500;">12</span><span style="color: #66cc66;">&lt;</span>/Size<span style="color: #66cc66;">&gt;</span>
                  <span style="color: #66cc66;">&lt;</span>/Graphic<span style="color: #66cc66;">&gt;</span>
               <span style="color: #66cc66;">&lt;</span>/GraphicStroke<span style="color: #66cc66;">&gt;</span>
           <span style="color: #66cc66;">&lt;</span>/Stroke<span style="color: #66cc66;">&gt;</span>
       <span style="color: #66cc66;">&lt;</span>/LineSymbolizer<span style="color: #66cc66;">&gt;</span>
   <span style="color: #66cc66;">&lt;</span>/Rule<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/FeatureTypeStyle<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p><a href="http://ozblog.com.au/files/2011/03/rail_lines.sld_.zip">rail_lines.sld</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ozblog.com.au/2011/03/23/line-hashing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

