<?xml version="1.0" encoding="utf-8"?>
<!-- generator="Kukkaisvoima version 7" -->
<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/"
>
<channel>
<title>vmx</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi</link>
<description>Blog of Volker Mische</description>
<pubDate>Wed, 14 Jul 2010 12:33:42 +0200</pubDate>
<lastBuildDate>Wed, 14 Jul 2010 12:33:42 +0200</lastBuildDate>
<generator>http://23.fi/kukkaisvoima/</generator>
<language>en</language>
<item>
<title>How I met CouchDB
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/how-i-met-couchdb%3A2010-07-14%3Aen%2CCouchDB</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/how-i-met-couchdb%3A2010-07-14%3Aen%2CCouchDB#comments</comments>
<pubDate>Wed, 14 Jul 2010 12:33:42 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/how-i-met-couchdb%3A2010-07-14%3Aen%2CCouchDB/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>It was a Saturday in late April 2008, I was sitting on my Laptop in my 5m²
room  down under. Chatting with some German people I used to chat with for
about 8 years by that time. Suddenly I discover that
<a href="http://jan.prima.de/">Jan</a> is there, who I haven't talked with
for years. Wondering why he was in there, he replied that he wanted to brag
about his apache.org email address. This is how I found out about
<a href="http://couchdb.apache.org/">CouchDB</a>.
</p>
<p>After several long discussions with Jan I finally wrapped my head around
the document oriented concept. I was blown away, it was exactly what I would
have liked to use on so many occasions at my one year internship at a
geospatial company. Though CouchDB wasn't ready, I needed spatial indexing.
One week later I
<a href="http://vmx.cx/cgi-bin/blog/index.cgi/couchdb-and-geodata%3A2008-05-03%3Aen%2Cgeo%2CCouchDB">had
a first idea of how such an extension might look like</a>.</p>

<p>And only 2 years later I'm really involved in CouchDB and people actually
<a href="http://pdxapi.com/">start</a>
<a href="http://simonmetson.posterous.com/import-a-bunch-of-geo-location-data-into-geoc">using</a>
<a href="http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now:2010-05-03:en,CouchDB,Python,Erlang,geo">GeoCouch</a>
:) I'd like to use this blog post to thank the developers and the whole
community, it's been a great time and the
<a href="irc://irc.freenode.net/#couchdb">IRC channel</a> just kicks ass.
You all helped to make CouchDB 1.0 possible!</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/how-i-met-couchdb%3A2010-07-14%3Aen%2CCouchDB/feed/</wfw:commentRss>
</item>
<item>
<title>GeoCouch Vortrag in Augsburg
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-vortrag-in-augsburg%3A2010-07-07%3Ade%2CCouchDB%2CGeoCouch%2CErlang%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-vortrag-in-augsburg%3A2010-07-07%3Ade%2CCouchDB%2CGeoCouch%2CErlang%2Cgeo#comments</comments>
<pubDate>Wed, 07 Jul 2010 12:09:42 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>de</category>
<category>CouchDB</category>
<category>GeoCouch</category>
<category>Erlang</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-vortrag-in-augsburg%3A2010-07-07%3Ade%2CCouchDB%2CGeoCouch%2CErlang%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>Im Rahmen des Diplomandencolloquium des
<a href="http://www.geo.uni-augsburg.de/lehrstuehle/humgeo/">Lehrstuhl für
Humangeographie und Geoinformatik</a> halte ich am 19.07.2010 um 17:30 Uhr
(Raum 2125) an der <a href="http://www.uni-augsburg.de/">Uni Augsburg</a>
einen Votrag über GeoCouch. Der genaue Titel lautet:
</p>
<p>GeoCouch: Eine Erweiterung für CouchDB zur Abfrage räumlicher Daten
</p>
<p>Er richtet sich an Geographen, wird also nicht zu sehr ins Detail der
Implementierung gehen. Es sind auch keine Vorkenntnisse zum Thema CouchDB
nötig. Wer also mehr über CouchDB und GeoCouch wissen will,
ist herzlich dazu eingeladen. Danach stehe ich natürlich zu Fragen zur
Verfügung.
</p>
<p>Ich habe keine Ahnung wie groß die CouchDB Community im Raum Augsburg ist,
aber sollte jemand dieser Einladung folgen, spricht auch nichts gegen ein
anschließendes kleines CouchDB/GeoCouch/NoSQL Meetup. Am besten meldet ihr
euch bei mir per Mail, denn wenn ein paar Leute sicher kommen, werden es
sich andere bestimmt auch überlegen.</p>

<p><em>Sorry Planet CouchDB for writing in German, but this is about a talk
in German.</em></p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-vortrag-in-augsburg%3A2010-07-07%3Ade%2CCouchDB%2CGeoCouch%2CErlang%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>Bolsena hacking event
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/bolsena-hacking-event-2010%3A2010-06-11%3Aen%2CCouchDB%2CJavaScript%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/bolsena-hacking-event-2010%3A2010-06-11%3Aen%2CCouchDB%2CJavaScript%2Cgeo#comments</comments>
<pubDate>Fri, 11 Jun 2010 22:02:24 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<category>JavaScript</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/bolsena-hacking-event-2010%3A2010-06-11%3Aen%2CCouchDB%2CJavaScript%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>The <a href="http://wiki.osgeo.org/wiki/Bolsena_Code_Sprint_2010">OSGeo hacking event in Bolsena/Italy</a> was great. Many interesting people
sitting the whole day in front of their laptops surrounded by a beautiful
scenery and nice warm sunny weather. It gets even better when you get meat for
lunch and dinner.</p>

<p>I had the chance to tell people a bit more about
<a href="http://couchdb.apache.org/">CouchDB</a> and
<a href="http://github.com/couchapp/couchapp/">Couchapps</a>,</p>

<p>One project I haven't heard that much before of was
<a href="http://deegree.org/">Degree</a>. They build the whole stack of OGC services
you could imagine. For me it was of interest that they have a
blob storage in their upcoming 3.0 release. The data
isn't flattened into SQL tables but stored as blobs. This sounds like good use
for a CouchDB backend in the future.</p>

<p>I was working with <a href="http://wiki.osgeo.org/wiki/User:Simonp">Simon Pigot</a> on a
<a href="http://geonetwork-opensource.org/">GeoNetwork</a>
re-implementation
based on CouchDB using Couchapp. We got the basic stuff like putting an XML
document into the database, editing it and returning the new document, as well
as fulltext indexing with
<a href="http://github.com/rnewson/couchdb-lucene">couchdb-lucene</a>
work. Next steps are improving the JSON to XML mapping and integrating spatial
search based on <a href="http://github.com/vmx/couchdb">GeoCouch</a>.</p>

<p>The event was really enjoyable, thanks <a href="http://couch.io/">Couchio</a> for
sponsoring the trip, thanks <a href="http://www.ticheler.net/">Jeroen</a> for
organizing it, and thanks all other hackers that made it such a awesome event.
Hope to see you next year!</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/bolsena-hacking-event-2010%3A2010-06-11%3Aen%2CCouchDB%2CJavaScript%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>FOSS4G 2010: I'm speaking
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2010-im-speaking%3A2010-05-21%3Aen%2CGeoCouch%2CCouchDB%2CErlang%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2010-im-speaking%3A2010-05-21%3Aen%2CGeoCouch%2CCouchDB%2CErlang%2Cgeo#comments</comments>
<pubDate>Fri, 21 May 2010 14:11:59 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>GeoCouch</category>
<category>CouchDB</category>
<category>Erlang</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2010-im-speaking%3A2010-05-21%3Aen%2CGeoCouch%2CCouchDB%2CErlang%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<div class="figure">
  <a href="http://2010.foss4g.org">
    <img src="http://2010.foss4g.org/images/logo_145x90_speaking.jpg"
    alt="FOSS4G Conference - I'm Speaking!"  width="145" height="90"/>
 </a>
</div>

<p>I did it! I'll speak at the <a href="http://2010.foss4g.org/">FOSS4G
Conference 2010</a> (Free and Open Source Software for Geospatial Conference),
6th–9th September in Barcelona about “GeoCouch: A spatial index for CouchDB”.
As soon as the abstract is available online I'll link to it. Hope to see you
there!
</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2010-im-speaking%3A2010-05-21%3Aen%2CGeoCouch%2CCouchDB%2CErlang%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>Non-validating WKT parser for Erlang
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/non-validating-wkt-parser-for-erlang%3A2010-05-14%3Aen%2CGeoCouch%2CErlang%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/non-validating-wkt-parser-for-erlang%3A2010-05-14%3Aen%2CGeoCouch%2CErlang%2Cgeo#comments</comments>
<pubDate>Fri, 14 May 2010 20:07:38 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>GeoCouch</category>
<category>Erlang</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/non-validating-wkt-parser-for-erlang%3A2010-05-14%3Aen%2CGeoCouch%2CErlang%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>The <a href="http://www.opensearch.org/Specifications/OpenSearch/Extensions/Geo/1.0/Draft_2">upcoming OpenSearch Geo
specification</a>
will <a href="http://groups.google.com/group/opensearch/browse_thread/thread/e8cc2a298a36b998/">add support for querying with
WKT</a>
(<a href="http://en.wikipedia.org/wiki/Well-known_text">Well-Known Text</a>). As
I plan to support this specification in
<a href="http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now:2010-05-03:en,CouchDB,Python,Erlang,geo">GeoCouch</a>,
I was in need of a WKT parser written in Erlang. I tried several
ways to write this parser, but I ended up with writing it manually,
based on the ideas of the fabulous <a href="http://code.google.com/p/mochiweb/source/browse/trunk/src/mochijson2.erl">MochiWeb JSON2
Parser</a></p>

<p>The parser is meant for fast parsing, it is non-validating. This means
that it parses only valid WKT and all other strings that seem to be
valid, but are not. The grammar is simplified to (in <a href="http://www.w3.org/TR/2004/REC-xml-20040204/#sec-notation">EBNF as used for
the XML spec</a>):</p>

<pre><code>wkt ::= item | string  '(' space* item (comma item)* ')'
item ::= string (geom | list | nested_list | item | 'EMPTY')
nested_list ::= space* '(' list (comma list)* ')' | '(' nested_list+ ')'
list ::= '(' geom (comma geom)* ')'
geom ::= space* '(' coord (comma coord)* ')'
coord ::= space* number (space+ number)*
number ::= integer | float 
integer ::=  ('-' | '+')? [0-9]+
float ::= ('-' | '+')? [0-9]+ '.' [0-9]+ exponent?
exponent = 'E' ('-' | '+')? [0-9]+
string ::= [a-zA-Z]+ (space* [a-zA-Z])*
space :== #x20
comma :== ',' space*
</code></pre>

<p>I hope I got the grammar right, leave a comment if not. This means
also strings like <code>this(is(10 20), a test EMPTY)</code> would be parsed to:</p>

<pre><code>{this,[{is,[{10,20}]},{'a test',[]}]}
</code></pre>

<p>A validating parser would be much slower as it would also need to
perform checks on the geometry, e.g. for polygons whether interiors
are really within the exterior ring or not.</p>

<p>The general rule is, a list of coordinates is transformed to a tuple,
a list of coordinates to a list. The geometry name will be an
atom. Here's an example for a polygon:</p>

<pre><code>wkt:parse("POLYGON ((102 103, 204 205, 306 107, 102 103),
                    (12 13, 24 25, 36 17, 12 13),
                    (62 63, 74 75, 86 67, 62 63))").
{polygon,[[{102,103},{204,205},{306,107},{102,103}],
          [{12,13},{24,25},{36,17},{12,13}],
          [{62,63},{74,75},{86,67},{62,63}]]}
</code></pre>

<p>In case you're getting excited now, <a href="http://github.com/vmx/wkt">the source is available at Github</a>,
realeased under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT
License</a>.

<p>If someone plans to write a validating WKT parser for Erlang (please
let me know), I propose using
<a href="http://github.com/seancribbs/neotoma/">neotoma</a> it's really a nice
"<em>packrat parser-generator for Erlang for <a href="http://en.wikipedia.org/wiki/Parsing_expression_grammar">Parsing Expression
Grammars</a> (PEGs)</em>".</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/non-validating-wkt-parser-for-erlang%3A2010-05-14%3Aen%2CGeoCouch%2CErlang%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>GeoCouch: The future is now
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now%3A2010-05-03%3Aen%2CCouchDB%2CPython%2CErlang%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now%3A2010-05-03%3Aen%2CCouchDB%2CPython%2CErlang%2Cgeo#comments</comments>
<pubDate>Mon, 03 May 2010 10:29:55 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<category>Python</category>
<category>Erlang</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now%3A2010-05-03%3Aen%2CCouchDB%2CPython%2CErlang%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>An idea has become reality. Exactly two years after the
<a href="http://vmx.cx/cgi-bin/blog/index.cgi/couchdb-and-geodata:2008-05-03:en,geo,CouchDB">blog post with the initial vision</a>,
a new version of GeoCouch is finished. It's a huge step forward. The first time
the dependencies were narrowed down to <a href="http://couchdb.apache.org">CouchDB</a>
itself. No <a href="http://www.python.org">Python</a>,
no <a href="http://www.gaia-gis.it/spatialite/">SpatiaLite</a> any longer, it's pure
<a href="http://www.erlang.org">Erlang</a>. GeoCouch is tightly integrated with
CouchDB, so you'll get all the nice features you love about CouchDB.</p>

<h3>Current implementation</h3>

<p>Thanks to the feedback after the FOSS4G 2009 and
<a href="http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future:2009-12-20:en,CouchDB,Python,geo">"GeoCouch: The future" blog entry</a>"
it was clear that people prefer a simple, yet powerful and tightly integrated
approach, rather than having to many external dependencies (which was a
showstopper for quite a few people).</p>

<p>I implemented an R-tree (I call it vtree as the implementation is
subject to change a lot) from scratch. The reason why I haven't used
the <a href="http://github.com/cchandler/RTreeCouchDB">already existing R-Tree implementation available at
Github</a> is that I needed
something to learn Erlang, it doesn't contain test or examples and
that it is always a good idea to implement a data structure yourself
to understand the details/problems. My implementation is far from
being perfect but works good enough for now. The vtree is implemented
as an append-only data structure just as CouchDB's B-trees
are. Currently it doesn't support bulk insertion.</p>

<p>If you want to know details on how to create your own indexer, have a look at
my <a href="http://vmx.cx/couchdb/tutorial/indexer.html">Indexer tutorial</a>.</p>

<h3>Feature set</h3>

<p>Following the "Release early, release often" philosophy currently only points
can be inserted, the only supported query is a bounding box search. Though
other geometries should follow soon.</p>

<h3>Using GeoCouch</h3>

<p>GeoCouch is now <a href="http://github.com/vmx/couchdb/tree/geocouch">hosted
at Github</a>. Giving GeoCouch a go is easy:</p>

<pre><code>git clone http://github.com/vmx/couchdb.git
cd couchdb
./bootstrap
./configure
make dev
./utils/run
</code></pre>

<p>To try the spatial features when it's up and running is easy as well. Just add
a <code>spatial</code> property and a named function to your Design Document as you
would to for
<a href="http://wiki.apache.org/couchdb/Formatting_with_Show_and_List">show or list functions</a>:</p>

<pre><code>function(doc) {
    if (doc.loc) {
        emit(doc._id, {
            type: "Point",
            coordinates: [doc.loc[0], doc.loc[1]]
        });
    }
};
</code></pre>

<p>All you need to do is emitting <a href="http://geojson.org">GeoJSON</a> as the value
(Remember that <code>point</code> is the only supported geometry at the moment), the
key is currently ignored.</p>

<pre><code>curl -X PUT http://127.0.0.1:5984/places
curl -X PUT -d '{"spatial":{"points":"function(doc) {\n    if (doc.loc) {\n        emit(doc._id, {\n            type: \"Point\",\n            coordinates: [doc.loc[0], doc.loc[1]]\n        });\n    }};"}}' http://127.0.0.1:5984/places/_design/main
</code></pre>

<p>Before a bounding box query can return anything, you need to insert Documents
that contain a location.</p>

<pre><code>curl -X PUT -d '{"loc": [-122.270833, 37.804444]}' http://127.0.0.1:5984/places/oakland
curl -X PUT -d '{"loc": [10.898333, 48.371667]}' http://127.0.0.1:5984/places/augsburg
</code></pre>

<p>And finally you can make a bounding box request:</p>

<pre><code>curl -X GET 'http://localhost:5984/places/_design/main/_spatial/points/%5B0,0,180,90%5D'
</code></pre>

<p>This one should return only <code>augsburg</code>:</p>

<pre><code>{"query1":[{"id":"augsburg","loc":[10.898333,48.371667]}]}
</code></pre>

<h3>Next steps</h3>

<p>The development of GeoCouch was quite slow in the past, but it gets up
to speed as my diploma thesis (comparable to a master's thesis) will be
about GeoCouch. Additionally <a href="http://www.couch.io/">Couchio</a> kindly
supports the development.</p>

<p>The next steps are (in no particular order):</p>

<ul>
<li>Better R-tree (better splitting algorithm, bulk operations)</li>
<li>Supporting more geometries</li>
<li>Polygon search</li>
<li>Improving CouchDB's plugin capabilities</li>
</ul>

<h3>Thanks</h3>

<p>I'd like to thank all the people that kept me motivated over the past two
years with their tremendous feedback. Special thanks go to
<a href="http://jan.prima.de/">Jan Lehnardt</a> for getting me onto the Couch,
<a href="http://cameronshorter.blogspot.com/">Cameron Shorter</a> for introducing me
into the geospatial open source business and all people from
<a href="http://www.couch.io/">Couchio</a> for the
great two weeks in Oakland.</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now%3A2010-05-03%3Aen%2CCouchDB%2CPython%2CErlang%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>Processing PDF files: Auto advance
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/processing-pdf-files-auto-advance%3A2010-02-23%3Aen%2CPython</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/processing-pdf-files-auto-advance%3A2010-02-23%3Aen%2CPython#comments</comments>
<pubDate>Tue, 23 Feb 2010 23:16:33 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>Python</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/processing-pdf-files-auto-advance%3A2010-02-23%3Aen%2CPython/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>Sometimes you need a PDF file that auto advances (auto flip, slide show)
pages after a certain amount of seconds. For example for presenting a
<a href="http://en.wikipedia.org/wiki/Lightning_Talk">Lightning Talk</a> the
<a href="http://en.wikipedia.org/wiki/Ignite_(event)">Ingnite way</a>. There
are several ways to achieve this. Today I've spent hours to find the best way.
</p>

<p>You could just hope that your favourite PDF viewer supports changing slides
automatically in a certain interval
(<a href="http://http://projects.gnome.org/evince/">Evince</a> doesn't). But
you never know which viewer will be used when you rely on other people's
computers. The next step is obvious, try to get the PDF file itself to auto
advance. It is possible as
<a href="http://help.adobe.com/en_US/Acrobat/9.0/Standard/WS58a04a822e3e50102bd615109794195ff-7c68.w.html">Adobe
Acrobat supports such a setting</a> (it seems that even
<a href="http://pcsplace.com/tips-n-tricks/make-powerpoint-like-presentations-from-pdf-documents-with-acrobat-page-transitions/">Acrobat
Reader</a> does, though I can't find that option in my one under Linux), I just
need to find out how.
</p>

<p>After some further research I found out that Latex' hyperref package
<a href="http://agents.felk.cvut.cz/wiki/doku.php?id=tricks:latex">supports it as well</a> (no, I don't speak Czech). So I made some minimal
<a href="http://latex-beamer.sourceforge.net/">Latex Beamer</a> presentation to
give it a try. The important notice that the <code>\hypersetup{pdfpageduration=n}</code> must be the first item within a <code>\begin{frame}</code> was found
<a href="http://xavier.perseguers.ch/fileadmin/download/LaTeX/guidelines.pdf">in
some presentation guidelines</a>. Guess what? It even works with Evince (<a href="/blog/2010-02-23/beamer-autoflip.tex">tex file</a>, <a href="/blog/2010-02-23/beamer-autoflip.pdf">PDF file</a>).
</p>

<p>I'm getting closer. Though my problem is that I create my slides with
<a href="http://www.inkscape.org">Inkscape</a> (resp. <a
href="http://projects.abourget.net/inkscapeslide/">Inkscape Slide</a>), so I
can't really user Latex Beamer for it. But the previously mentioned
presentation guidelines also mention the <code>/Dur</code> entry in the PDF
page object. So it should be easy to add it manually. And it really is. A quick
search through the PDF file generated by Latex you can see that
<code>/Dur</code> occurs a close to <code>/MediaBox</code>. After adding those
<code>/Dur 2</code> to my original presentation PDF file right after
<code>\MediaBox</code> it auto flipped every 2 seconds.
</p>

<p>I could have written a simple script that adds it to the PDF at the right
place, but that sounds pretty fragile. A better approach would be to use a PDF
library that is meant for manipulating PDF files. As my favourite programming
language is Python at the moment, I came across
<a href="http://pybrary.net/pyPdf/">pyPdf</a>. A quick look at the internals
showed that it contains everything I need.</p>

<p>Here's my final solution for the problem of creating auto advancing PDF
slides. A small script that does exactly what I need (and not more). I've
used the Python 3 version of pyPdf, but the script should look similar for
Python 2.x.
</p>

<code><pre>
#!/usr/bin/env python3.1
# Copyright (c) 2010 Volker Mische (http://vmx.cx/)
# Licensed under MIT.

import sys
from pyPdf import PdfFileWriter, PdfFileReader
from pyPdf.generic import NameObject, NumberObject

def main(argv=None):
    if argv is None:
        argv = sys.argv

    if len(argv) != 4:
        print('Usage: setduration.py [duration-in-seconds] [input-pdf]',
              '[output-pdf]')
        return

    pdfin = PdfFileReader(open(argv[2], "rb"))
    pdfout = PdfFileWriter()

    for page in pdfin.pages:
        page[NameObject('/Dur')] = NumberObject(argv[1])
        pdfout.addPage(page)

    outputStream = open(argv[3], "wb")
    pdfout.write(outputStream)

if __name__ == '__main__':
    sys.exit(main())
</pre></code>

]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/processing-pdf-files-auto-advance%3A2010-02-23%3Aen%2CPython/feed/</wfw:commentRss>
</item>
<item>
<title>GeoCouch: The future
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future%3A2009-12-20%3Aen%2CCouchDB%2CPython%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future%3A2009-12-20%3Aen%2CCouchDB%2CPython%2Cgeo#comments</comments>
<pubDate>Sun, 20 Dec 2009 16:37:21 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<category>Python</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future%3A2009-12-20%3Aen%2CCouchDB%2CPython%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p><a href="http://gitorious.org/geocouch/">GeoCouch</a> started as a <a href="/cgi-bin/blog/index.cgi/geocouch-geospatial-queries-with-couchdb:2008-10-26:en,CouchDB,Python,geo">proof of concept</a> and was heavily rewritten for the <a href="/cgi-bin/blog/index.cgi/geocouch-new-release-0.10.0:2009-09-19:en,CouchDB,Python,geo">0.10 release</a>. As more and more people got interested, I got feedback to see what people really want/need. And now it's time to determine the future of GeoCouch. It's your chance to shape the future. In this blog entry I'll explain my ideas for the future, but I'm more than happy to get further ideas/complains from you. So please check if my ideas match your use-cases for GeoCouch.
</p>
<h3>Stripping it down</h3>
<p>GeoCouch needs an external spatial index, at the moment I use <a href="http://www.gaia-gis.it/spatialite/">SpatiaLite</a> for it, but a <a href="http://postgis.refractions.net/">PostGIS</a> backend would be easily possible. My inital idea was that it is better to use the existing power of spatial databases, rather than reinventing the wheel. I though I could use all the power they have, that I can even use them for complex analytics, but I can't. As I only store the geometries, I need to “ask” CouchDB for the attributes (no, I don't want to store attributes in my spatial index).
<!--This would be possible, but I'll explain the “analytics use-case” later.-->
</p>
<p>If I don't use the full power of the spatial databases, but only a small fraction, there might be better solution. Therefore I propose that GeoCouch will use a simple spatial index for storing the geometries, not a full blown spatial database. I haven't decided yet which one it'll be, but I really think about moving this part to Erlang (I know that quite a few people would love that move).
</p>
<p>You will loose functionality like reprojection. The spatial index won't know anything about projections. So GeoCouch won't be projection aware anymore, but you application still can be. For example if you want to return your data in a different projection than it was stored, you do the transformation after you've queried GeoCouch.
</p>
<p>You would also loose fancy things for geometries, like boolean operations on them. But this is something I'd call complex analytics, and not simple querying.
</p>
<p>GeoCouch would only support three simple queries: bounding search, polygon search and radius/distance search. If the search would be within a union of polygons, let's say all countries of the European Union, you would simply make the union operation before you query GeoCouch.
</p>

<h3>Complex analytics</h3>
<p>What I call “complex analytics” is things like: “return all apple trees that are located with a 10km range around buildings that have are over 100m high, but only in countries with a population over 50 million people” is not possible with GeoCouch as you would need the attribute values as well. Those are stored in CouchDB, so you would need to request them. What GeoCouch only supports is a simple: give me all IDs within a bounding box/polygon/radius.
</p>

<h3>Conclusion</h3>
<p>Simple requests are needed for everyday use, thus they should be incredibly fast. Complex analytics don't necessarily need to handle thousands of requests per second, in most cases they don't even need to be processed in real-time. I'd like to see some layer build above GeoCouch, so CouchDB can even be used for analytics (which is a thing I wanted to have right from the start).
</p>
<p>This means that GeoCouch will be mainly for high performance and massive sized projects that need some simple spatial bits, what I think the majority of users need.
</p>
<p>If you either think you really need only those simple queries, but you want them to be fast, or you think this is wrong, that you need dynamic reprojection I can only invite you to leave a comment below or drop a mail to <a href="mailto:volker.mische@gmail.com">volker.mische@gmail.com</a>. Thanks.
</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future%3A2009-12-20%3Aen%2CCouchDB%2CPython%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>FOSS4G 2009: “Geodata and CouchDB” presentation is online
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-presentation-is-online%3A2009-11-17%3Aen%2CCouchDB%2CPython%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-presentation-is-online%3A2009-11-17%3Aen%2CCouchDB%2CPython%2Cgeo#comments</comments>
<pubDate>Tue, 17 Nov 2009 11:48:43 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<category>Python</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-presentation-is-online%3A2009-11-17%3Aen%2CCouchDB%2CPython%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>The final wrap-up of the <a href="http://2009.foss4g.org/">FOSS4G 2009</a>,
<a href="http://2009.foss4g.org/presentations/#presentation_78">my presentation
on “Geodata and CouchDB”</a> is available online in several formats. It should
also be of interest for people who are new to CouchDB as huge parts of the
talk are an introduction into CouchDB.
</p>
<ul>
  <li>The raw slides
<a href="/blog/2009-11-17/geodata-and-couchdb.pdf">as PDF</a> (licensed under
<a href="http://creativecommons.org/licenses/by/3.0/de/">CC-BY-3.0-de</a>).</li>
  <li>The slides with comments
<a href="/blog/2009-11-17/geodata-and-couchdb.htm">as HTML</a> (licensed under
<a href="http://creativecommons.org/licenses/by/3.0/de/">CC-BY-3.0-de</a>).</li>
  <li>The <a href="http://www.fosslc.org/drupal/node/595">slides with audio</a>
(<a href="http://blip.tv/file/2795979">or at blib.tv</a>). It’s the
recording of the actual talk at the conference</a>. Thanks
<a href="http://georaffe.org/">Alex</a> and
<a href="http://www.fosslc.org/">FOSSLC</a> for recording it (licensed under
<a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a>).</li>
</ul>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-presentation-is-online%3A2009-11-17%3Aen%2CCouchDB%2CPython%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>Drag as long as you want
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/drag-as-long-as-want%3A2009-11-11%3Aen%2COpenLayers%2CJavaScript%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/drag-as-long-as-want%3A2009-11-11%3Aen%2COpenLayers%2CJavaScript%2Cgeo#comments</comments>
<pubDate>Wed, 11 Nov 2009 12:25:35 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>OpenLayers</category>
<category>JavaScript</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/drag-as-long-as-want%3A2009-11-11%3Aen%2COpenLayers%2CJavaScript%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>It has been a very long outstanding bug (officially it was a missing
feature) in <a href="http://www.openlayers.org/">OpenLayers</a> that annoyed
me from the first time I’ve been using OpenLayers. I’m talking about
<a href="http://trac.openlayers.org/ticket/39">ticket #39</a>: “Allow
pan-dragging while outside map until mouseup”.
</p>
<p>Normally when you drag the map in OpenLayers it will stop dragging as soon
as you hit the edge of the map viewport (the <code>div</code> that contains
the map). Whenever you have a small map, but a huge window and a loooong way to
drag, it can get quite annoying, as the maximum distance you can drag at once
is the size of that viewport.
</p>
<p>But yesterday
<a href="http://openlayers.org/pipermail/commits/2009-November/009095.html">it
finally happend</a>. A patch to fix it landed in trunk. A first rough cut was
made at the
<a href="http://openlayers.org/blog/2009/10/26/openlayers-at-the-foss4g-code-sprint/">OpenLayers
code sprint at the FOSS4G</a>.
<a href="http://wiki.osgeo.org/wiki/User:Ahocevar">Andreas Hocevar</a> reviewed
the code and made a more unobtrusive version of it (thanks, again).
</p>
<p>Try these two examples to see the difference. Click on the map an drag it a
long way to the right and back to the left again (you might need to zoom it a bit to see the full effect):
<ul>
  <li><a href="http://openlayers.org/dev/examples/lite.html">default
behaviour</a></li>
  <li><a href="http://openlayers.org/dev/examples/document-drag.html">documentDrag behaviour</a></li>
</ul>
<p>As it is a new feature, it isn’t enabled by default (and only available on
current SVN trunk, it will be available in OpenLayers 2.9). To enable it on
 your map, just use the following code to add the <code>documentDrag</code>
parameter to the
<a href="http://dev.openlayers.org/docs/files/OpenLayers/Control/DragPan-js.html">DragPan control</a> (you obviously need a recent SVN checkout).
<p><strong>Update</strong> (2009-11-18): It got even easier with
<a href="http://openlayers.org/pipermail/commits/2009-November/009109.html">r9805</a>:
</p>
<p>
  <pre>
<code>// Use default controls but with documentDrag enabled.
var controls = [
    new OpenLayers.Control.Navigation({documentDrag: true}),
    new OpenLayers.Control.PanZoom(),
    new OpenLayers.Control.ArgParser(),
    new OpenLayers.Control.Attribution()]
map = new OpenLayers.Map('map', {controls: controls});
</code></pre>
</p>
<p>For a full working version have a look at
<a href="http://svn.openlayers.org/trunk/openlayers/examples/document-drag.html">the
source of the documentDrag example</a>.
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/drag-as-long-as-want%3A2009-11-11%3Aen%2COpenLayers%2CJavaScript%2Cgeo/feed/</wfw:commentRss>
</item>
</channel>
</rss>
