<?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: en</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi</link>
<description>Blog of Volker Mische</description>
<pubDate>Tue, 23 Feb 2010 23:16:33 +0200</pubDate>
<lastBuildDate>Tue, 23 Feb 2010 23:16:33 +0200</lastBuildDate>
<generator>http://23.fi/kukkaisvoima/</generator>
<language>en</language>
<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>
<item>
<title>Australia: Getting home
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/australia-getting-home%3A2009-11-02%3Aen%2Clife</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/australia-getting-home%3A2009-11-02%3Aen%2Clife#comments</comments>
<pubDate>Mon, 02 Nov 2009 23:04:54 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>life</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/australia-getting-home%3A2009-11-02%3Aen%2Clife/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>This one goes out to all the people that want some news from me. I’m finally
back in Germany, but getting home wasn’t as easy as excpected. Now I know why
you really should be  at the airport 2-3 hours before your departure.
</p>
<p>I have to admit I wasn’t too early at the airport, probably 2.5 hours prior
to my departure, as everything on my previous flights went smoothly every
time. But this time there was something different.
</p>
<p>Originally I wanted to stay only for s week, but I decided to extend my stay
to two weeks. This was about 7 weeks ago. Everything seemed to be alright, I
got my new flight details via email (as I did for other flights as well).
</p>

<h3>Houston, we have a problem</h3>
<p><blockquote>“Sir, have you changed your booking recently?”</blockquote>
</p>
<p><blockquote>“Hmm, well, no, errr, no, sorry I changed it about 7 weeks
ago.”</blockquote>
</p>
<p>The conversation went on for a bit, with the conclusion that I neither have
an <a href="http://en.wikipedia.org/wiki/Electronic_ticket">e-ticket</a>
number, nor that I’m listed on the flight. There's only a booking with mine
name for last week’s date.
<em>Excellent</em>.
</p>
<p>So I couldn’t check-in and the lady at the counter couldn’t do anything. I
should contact my travel agency. Aaaaalright, it’s not a problem it’s 5:30&#160;am in
Berlin (where my travel agency is). If I can’t reach them I should go to the
service point.
</p>

<h3>Dialing from Australia</h3>
<p>I’ve always wondered, why international phone numbers start with a “+”,
when I always need to call “00” instead of the plus anyway, why not appending
it automatically.
</p>
<p>I couldn’t call out from a call box. Whenever I was calling
0049 I got an error message. But luckily the madame at the service point told
me that Australia has a different dial-out code
(<a href="http://en.wikipedia.org/wiki/International_call_prefix">international
call prefix</a>) . It’s 0011.
</p>
<p>So I was finally able to call the agency. Still plenty of time, 70 minutes
to departure. And there was actually someone there. After another call and
$20 spent, it was clear that it was the fault of another company that does the
actual booking and that Qantas can’t access their stock of tickets.
</p>

<h3>A glimmer of hope</h3>
<p>“You are already the third one today where the changes of the booking
weren’t done properly”, the guy at the Qantas service point said. “We need to
get you on the flight quickly, check-in closes soon”. Still 40 mins to go. So
I got a new e-ticket and checked-in. That’s it for me, the Qantas people will
try to find out what went wrong.
</p>
<p>Getting through all the airport stuff seems to take longer when you are
in a hurry, but I was right on time for the boarding. And obviously, I made it.

<h3>Lessons learned</h3>
<ul>
  <li>Get your e-ticket number</li>
  <li>Be early at the airport</li>
  <li>If someone screws it up, you are likely to make it, though</li>
  <li>Different countries have different international call prefixes</a></li>
</ul>

]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/australia-getting-home%3A2009-11-02%3Aen%2Clife/feed/</wfw:commentRss>
</item>
<item>
<title>FOSS4G 2009: It was great
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-it-was-great%3A2009-10-25%3Aen%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-it-was-great%3A2009-10-25%3Aen%2Cgeo#comments</comments>
<pubDate>Sun, 25 Oct 2009 04:23:09 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-it-was-great%3A2009-10-25%3Aen%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>The <a href="http://2009.foss4g.org/">FOSS4G 2009</a> (Free and Open Source
Software for Geospatial Conference) is over now, it was great. I've finally met
many people that I've previously only chatted or discussed on mailing lists
with.
</p>

<h3>Organisation and venue</h3>
<p>The <a href="http://www.scec.com.au/">Sydney Convention & Exhibition Centre
Darling Harbour</a> really is an amazing venue and
<a href="http://www.arinex.com.au/">Arinex</a> did a great job as well. We had
good food, the technicians were keeping everything up and running, even the
wireless internet didn't break down and performed well.
</p>
<p>The <a href="http://2009.foss4g.org/about_us/">Organising Committee</a> did
an excellent job (especially
<a href="http://fromtheinsidelookingin.blogspot.com/">Mark</a>), too. I exclude
myself a bit, I was more the code monkey before the conference, rather than
keeping that conference running smoothly. But because of that I had the chance
to visit quite a few presentations.</p>

<h3>Presentations</h3>
<p>Probably the most favoured presentation was
<a href="http://2009.foss4g.org/speakers/#Paul_Ramsey">Paul Ramsey's
Keynote speech</a>. It was just incredibly insightful and entertaining
(<a href="http://www.youtube.com/watch?v=zB_a28vBtBk">watch it at YouTube</a>).
it here.</p>
<p>There were to other excellent presentations as well. First the
<a href="http://2009.foss4g.org/presentations/#presentation_63">Mapping
interviews with open source technologies</a> by
<a href="http://twitter.com/fogonwater">Chris McDowall</a>. He is using a video
projector and a <a href="http://en.wikipedia.org/wiki/Wii_Remote">Wii remote
control</a> in order to map locations people are pointing at during an
interview (just watch <a href="http://www.youtube.com/watch?v=8ezThgEy8Ho">this
video</a> to get a better idea).
</p>
<p>And second the
<a href="http://2009.foss4g.org/presentations/#presentation_71">Visualising
animal movements in ‘near’ real time</a> by
<a href="http://www.ausvet.com.au/content.php?page=ben">Ben Madin</a>. It was
about a project where they try to track the movements if cows in Southeast
Asia. The idea is to place GSM transmitters in one of the cows' stomach to
track their position. But they are facing problem like "How to get a GSM signal
through 40cm of meat". Really interesting.
</p>
<h4>Geodata and CouchDB</h4>
<p>So how did
<a href="http://2009.foss4g.org/presentations/#presentation_78">my talk</a>
go? I'm very happy with it. I haven't expected so much positive feedback and
so many good conversations about
<a href="http://couchdb.apache.org">CouchDB</a> and
<a href="http://gitorious.org/geocouch/">GeoCouch</a> afterwards and during the
next days.
</p>

<h3>After show parties</h3>
<p>After the talks it's time to socialise while having a few beers. It was
again great, every single night.
</p>
<p>One outstanding event was the <a href="http://www.ignitespatial.com/">Ignite
Spatial</a> on Wednesday. 10 high paced talks with 20 slides displayed 15 secs
each. My favourite one was the
<a href="http://www.ignitespatial.com/?page_id=181">Pie charts are evil talk</a>
by Glen Bell. Another result of the night is that I'll always think about
<a href="http://otherfancystuff.blogspot.com/2009/10/should-i-defend-my-cred-yes.html">short green skirts</a> whenever someone is mentioning
<a href="http://wave.google.com">Google Wave</a>.

<h3>The code sprint</h3>
<p>I was code sprinting <a href="http://openlayers.org/">OpenLayers</a>. It was
well organised and we got some cool new stuff in. Sadly, I haven't reached my
goal of fixing <a href="http://trac.openlayers.org/ticket/39">Ticket 39</a>,
but hopefully soon (or next year in Barcelona). But I was discussing with
<a href="http://wiki.osgeo.org/wiki/User:Rdewit">Roald de Wit</a> and
<a href="http://wiki.osgeo.org/wiki/User:Ahocevar">Andreas Hocevar</a> the
implementation details of the abstraction of the UI in OpenLayers (that idea was
discussed in the
<a href="http://blog.xebia.com/2009/10/23/taking-openlayers-to-the-next-level/">Openlayers
BOF</a>).
</p>

<h3>Final words</h3>
<p>Yes, it really was great. I hope to see you all again in Barcelona at the
<a href="http://2010.foss4g.org">FOSS4G 2010</a>.
</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-it-was-great%3A2009-10-25%3Aen%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>Benchmarking is not easy
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/benchmarking-is-not-easy%3A2009-09-23%3Aen%2CCouchDB%2CPython%2CTileCache%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/benchmarking-is-not-easy%3A2009-09-23%3Aen%2CCouchDB%2CPython%2CTileCache%2Cgeo#comments</comments>
<pubDate>Wed, 23 Sep 2009 17:39:06 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<category>Python</category>
<category>TileCache</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/benchmarking-is-not-easy%3A2009-09-23%3Aen%2CCouchDB%2CPython%2CTileCache%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>There are so many ways to have a play with
<a href="http://couchdb.apache.org">CouchDB</a>. This time I thought about using
CouchDB as a <a href="http://tilecache.org/">TileCache</a> storage. 
Sounds easy, so it was.
</p>

<h3>What is a tilecache</h3>
<p>Everyone knows <a href="http://maps.google.com/">Google Maps</a> and its
small images, called <em>tiles</em>. Rendering those tiles for the whole world
for every zoom level can be quite time consuming, therefore you can render
them on demand and cache them once they are rendered. This is the business of
a tilecache.
</p>
<p>You can use the tilecache as a proxy to a remote tile server as well, that's
what I did for this benchmark.</p>

<h3>Coding</h3>
<p><a href="/blog/2009-09-23/Couchdb.py">The implementation</a> looks quite
similar to the
<a href="http://svn.tilecache.org/trunk/tilecache/TileCache/Caches/Memcached.py">memcache
one</a>. I haven't implemented locking as I was just after something working,
not a full-fledged backend.
</p>
<p>When I finished coding, it was time to find out how it performs. That should
be easy, as there's a tilecache_seeding script bundled with TileCache to fill
the cache. So you fill the cache, then you switch the remote server off and
test how long it takes if all requests are hits without any fails (i.e. all
tiles are in your cache and don't need to be requested from a remote server).
</p>
<p>The two contestants for the benchmark are the CouchDB backend and the one
that stores the tiles directly on the filesystem.</p>

<h3>Everyone loves numbers</h3>
<p>We keep it simple and measure the time for seeding with
<a href="http://www.gnu.org/software/time/">time</a>. How long will it take to
request 780 tiles? The first number is the average (in seconds), the one in
brackets the standard deviation.
</p>
<ul>
  <li><p>Filesystem:</p>
<pre>
real 0.35 (0.04)
user 0.16 (0.02)
sys  0.05 (0.01)
</pre>
  </li>
  <li><p>CouchDB:</p>
<pre>
real 3.03 (0.18)
user 0.96 (0.05)
sys  0.21 (0.03)
</pre>
  </li>
</ul>
<p>Let's say CouchDB is 10 times slower that the file system based cache. Wow,
CouchDB really sucks! Why would you use it as tile storage? Although you could:
</p>
<ul>
  <li>easily store metadata with every tile, like a date when it should
expire.</li>
  <li>keep a history of tiles and show them as "travel through time layers"
in your mapping application</li>
  <li>easy replication to other servers</li>
</ul>
<p>You just don't want such a slow hog. And those
<a href="http://wiki.apache.org/couchdb/People_on_the_Couch">CouchDB
people</a> try to tell me that CouchDB would be fast. Pha!</p>

<h3>Really??</h3>
<p>You might already wonder, where the details are, the software version
numbers, the specification of the system and all that stuff? These things are
missing with a good reason. This benchmark just isn't right, even if I would
add these details. The problem lies some layers deeper.
</p>
<p>This benchmark is way to far away from a real-life usage. You would request
much more tiles and not the same 780 ones with every run. When I was
benchmarking the filesystem cache, all tiles were already in the system's
cache, therefore it was <em>that</em> fast.
</p>
<p>Simple solution: clear the system cache and run the tests again. Here are
the results after as <code>echo 3 > /proc/sys/vm/drop_caches</drop>
<ul>
  <li><p>Filesystem:</p>
<pre>
real 8.36 (0.71)
user 0.29 (0.04)
sys  0.18 (0.03)
</pre>
  </li>
  <li><p>CouchDB:</p>
<pre>
real 6.64 (0.15)
user 1.13 (0.07)
sys  0.29 (0.06)
</pre>
  </li>
</ul>
<p>Wow, the CouchDB cache is faster than the filesystem cache. Too nice to be
true. The reason is easy: loading the CouchDB database file, thus one file
access on the disk, is way faster that 780 accesses.
</p>

<h3>Does it really matter?</h3>
<p>Let's take the first benchmark, if CouchDB would be that much slower, but
isn't it perhaps <em>fast enough</em>? Even with those measures (ten times
slower than the filesystem cache) it would mean your cache can take 250
requests per second. Let's say a user requests 9 tiles per second it would be
about 25 users at the same time. With every user staying 2 minutes on the map
it would mean 18&#160;000 users per day. Not bad.
</p>
<p>Additionally you gain some nice things you won't have with other
caches (as outlined above). And if you really need more performance you could
always dump the tiles to the filesystem with a cron job.
</p>

<h3>Conclusion</h3>
<ol>
  <li>Benchmarking is not easy, but easy to get wrong.</li>
  <li>Slow might be fast enough.</li>
  <li>Read more about benchmarking on
<a href="http://jan.prima.de/plok/archives/176-Caveats-of-Evaluating-Databases.html">Jan's
blog</a>.</li>
</ol>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/benchmarking-is-not-easy%3A2009-09-23%3Aen%2CCouchDB%2CPython%2CTileCache%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>GeoCouch: New release (0.10.0)
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-new-release-0.10.0%3A2009-09-19%3Aen%2CCouchDB%2CPython%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-new-release-0.10.0%3A2009-09-19%3Aen%2CCouchDB%2CPython%2Cgeo#comments</comments>
<pubDate>Sat, 19 Sep 2009 14:26:45 +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-new-release-0.10.0%3A2009-09-19%3Aen%2CCouchDB%2CPython%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>It has been way to long since the initial release, but it’s finally there:
a new release of GeoCouch. For all first time visitors, GeoCouch is an
extension for <a href="http://couchdb.apache.org/">CouchDB</a> to support
geo-spatial queries like bounding box or polygon searches.
</p>
<p>I keep this blog entry relatively short and only outline the highlights and
requirements for the new release as GeoCouch finally has a real home at
<a href="http://gitorious.org/geocouch/">http://gitorious.org/geocouch/</a>.
Feel free to contribute to the wiki or fork the source.
</p>

<h3>Highlights</h3>
<ul>
  <li>Many geometries
<a href="http://gitorious.org/geocouch/pages/GeometryDefinition">are
supported</a>: points, lines, polygons (using Shapely).</li>
  <li>Queries are largely along the lines of the
<a href="http://www.opensearch.org/Specifications/OpenSearch/Extensions/Geo/1.0/Draft_1">OpenSearch-Geo
extension draft</a>. Currently
<a href="http://gitorious.org/geocouch/pages/Queries">supported</a> are
bounding box and polygon searches.</li>
  <li>Adding new backends (in addition to SpatiaLite) is easily possible.</li>
</ul>

<h3>Requirements</h3>
<ul>
  <li><a href="http://www.kernel.org/">Linux 2.6.26</a></li>
  <li><a href="http://couchdb.apache.org/">CouchDB 0.10.0</a></li>
  <li><a href="http://www.python.org/">Python 2.6.0</a></li>
  <li><a href="http://code.google.com/p/couchdb-python/">couchdb-python 0.6.x (0.6.0 doesn't work)</a></li>
  <li><a href="http://trac.gispython.org/lab/wiki/Shapely">Shapely 1.0.12</a></li>
  <li><a href="http://code.google.com/p/apsw/">APSW - Another Python SQLite Wrapper 3.5.9-r2</a></li>
  <li><a href="http://www.gaia-gis.it/spatialite/">SpatiaLite 2.3.1</a></li>
</ul>
<p>Other versions might work.</p>

<h3>Download</h3>
<p>If you don’t like Git, you can
<a href="/geocouch/downloads/geocouch-0.10.0.tar.bz2">download GeoCouch 0.10.0
here</a>.
</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-new-release-0.10.0%3A2009-09-19%3Aen%2CCouchDB%2CPython%2Cgeo/feed/</wfw:commentRss>
</item>
<item>
<title>CouchDB: Returning all design documents with Python
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/couchdb-all-design-docs%3A2009-08-21%3Aen%2CCouchDB%2CPython</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/couchdb-all-design-docs%3A2009-08-21%3Aen%2CCouchDB%2CPython#comments</comments>
<pubDate>Fri, 21 Aug 2009 20:57:16 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<category>Python</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/couchdb-all-design-docs%3A2009-08-21%3Aen%2CCouchDB%2CPython/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<p>I just wanted to get all design documents of a
<a href="http://couchdb.apache.org/">CouchDB</a> database with
<a href="http://code.google.com/p/couchdb-python/">couchdb-python</a>. I
couldn’t find any hints how to do it, it took longer to find out than expected.
Therefore this blog entry, perhaps I save someone a few minutes of research.
</p>
<p>
  <pre>
<code>from couchdb.client import Server
couch_server = Server('http://localhost:5984/')
for designdoc in couch_server['yourdatabase']\
        .view('_all_docs', startkey='_design', endkey='_design0'):
    print 'designdoc: %s' % designdoc
</code></pre>
</p>
<p><strong>Update:</strong> even simpler with slicing:</p>
<p>
  <pre>
<code>from couchdb.client import Server
couch_server = Server('http://localhost:5984/')
for designdoc in couch_server['yourdatabase']\
        .view('_all_docs')['_design':'_design0']:
    print 'designdoc: %s' % designdoc
</code></pre>
</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/couchdb-all-design-docs%3A2009-08-21%3Aen%2CCouchDB%2CPython/feed/</wfw:commentRss>
</item>
<item>
<title>FOSS4G 2009: I'm speaking
</title>
<link>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-im-speaking%3A2009-07-21%3Aen%2CCouchDB%2Cgeo</link>
<comments>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-im-speaking%3A2009-07-21%3Aen%2CCouchDB%2Cgeo#comments</comments>
<pubDate>Tue, 21 Jul 2009 19:05:34 +0200</pubDate>
<dc:creator>Volker Mische</dc:creator>
<category>en</category>
<category>CouchDB</category>
<category>geo</category>
<guid isPermaLink="false">http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-im-speaking%3A2009-07-21%3Aen%2CCouchDB%2Cgeo/</guid>
<description><![CDATA[ 
 [...]]]></description>
<content:encoded><![CDATA[

<div class="figure">
  <a href="http://2009.foss4g.org/presentations/#presentation_78">
    <img src="/blog/2009-07-21/logo_145x90_speaking.png" alt="FOSS4G 2009 - I'm speaking!" width="145" height="90" />
  </a>
</div>

<p>I did it! I'll speak on the <a href="http://2009.foss4g.org/">FOSS4G
Conference 2009</a> (Free and Open Source Software for Geospatial Conference),
20th–23rd October in Sydney about “CouchDB and Geodata”. More information
is available at the
<a href="http://2009.foss4g.org/presentations/#presentation_78">official
website</a>.
</p>
]]></content:encoded>
<wfw:commentRss>http://vmx.cx/cgi-bin/blog/index.cgi/foss4g-2009-im-speaking%3A2009-07-21%3Aen%2CCouchDB%2Cgeo/feed/</wfw:commentRss>
</item>
</channel>
</rss>
