[Commotion-discuss] Fwd: Local Apps in Tunisia

Will Hawkins hawkinsw at opentechinstitute.org
Thu Jan 23 20:58:32 UTC 2014


Hey Dan!

Sorry it's taken me so long to respond! To answer your questions about
Open Street Map is a little, er, involved, but Wikipedia is easy :-) I
will take them in the order of easy to hard ...

For Wikipedia, we were given a copy of the data on a thumb drive from a
local user. He captured the Arabic and the French versions of Wikipedia
from a project called kiwix (http://www.kiwix.org/wiki/Main_Page). I
copied that data onto the local server. The best part about this project
is that it comes with its own web server. Inside the package is a
kiwix-serve program (http://www.kiwix.org/wiki/Kiwix-serve). I ran this
on port 8080 and voila! If you are running Kiwix on something Linux-y,
the server comes precompiled so you don't even have to build it.

For Open Street Map, it was a little more difficult. I am planning to
write up a full guide on how I did this, but here is an overview.

The goal was to have data for Tunisia hosted locally and displayed on a
slippy map (http://wiki.openstreetmap.org/wiki/Slippy_Map). I thought
that it would be good to use OpenLayers (http://openlayers.org/) to do
that, which meant that I somehow needed to build up some tiles
(http://wiki.openstreetmap.org/wiki/Tiles). Those tiles are rendered
from the OSM base data (which is XML format) and turned into PNGs
(rasterized).

To start, I used one of the OSM APIs to get the OSM data for Tunisia.
The xapi API (might be redundant) allows you to query for a the OSM data
within a bounding box. See more here:
http://wiki.openstreetmap.org/wiki/Xapi.

Once I collected that data, I had to import it into a PostGIS postgres
database. This was a real sticking point for me. I used osm2pgsql to do
that (http://wiki.openstreetmap.org/wiki/Osm2pgsql) after I created a
PostGIS compatible database using the instructions from
http://wiki.openstreetmap.org/wiki/PostGIS/Installation.

Once I got the data into PostGIS, I was able to start styling the data.
Because that was much more complicated than I anticipated, I decided to
rely on the styling information that the OSM people use to style their
public maps. I got that from the openstreetmap-carto repo on github
(https://github.com/gravitystorm/openstreetmap-carto). Using that makes
the maps look really, really pretty.

Once I got Mapnik/TileMill to create a nice looking style, I could start
the render process! I used a render script that I found online at
https://github.com/newsapps/making-maps-demo (specifically the
render_tiles.py file). The rendering process creates a normal directory
of PNG files. (See attached example)

Those tiles are, finally, the input we need for OpenLayers. Installation
of OpenLayers is relatively straightforward and requires simply a
webserver to serve some JS and those PNG files.

Breath.

The process for doing this was only hard when I really had no idea what
I was doing. The further I got into the process, the more reasonable it
seemed. Please PLEASE send questions and let me know if there are parts
of the process (either for Wikipedia or OSM) that I can clarify. I'd
love to help you get this going for your local app servers.

I hope this helps! Again, I'm sorry that it has taken me so long to respond!

Will

On 01/14/2014 01:30 PM, Joshua Breitbart wrote:
> Can one of you respond, even if just to say that we're in the process of
> writing up the deployment with more info to follow?
> 
> 
> -------- Original Message --------
> Subject: [Commotion-discuss] Local Apps in Tunisia
> Resent-From: <breitbart at newamerica.org>
> Date: Mon, 13 Jan 2014 11:07:57 -0800
> From: Dan Hastings <dhastings at abaarsotech.org>
> To: commotion-discuss <commotion-discuss at lists.chambana.net>
> 
> I was wondering if anyone knew where I could find a guide to some of the
> local apps that were installed into the Sayada network? In particular, I
> would like to know how to install Open Street Map and Wikipedia locally.
> 
> Thanks
> 
> Dan
> 
> _______________________________________________
> Commotion-discuss mailing list
> Commotion-discuss at lists.chambana.net
> https://lists.chambana.net/mailman/listinfo/commotion-discuss
> 
> 
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 798.png
Type: image/png
Size: 24507 bytes
Desc: not available
URL: <http://lists.chambana.net/pipermail/commotion-discuss/attachments/20140123/994598c3/attachment-0001.png>


More information about the Commotion-discuss mailing list