<?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>Mateusz Loskot &#187; osgeo</title>
	<atom:link href="http://mateusz.loskot.net/category/osgeo/feed/" rel="self" type="application/rss+xml" />
	<link>http://mateusz.loskot.net</link>
	<description>Into the Source of Software for Geospatial</description>
	<lastBuildDate>Wed, 10 Mar 2010 10:18:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Boost.Geometry and macros made by Apple</title>
		<link>http://mateusz.loskot.net/2010/03/10/cc-macros-made-by-apple/</link>
		<comments>http://mateusz.loskot.net/2010/03/10/cc-macros-made-by-apple/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 00:48:39 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[boost]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[boost.geometry]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[macros]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1984</guid>
		<description><![CDATA[I have no pleasure continuing my macros are evil tales but the life of C++ programmer eagerly wants to writes add another chapter to the story. Today, it&#8217;s time to rant on Apple and its XCode.
One of Boost Geometry (aka GGL) users, Mark, reported that he can not compile his program using the library with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://trac.osgeo.org/ggl/"><img src="/images/logos/ggl-logo.png" alt="Boost Geometry (aka Generic Geometry Library, GGL)"  width="200" height="80" align="left" border="0" style="margin: 5px" /></a>I have no pleasure continuing my <a href="/&#038;p=1755">macros are evil tales</a> but the life of C++ programmer eagerly wants to writes add another chapter to the story. Today, it&#8217;s time to rant on <a href="http://www.apple.com">Apple</a> and its <a href="http://en.wikipedia.org/wiki/XCode">XCode</a>.</p>
<p>One of <a href="http://trac.osgeo.org/ggl/">Boost Geometry</a> (aka GGL) users, Mark, <a href="http://lists.osgeo.org/pipermail/ggl/2010-March/000649.html">reported</a> that he can not compile his program using the library with GNU C++ compiler from XCode. The compiler throws mysterious complain of a very low-level nature of C++ programming language:</p>
<pre>Expected unqualified-id before 'do' in
/usr/local/include/boost_1_42_0/boost/geometry/geometries/concepts/check.hpp</pre>
<p>Thanks to <a href="http://lists.osgeo.org/pipermail/ggl/2010-March/000653.html">follow-up by Stjepan</a> we quickly know who to blame for that. It is XCode header <code>AssertMacros.h</code>. It even might be <a href="http://www.opensource.apple.com/source/xnu/">one of public headers</a> from development package of <a href="http://en.wikipedia.org/wiki/XNU">XNU</a>, the Mac OS X kernel, what&#8217;s even more fun.</p>
<h3>What actually happens that causes the problem?</h3>
<p>Boost Geometry defines function template for concept checking:</p>
<pre><code>template &lt;typename Geometry&gt;
inline void check()
{
    detail::checker&lt;Geometry, boost::is_const&lt;Geometry&gt;::type::value&gt; c;
    boost::ignore_unused_variable_warning(c);
}</code></pre>
<p>Apple XCode defines macro using exactly the same name as the function <code>check</code>. The C++ preprocessor, which operates before compiler, substitutes the name <code>check</code> with content of the macro. For the Boost Geometry function <code>check</code> it means that a pile of garbage is injected in place were the function name is expected:</p>
<pre><code>template &lt;typename Geometry&gt;
inline void do { if ( __builtin_expect(!(), 0) ) { DebugAssert('?*?*',
0, "Third Party Client" ": " "", 0, 0, "/usr/local/include/boost/
geometry/geometries/concepts/check.hpp", 181, (void*)0); } } while ( 0 )
{
     detail::checker<geometry , boost::is_const<Geometry>::type::value> c;
     boost::ignore_unused_variable_warning(c);
}</geometry></code></pre>
<p>Obviously, it makes compiler to give up to instantiate the <code>check</code> function from the template and to compile it properly.</p>
<p>C/C++ macros are evil, however, not by design but by insanity of programmers. Every macro defined in a public C/C++ header, should be defined using <em>as unique as possible, but still usable</em> name. I wish Apple folks designed their C/C++ macros as unique as they make their hardware products, even if <a href="http://en.wikipedia.org/wiki/Made_in_China#Marketing_significance">made in China</a> eventually. This particular macro that caused the problems discussed here, could be named to <code>APPLE_XNU_CHECK</code> and life would be easier. Or, given the fact that <a href="https://svn.boost.org/trac/boost/ticket/2115#comment:7">almost 3000 files using these identifiers</a> live in <a href="http://www.boost.org">Boost C++ Libraries</a> only, I probably should say: life would be more productive, efficient and cheaper.</p>
<p>By the way, it&#8217;s a known problem @ Boost and it looks Boost Folks are trying to figure out best solution. See ticket <a href="https://svn.boost.org/trac/boost/ticket/2115">#2115 &#8211; Avoid bad Apple macros</a>.</p>
<p>&#8230;to be continued</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/03/10/cc-macros-made-by-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AX_LIB_LIBKML macro</title>
		<link>http://mateusz.loskot.net/2010/03/04/ax_lib_libkml-macro/</link>
		<comments>http://mateusz.loskot.net/2010/03/04/ax_lib_libkml-macro/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 00:10:11 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[gdal]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[autoconf]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[libkml]]></category>
		<category><![CDATA[macro]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1942</guid>
		<description><![CDATA[Recently, I was playing for a while with Brian&#8217;s new OGR LIBKML driver and I integrated it with GDAL/OGR build system, so it&#8217;s more convenient to build, test and use it. The complete tree is available in GDAL sandbox in mloskot/winkey-libkml. (It is just a give it a try-like prototype and I don&#8217;t actively maintain [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was playing for a while with <a href="http://lists.osgeo.org/pipermail/gdal-dev/2010-February/023718.html">Brian</a>&#8217;s new <a href="http://winkey.org/svn/libkml/">OGR LIBKML driver</a> and I integrated it with <a href="http://www.gdal.org/ogr/">GDAL/OGR</a> build system, so it&#8217;s more convenient to build, test and use it. The complete tree is available in GDAL sandbox in <a href="https://svn.osgeo.org/gdal/sandbox/mloskot/winkey-libkml/">mloskot/winkey-libkml</a>. (It is just a <em>give it a try</em>-like prototype and I don&#8217;t actively maintain this branch myself. Hopefully, Brian will take it over.)</p>
<p>By the way, I crafted <a href="http://github.com/mloskot/workshop/blob/master/autotools/macros/ax_lib_libkml.m4">AX_LIB_LIBKML</a> macro for <a href="http://www.gnu.org/software/autoconf/">Autoconf</a>. This macros checks for headers and libraries of specified version (or newer) of Google <a href="http://code.google.com/p/libkml/">libkml</a> library and defines compilation and linking flags.</p>
<p>I <a href="http://savannah.gnu.org/patch/index.php?7109">submitted the macro</a> to <a href="http://www.gnu.org/software/autoconf-archive/">GNU Autoconf Archive</a>. It is the new incarnation of well-known <a href="http://autoconf-archive.cryp.to">autoconf-archive.cryp.to</a>. Peter Simons <a href="http://lists.gnu.org/archive/html/autoconf-archive-maintainers/2009-12/msg00000.html">announced</a> not long time ago that</p>
<blockquote><p>The archive has moved to Savannah: <a href="http://www.nongnu.org/autoconf-archive/">http://www.nongnu.org/autoconf-archive/</a>. Version 2009-04-26 was the last to be released at autoconf-archive.cryp.to.</p></blockquote>
<p>Happy detecting libkml!</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/03/04/ax_lib_libkml-macro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Const-correctness schizophrenia in GDAL</title>
		<link>http://mateusz.loskot.net/2010/03/04/const-correctness-schizophrenia-in-gdal/</link>
		<comments>http://mateusz.loskot.net/2010/03/04/const-correctness-schizophrenia-in-gdal/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 23:23:59 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[gdal]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1951</guid>
		<description><![CDATA[Const-correctness rants are quite common topic of chats on #gdal IRC channel. Some of the pearls I&#8217;ve got printed in to my mind:
A: The lesson is I ought to get things right the first time.
B: The issue with const method is that if you want to add lazy loading later, it can cause problems
C: GDAL [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Const-correctness">Const-correctness</a> rants are quite common topic of chats on <a href="irc://irc.freenode.net/#gdal">#gdal</a> IRC channel. Some of the pearls I&#8217;ve got printed in to my mind:</p>
<blockquote><p><strong>A</strong>: The lesson is I ought to get things right the first time.<br />
<strong>B</strong>: The issue with <code>const</code> method is that if you want to add lazy loading later, it can cause problems<br />
<strong>C</strong>: GDAL is rather painful to use with <code>const</code> correct code, unfortunately :(<br />
<strong>B</strong>: The solution is obvious: don&#8217;t write <code>const</code> correct code</p></blockquote>
<p>Who&#8217;s right then, A or B?</p>
<p>I recall another motto from #gdal channel that sounds like <em>&#8220;when unsure, do nothing&#8221;</em> which has the following rationale:</p>
<blockquote><p>especially when I realize afterwards that I&#8217;ve f**cked things because I neglected to follow the motto</p></blockquote>
<p>Remembering these recommendations, it&#8217;s pretty clear why <em>the const-mess</em> in <a href="http://www.gdal.org">GDAL</a> has happened. I&#8217;d conclude paraphrasing the motto this way:</p>
<blockquote><p>I&#8217;ve f**cked things because I neglected to make a decision.</p></blockquote>
<p>Now, poor <a href="http://lists.osgeo.org/pipermail/gdal-dev/2010-March/023776.html">GDAL beginner deadpickle</a>, trying to find out (<a href="http://lists.osgeo.org/pipermail/gdal-dev/2010-March/023781.html">it&#8217;s me the evil</a>) why compiler complains about his not-that-bad-written code, <a href="http://groups.google.co.uk/group/comp.lang.c/browse_thread/thread/41e53e9bb82de6ec">wandered to find and ask C gurus</a> @ <a href="http://groups.google.com/group/comp.lang.c">comp.lang.c</a> and got the problem explained by Malcolm who wrote:</p>
<blockquote><p>The problem is that, when C was first developed, there was no const keyword. So strings literal, which are constant, had to be non-const for backwards compatibility. This means that lots of programmers get lazy and omit the const, even from functions which don&#8217;t modify their string arguments. (There are also some subtle problems with const which means that this isn&#8217;t always a case of pure laziness). So a sort of solution is to discard the const qualifiers. However this is perpetuating the problem in your own code. </p></blockquote>
<p>The motto stays in contradiction to a well-known best practice of <a href="http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.3">const correct sooner than later</a>. It&#8217;s way easier and cheaper to remove const-correctness once it turns out it does not express properly the actual design and contract than to apply it to existing codebase. Sometimes, the latter is even not possible making things <em>f**cked up twice, in existing code base and in client&#8217;s code</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/03/04/const-correctness-schizophrenia-in-gdal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CMake interview for FLOSS Weekly at 4:30 EST</title>
		<link>http://mateusz.loskot.net/2010/03/03/cmake-interview-for-floss-weekly-at-430-est/</link>
		<comments>http://mateusz.loskot.net/2010/03/03/cmake-interview-for-floss-weekly-at-430-est/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 21:36:47 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[cmake]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Bill Hoffman]]></category>
		<category><![CDATA[floss]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1936</guid>
		<description><![CDATA[Bill Hoffman just notified on the CMake mailing list:
At 4:30, I am going to be interviewed for FLOSS Weekly.
The chat is here:
http://irc.twit.tv/
The video is here:
http://live.twit.tv/
Should be going on some time around 4:30 EST.
It&#8217;s on now.

UPDATE: FLOSS Weekly 111: CMake archived audio podcast
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cmake.org/pipermail/cmake/2010-March/035591.html">Bill Hoffman just notified</a> on the CMake mailing list:</p>
<blockquote><p>At 4:30, I am going to be interviewed for FLOSS Weekly.<br />
The chat is here:<br />
<a href="http://irc.twit.tv/">http://irc.twit.tv/</a><br />
The video is here:<br />
<a href="http://live.twit.tv/">http://live.twit.tv/</a><br />
Should be going on some time around <a href="http://www.timeanddate.com/library/abbreviations/timezones/na/est.html">4:30 EST</a>.</p></blockquote>
<p>It&#8217;s on now.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="320" id="utv30564"><param name="flashvars" value="autoplay=false&amp;brand=embed&amp;cid=1524"/><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="movie" value="http://www.ustream.tv/flash/live/1/1524"/><embed flashvars="autoplay=false&amp;brand=embed&amp;cid=1524" width="400" height="320" allowfullscreen="true" allowscriptaccess="always" id="utv30564" name="utv_n_936132" src="http://www.ustream.tv/flash/live/1/1524" type="application/x-shockwave-flash" /></object></p>
<p>UPDATE: <a href="http://twit.tv/floss111">FLOSS Weekly 111: CMake</a> archived audio podcast</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/03/03/cmake-interview-for-floss-weekly-at-430-est/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIS-Lab joins Planet OSGeo</title>
		<link>http://mateusz.loskot.net/2010/02/27/gis-lab-joins-planet-osgeo/</link>
		<comments>http://mateusz.loskot.net/2010/02/27/gis-lab-joins-planet-osgeo/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 23:21:19 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[gis]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[gis-lab]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1930</guid>
		<description><![CDATA[Maxim Dubinin syndicated GIS-Lab blog with the Planet OSGeo aggregator.
A few words about GIS-Lab from their website:
GIS-Lab &#8211; informal non-commercial community of GIS/RS specialists, we grow ourselves and help grow others.
GIS-Lab exists since April 2002 as an independent online resource specializing in geographic information systems (GIS) and remote sensing (RS). At present, the site is [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/logos/osgeo-logo.png" width="123" height="52" alt="OSGeo Foundation" align="left" border="0" style="margin: 5px" /><a href="http://silvis.forest.wisc.edu/people/dubinin.asp">Maxim Dubinin</a> syndicated <a href="http://gis-lab.info/">GIS-Lab</a> blog with the <a href="http://planet.osgeo.org">Planet OSGeo</a> aggregator.</p>
<p>A few words <a href="http://gis-lab.info/about-eng.html">about GIS-Lab</a> from their website:</p>
<blockquote><p>GIS-Lab &#8211; informal non-commercial community of GIS/RS specialists, we grow ourselves and help grow others.</p>
<p>GIS-Lab exists since April 2002 as an independent online resource specializing in geographic information systems (GIS) and remote sensing (RS). At present, the site is primarily oriented towards Russian-speaking GIS community, however, we do our best to translate as many materials as possible into English.</p></blockquote>
<p>The GIS-Lab is the very first blog in Russian language syndicated with the Planet OSGeo, what makes the planet yet more international geo-caffee.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/02/27/gis-lab-joins-planet-osgeo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SqlGeometry and POINT EMPTY in WKB</title>
		<link>http://mateusz.loskot.net/2010/02/26/sqlgeometry-and-point-empty-in-wkb/</link>
		<comments>http://mateusz.loskot.net/2010/02/26/sqlgeometry-and-point-empty-in-wkb/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 22:53:29 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[postgis]]></category>
		<category><![CDATA[visual c#]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1914</guid>
		<description><![CDATA[Inspired by question Paul Ramsey asked today morning on IRC, I&#8217;ve inspected what kind of Well-Known-Binary output gives SqlGeometry for EMPTY geometries of all the seven geometry types as specified in OGC SFS. The SqlGeometry class is available from SQL Server System CLR Types for .NET Framework. Here we go.
I checked Well-Known-Binary output as returned [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by question <a href="http://www.cleverelephant.ca/index.html">Paul Ramsey</a> asked today morning on IRC, I&#8217;ve inspected what kind of Well-Known-Binary output gives <a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.types.sqlgeometry%28SQL.105%29.aspx">SqlGeometry</a> for <code>EMPTY</code> geometries of all the seven geometry types as specified in OGC SFS. The <code>SqlGeometry</code> class is available from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=228DE03F-3B5A-428A-923F-58A033D316E1">SQL Server System CLR Types</a> for .NET Framework. Here we go.</p>
<p>I checked Well-Known-Binary output as returned by the SqlGeometry method <a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.types.sqlgeometry.stasbinary%28SQL.105%29.aspx">STAsBinary()</a>. Here is a small test program written in C#:</p>
<pre><code>using System;
using System.Linq;
using Microsoft.SqlServer.Types;
namespace SqlGeometryEmpty
{
  class Test
  {
    static void Main(string[] args)
    {
      foreach (string type in
         Enum.GetNames(typeof(OpenGisGeometryType)))
      {
        string wkt = type.ToUpper() + " EMPTY";
        SqlGeometry geom = SqlGeometry.Parse(wkt);
        byte[] wkb = geom.STAsBinary().Buffer;
        string wkbhex = string.Join("",
          wkb.Select(
            b => b.ToString("X2")).ToArray());

        Console.WriteLine("{0}\n{1} ({2} bytes)\n",
          wkt, wkbhex, wkb.Length);
      }
    }
  }
}</code></pre>
<p>The first observation is that WKB of <code>EMPTY</code> geometry for all types is returned as a a slightly different binary. All the binary forms are truncated to <strong>nine bytes</strong>. The <strong>first byte</strong> indicates endianness as expected. The <strong>second</strong> chunk of <strong>four bytes</strong> indicate geometry type. It is exactly as defined in OGC specifications. The <strong>third</strong> chunk of remaining <strong>four bytes</strong> are set to Zero and seem to play a role of size specifier: number of points in <code>LINESTRING</code> or number of rings in <code>POLYGON</code>, number of points in <code>MULTIPOINT</code>, and so on. This makes another observation that WKB for EMPTY is reported as a collection of primitive components.</p>
<p>The difference in binary of WKB of EMPTY geometry I mentioned is in that the actual type of input geometry is preserved, so there seems to be no implicit translation to geometry of some other type.</p>
<p>So far so good but not for too long. In fact, <code>SqlGeometry</code> implicitly <em>casts</em> <code>POINT EMPTY</code> to <code>MULTIPOINT EMPTY</code> geometry with the WKB of the following form (in hex):</p>
<pre>010400000000000000</pre>
<p>Here is complete output of the test program above:</p>
<pre>POINT EMPTY
010400000000000000 (9 bytes)

LINESTRING EMPTY
010200000000000000 (9 bytes)

POLYGON EMPTY
010300000000000000 (9 bytes)

MULTIPOINT EMPTY
010400000000000000 (9 bytes)

MULTILINESTRING EMPTY
010500000000000000 (9 bytes)

MULTIPOLYGON EMPTY
010600000000000000 (9 bytes)

GEOMETRYCOLLECTION EMPTY
010700000000000000 (9 bytes)</pre>
<p>A word about how <a href="http://www.postgis.org/">PostGIS</a> behaves. PostGIS reports <code>GEOMETRYCOLLECTION EMPTY</code>, regardless of actual type of input <code>EMPTY</code> geometry. It is in hex form:</p>
<pre>010700000000000000</pre>
<p>Generally, there is not many choices of how to report EMPTY geometry in clear and usable way and a form of collection with size equal to Zero seems to be the most appropriate choice. <code>POINT EMPTY</code> reported with type set to <code>POINT</code> (010100000000000000) would be ambiguous as <em>feels</em> like truncated or invalid form of <code>POINT(0 0)</code>, especially in programming languages like C where native dynamic allocated arrays do not carry information about their size. IOW, geometry type is not enough information to process binary form of <code>POINT EMPTY</code> properly.</p>
<p>Reporting <code>EMPTY</code> geometries as a collection is a useful convention that seems to work well. PostGIS behaves about it in the very consistent manner reporting one type for all <em>empties</em>. SqlGeometry, so SQL Server, forces programmers to write a few more lines of code to handle all the possible cases. Yet another <del datetime="2010-02-26T22:41:25+00:00">original</del> exotic solution from Microsoft.</p>
<p>Consistent API is a bless!</p>
<p>Update: consistent specification of interface is even better.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/02/26/sqlgeometry-and-point-empty-in-wkb/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>OSGeo Thai Chapter and OTB Team join the planet</title>
		<link>http://mateusz.loskot.net/2010/02/23/osgeo-thai-chapter-and-otb-team-join-the-planet/</link>
		<comments>http://mateusz.loskot.net/2010/02/23/osgeo-thai-chapter-and-otb-team-join-the-planet/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 20:55:51 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[gis]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[planet]]></category>
		<category><![CDATA[planet osgeo]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1908</guid>
		<description><![CDATA[I&#8217;m pleased to announce two new blogs I have just syndicated with the Planet OSGeo aggregator.
It is:

Chaipat Nengcomma posts content that a part of Thai OSGeo local chapter about FOSS4G distribution in Thailand
OTB Team developing the Orffeo Toolbox &#8211; a library of image processing algorithms developed by CNES in the frame of the ORFEO Accompaniment [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/logos/osgeo-logo.png" width="123" height="52" alt="OSGeo Foundation" align="left" border="0" style="margin: 5px" />I&#8217;m pleased to announce two new blogs I have just syndicated with the <a href="http://planet.osgeo.org/">Planet OSGeo</a> aggregator.</p>
<p>It is:</p>
<ul>
<li><a href="http://emap.wordpress.com/">Chaipat Nengcomma</a> posts content that a part of <a href="http://wiki.osgeo.org/wiki/Thai">Thai OSGeo</a> local chapter about FOSS4G distribution in Thailand</li>
<li><a href="http://blog.orfeo-toolbox.org/">OTB Team</a> developing the <a href="http://www.orfeo-toolbox.org/otb/">Orffeo Toolbox</a> &#8211; a library of image processing algorithms developed by CNES in the frame of the ORFEO Accompaniment Program.</li>
</ul>
<p>Welcome to the Planet OSGeo!</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/02/23/osgeo-thai-chapter-and-otb-team-join-the-planet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Boost Geometry list eNabbled</title>
		<link>http://mateusz.loskot.net/2010/02/13/boost-geometry-list-enabbled/</link>
		<comments>http://mateusz.loskot.net/2010/02/13/boost-geometry-list-enabbled/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 21:23:12 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[boost]]></category>
		<category><![CDATA[ggl]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[boost.geometry]]></category>
		<category><![CDATA[nabble]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1885</guid>
		<description><![CDATA[For those who are interested in the subject and prefer Web-based discussion forums, I added the Boost Geometry (aka GGL) mailing list to the Nabble as Boost Geometry forum.
Update: Thanks to Hugo from Nabble for importing all archives of the ggl mailing list.
]]></description>
			<content:encoded><![CDATA[<p>For those who are interested in the subject and prefer Web-based discussion forums, I added the <a href="http://trac.osgeo.org/ggl/">Boost Geometry</a> (aka GGL) <a href="http://lists.osgeo.org/mailman/listinfo/ggl">mailing list</a> to the Nabble as <a href="http://n3.nabble.com/Boost-Geometry-f203548.html">Boost Geometry</a> forum.</p>
<p>Update: Thanks to Hugo from Nabble for importing all archives of the ggl mailing list.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/02/13/boost-geometry-list-enabbled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Git with GDAL repository</title>
		<link>http://mateusz.loskot.net/2010/02/13/using-git-with-gdal-repository/</link>
		<comments>http://mateusz.loskot.net/2010/02/13/using-git-with-gdal-repository/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 21:15:26 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[gdal]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1878</guid>
		<description><![CDATA[I have mirrored Subversion trunk of GDAL repository on Gitorious &#8211;  a free hosting for collaborating on distributed open source projects. It is available as svn-trunk repository of gdal project.
The main motivation is that it simplifies development of experiments in case one needs version control or complete disconnection from SVN trunk for some period. [...]]]></description>
			<content:encoded><![CDATA[<p>I have mirrored Subversion <a href="http://svn.osgeo.org/gdal/trunk/">trunk</a> of GDAL repository on <a href="http://gitorious.org/">Gitorious</a> &#8211;  a free hosting for collaborating on distributed open source projects. It is available as <a href="http://gitorious.org/gdal/svn-trunk">svn-trunk</a> repository of <a href="http://gitorious.org/gdal/">gdal</a> project.</p>
<p>The main motivation is that it simplifies development of experiments in case one needs version control or complete disconnection from SVN trunk for some period. Thanks to git-svn, it is possible to push changes back to the trunk.</p>
<p>I outlined the process of maintaining GDAL trunk using Git in the Wiki article <a href="http://trac.osgeo.org/gdal/wiki/UsingGitToMaintainGDALWorkflow">Using Git To Maintain GDAL Workflow</a>.</p>
<p>The synchronization is not a time consuming process at all but even that I hope to make it automatic process in near future. First, I have to ship <a href="http://mateusz.loskot.net/?p=869">my little personal server</a> to <em>a remote data centre</em> and I&#8217;m hoping to do it next week. Lucky bastard going to bask in the warm sun of Portugal :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/02/13/using-git-with-gdal-repository/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Preparing Quickbook for Boost.Geometry</title>
		<link>http://mateusz.loskot.net/2010/02/07/preparing-quickbook-for-boost-geometry/</link>
		<comments>http://mateusz.loskot.net/2010/02/07/preparing-quickbook-for-boost-geometry/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:33:24 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[boost]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[ggl]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[boost.geometry]]></category>
		<category><![CDATA[concepts]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[quickbook]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=1840</guid>
		<description><![CDATA[I&#8217;ve just started writing Boost.Geometry (aka GGL) documentation in Quickbook. It is a lightweight format and parser being developed by Boost used to prepare technical documentation for software, mainly for for Boost C++ Libraries. Quickbook files (.qbk) are used as input for BoostDoc which in turn is an extension of DocBook.
Quickbook is a textual format, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://trac.osgeo.org/ggl/"><img src="/images/logos/ggl-logo.png" alt="Generic Geometry Library (GGL)"  width="200" height="80" align="left" border="0" style="margin: 5px" /></a>I&#8217;ve just <a href="http://lists.osgeo.org/pipermail/ggl/2010-February/000592.html">started</a> writing <a href="http://thread.gmane.org/gmane.comp.lib.boost.devel/197108">Boost.Geometry</a> (aka <a href="http://trac.osgeo.org/ggl/">GGL</a>) documentation in <a href="http://www.boost.org/doc/tools/quickbook/index.html">Quickbook</a>. It is a lightweight format and parser being developed by Boost used to prepare technical documentation for software, mainly for for <a href="http://www.boost.org">Boost C++ Libraries</a>. Quickbook files (<a href="http://www.boost.org/doc/libs/1_42_0/tools/quickbook/doc/quickbook.qbk">.qbk</a>) are used as input for <a href="http://www.boost.org/doc/html/boostbook.html">BoostDoc</a> which in turn is an extension of <a href="http://www.docbook.org/">DocBook</a>.</p>
<p>Quickbook is a textual format, it feels quite similar to <a href="http://en.wikipedia.org/wiki/AsciiDoc">AsciiDoc</a> or some sort of <a href="http://en.wikipedia.org/wiki/Wiki">Wiki</a> dialect but dedicated for documenting C++ programming. It is extremely easy to grasp while drinking a single short coffee.</p>
<p>Anyway, it seems it is going to be a quite a book after all elements of Boost.Geometry are documented. One of the challenge I&#8217;ve found is to collect all bits necessary to document <a href="http://www.devx.com/SpecialReports/Article/38864">C++ concepts</a> defined by Boost.Geometry. Unfortunately, <a href="http://www.doxygen.org">Doxygen</a> is not an ideal tool for this purpose, so <a href="http://geometrylibrary.geodan.nl/">current version</a> of the documentation lacks of some sections of concepts description. So, I have to dig the source code to find out formal definitions and details of valid expressions and semantics.</p>
<p>Another challenge related to concepts is to find best way to structure their documentation. I started to browse documentation of existing Boost libraries looking for examples and what I found is that there is no best example. Various libraries document concepts in very different way.</p>
<blockquote><p>A concept is a set of requirements consisting of valid expressions, associated types, invariants, and complexity guarantees</p></blockquote>
<p>&#8211; <a href="http://en.wikipedia.org/wiki/David_Abrahams_%28computer_programmer%29">David Abrahams</a>, <a href="http://www.boost.org/community/generic_programming.html">Generic Programming Techniques</a></p>
<p>For example, neatly <a href="http://www.boost.org/doc/libs/1_42_0/libs/fusion/doc/html/fusion/iterator/concepts/forward_iterator.html">Boost.Fusion</a> documents concepts with Quickbook, though some elements seem to be omitted. <a href="http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/IncidenceGraph.html">Boost.Graph</a> doesn&#8217;t document with Quickbook, looks good, but some details are missing to me, for instance, titles in headers of tables saying what is what is return type and pre-/post-condition for valid expressions, etc. Documentation of <a href="http://www.boost.org/doc/libs/1_42_0/libs/iostreams/doc/concepts/source.html">Boost.IOStreams</a> concepts sound well. On the other hand, <a href="http://www.boost.org/doc/libs/1_42_0/libs/gil/doc/html/g_i_l_0212.html">Boost.GIL</a> is an <em>example of why Doxygen should not be used</em> to document concepts of a C++ library.</p>
<p>It looks to me the old good <a href="http://www.sgi.com/tech/stl/">Standard Template Library Programmer&#8217;s Guide</a> at SGI is still a <em>best and most complete example</em> of how <a href="http://www2.research.att.com/~bs/C++0xFAQ.html#std-thread">C++ concepts</a> should be documented.</p>
<p>Given these experiences, I started to think of a way to improve the way concepts are documented within Boost. I believe it would be a good idea to have predefined block for concept in Quickbook. Something along these lines:</p>
<pre>[concepttype [Point Concept]
  [this is a concept for 0-dimensional geometry]
  [notation
    [term 1] [description 1]
  ]
  [refinement [concept 1] [concept 2]]
  [associated
    [type 1] [description 1]
  ]
  [expressions
    [name 1 [expr 1]
      [type requirement 1] [return type 1]
  ]
  [semantics
    [name 1 [expr 1]
      [precondition 1] [semantic 1] [postcondition 1]
  ]
  [complexity [...]]
  [invariants
    [invariant 1] [description 1]
  ]
  [models [model 1] [model 2]]
  [notes
    [ note 1] [ note 1]
  ]
  [seealso ...]
]</pre>
<p>I <a href="http://lists.boost.org/MailArchives/boost-docs/2010/02/3976.php">posted</a> my proposal to boost-docs list explaining the motivation in details. It&#8217;s an interesting experience of a C++ documentation craftsman, anyway. (BTW, Daniel James just <a href="http://lists.boost.org/MailArchives/boost-docs/2010/02/3974.php">announced</a> Quickbook port to <a href="http://boost-spirit.com/">Spirit 2</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2010/02/07/preparing-quickbook-for-boost-geometry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
