It has been almost a year since I last added a new post on mark.deblois.eu which is not good. A lot has happened over the last year, I quit from my work at Google Kenya and have setup a company called Upande Ltd. through which I consult now in GIS, webmapping and OpenSource. I have been blogging through www.upande.com however along the same lines as through mark.deblois.eu. I will keep mark.deblois.eu live for now.
Author Archive for admin
Moving on
Google Maps is one of the most popular web based mapping platforms with expanding coverage into new geographies. Recently the coverage of detailed maps now includes countries ranging from Chile to Zimbabwe to Vietnam. In order to improve maps in emerging countries, Google has launched Google Map Maker in more than 160 countries world wide. A quick look at Map Maker reveals lots more detailed data which users have added or edited.
The Google Geo Developers Blog features a post called ‘Map Maker for Developers’. This post discusses Google’s response to user requests for adding Map Maker tiles as new map types to both the Google JavaScript Maps API (v2.146) and the Static Maps API. So if you have a Google maps mashup that is primarily used in one of these emerging countries or you simply want to embed a fresh map in your blog post or web page, you can use these maps that are updated every day by the map maker community. Quite exciting! Below see an example of the Static Map API requests for the town of Kogelo Nyang’oma in Kenya, the ancestral town of President Barack Obama.

http://maps.google.com/staticmap?center=31.494445,74.334011&zoom=15&size=256×256&key=API_KEY&sensor=false

http://maps.google.com/staticmap?center=31.494445,74.334011&zoom=15&size=256×256&maptype=mapmaker-Roadmap&key=API_KEY&sensor=false
Haven’t we all had to look at hundreds of someone’s holiday photo’s before where you just wish they had slimmed down the selection, done some creative layout or simply just done something cool with them? With all the free tools that are out there on the web there really is no excuse these days not to have some fun holiday photo’s and or video. In 2005 my wife and I and our two little children visited South Africa/Mozambique for business/pleasure. We took lots of pictures, videos and I also recorded some tracks using my Garmin iQue 3600 gadget.
As I had a quiet evening ahead of me I decided I wanted to export my tracks to kmz format for overlay in Google Earth and/or Google Maps. With this file I wanted to add placemarks including links to video highlights. Is that too much to ask for one evening? Not really…
First of all I downloaded my tracks from the GPS through my USB cable using the wonderful Garmin MapSource program. After having selected the tracks I wanted to include I exported them as a gpx file, the open GPS eXchange Format.
Newer versions of Google Earth support direct loading of gpx files but they did not work well in my case. So I used the free GPS Visualizer tool which does a wonderful job of turning my gpx file into a kmz file including nice colouring of the different track content.
All that remained was adding the placemarks in Google Earth which we visited. For some I embedded the YouTube code to the Placemark Description folder as neatly outlined in the Google Earth Outreach tutorial. Had to upgrade to Google Earth 4.2.0198.2451 (beta) before my videos showed up. And voila! Mission accomplished!
Okay, I did already have raw video material sitting around but exporting small videos in mpeg format and uploading them was remarkably easy. Within a few minutes they were directly linkable too (though not immediately indexed yet of course).
Not bad for an evening home, another thing to tick off my hobby to do list. All I have to do now is add some more video/photo content
Download result Google Earth file
If you are using Internet Explorer you might have to change the extension of the Google Earth file from .zip to .kmz to be able to open it directly in Google Earth. Still have to make some changes to my server so that IE users don’t have to go through this hassle. Alternatively you can download Firefox web browser.
In my previous post I mentioned how custom Google Mapplets can be added to your Google Maps website. I have now created two mapplets myself. The first is an overlay of the Southern African Development Corridors main transport infrastructure. The second one is a mapplet for the journeys of apostle Paul which I have already created Google Earth files for. Feel free to check them out!

Google Maps Mapplets
Besides using Google Maps to find locations, businesses, etc. it is also possible to embed a Google Map in your own website. To be able to do so you do need to sign up for a Google Maps API key.
Using the MyMaps tab it is possible to add your own content to Google Maps and share this with the rest of the world! You can either add a placemark, line or shape to your map, name your map and Edit or Save it. When saving it you have the choice of making it public or private. Public maps are maps that you want to publish and share with everyone. Public maps will be included in the search results on Google Maps and Earth.
A nice new feature of Google Maps are the so called Google Mapplets which are mini applications based on Google Maps which allow you to add your own content or features. Mapplets are stored on Google’s servers and can be shared in an online official directory so that others can load up your mapplet as well.
An example is the getLatLongPlus mapplet which allows you to click on any point in the map and get the coordinates back in latitude longitude. You can also output this data in georss, kml or gpx format for integration with other applications and or GPS receivers!

A spatial database does not store just plain records but is optimized to store and query data related to objects in space, including points, lines and polygons. Spatial databases have been around for a while now but are currently gaining popularity rapidly. Where the market was dominated by Oracle Spatial for a large number of years, there are promising alternatives these days including PostgreSQL in combination with PostGIS spatial extension, as well as MySQL with spatial extensions. Microsoft’s SQL Server can also store spatial information.
So what is the advantage of having a spatial database? For one, having all your data in a central database including well defined privileges, is a great thing to have. Besides this it is possible to extend the more standard SQL queries with spatial queries. E.g. which towns lie within a zone of 100km around the epicenter of the earthquake location. But a spatial database can also be used to populate a Google Map (or other online mapping applications) as I have shown in the image here:

In the example below I connect to my PostgreSQL database by means of PHP.
$db_handle = pg_connect(”host=localhost port=5432 dbname=outbreak_locations user=mark password=whatever”);
$query = “SELECT * FROM locations”;
$result = pg_exec($db_handle, $query);
Once we have our connection it is time to generate the XML format which will be used to populate our Google Map.
header(”Content-type: text/xml”);
// Start XML file, echo parent node
echo ‘
for ($row = 0; $row < pg_numrows($result); $row++) {
// ADD TO XML DOCUMENT NODE
echo ‘
echo ‘town=”‘ . parseToXML(pg_result($result, $row, ‘town’)) . ‘” ‘;
echo ‘country=”‘ . parseToXML(pg_result($result, $row, ‘country’)) . ‘” ‘;
echo ‘lat=”‘ . parseToXML(pg_result($result, $row, ‘latitude’)) . ‘” ‘;
echo ‘lon=”‘ . parseToXML(pg_result($result, $row, ‘longitude’)) . ‘” ‘;
echo ‘/>’;
}
// End XML file
echo ”;
?>
Make sure you include the parseToXML function included at the top of your php file:
function parseToXML($htmlStr)
{
$xmlStr=str_replace(’<’,'<’,$htmlStr);
$xmlStr=str_replace(’>’,'>’,$xmlStr);
$xmlStr=str_replace(’”‘,’”‘,$xmlStr);
$xmlStr=str_replace(”‘”,”’,$xmlStr);
$xmlStr=str_replace(”&”,’&’,$xmlStr);
return $xmlStr;
}
The above code is the php used to generate the XML. This php file is referred to from the index.html file which loads the actual Google Map. Besides calling the Google Map API using your own key file and declaring your marker symbols, add two functions:
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById(”map”));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(0, 0), 1);
GDownloadUrl(”generate_gmap_xml.php”, function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName(”marker”);
for (var i = 0; i < markers.length; i++) {
var town = markers[i].getAttribute(”town”);
var country = markers[i].getAttribute(”country”);
var type = markers[i].getAttribute(”type”);
var point = new GLatLng(parseFloat(markers[i].getAttribute(”lat”)),
parseFloat(markers[i].getAttribute(”lon”)));
var marker = createMarker(point, country, town, type);
map.addOverlay(marker);
}
});
}
}
and
function createMarker(point, name, country, town, type) {
var marker = new GMarker(point, customIcons[type]);
var html = “” + name + “
” + country + ”
” + town + ”
” + type;
GEvent.addListener(marker, ‘click’, function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
Installing Ubuntu
Considering installing Ubuntu on your machine?! My experience is that it is very easy to do so and a great operating system for the kind of stuff I want to be doing. Moreover, every 6 months or so a new version comes out to which you can easily upgrade. There is a huge community out there using Ubuntu so help is never far away. The great thing is that you can ‘try it out’ with a Live-cd which sets up Ubuntu on your machine if you boot up with it. This allows you to see whether you like it, whether your hardware is supported, etc. By clicking on the install icon on the desktop you can then decide whether you want to install it as your main OS or alongside Windows for example. There are many online (video) tutorials out there which tell you how to install Ubuntu, including various OpenSource GIS tools. A great site is Aaron Racicot’s Reprojected blog. On the Video link you can find various videos demonstrating (+ written out) how to install Ubuntu, base GIS tools, PostgreSQL/PostGIS and QGIS including Python bindings which allow you to create stand alone applications.

Though quite hidden, it is actually possible to add WMS services through the interface of the latest version of Google Earth. I have previously been hacking WMS requests into kml files but didn’t realize there is an easier way. For those not familiar with WMS, it stands for Web Map Service and is a standard setup by the Open Geospatial Consortium. Effectively it is an open standard through which web mapping applications such as MapServer generate snapshots of GIS data. Google Earth has supported for some time now overlaying these images based on the WGS84 map datum but now also through the interface.
In order to add a WMS service:
- Click on the menu item Add and choose Image Overlay
- Click on the tab Refresh and choose WMS Parameters
- Pick your favorite WMS server in the combo box at the top or add your own using Add
In the example here I have added Maplecroft’s Tuberculosis risk index, part of the WMS services I am setting up at Maplecroft.

Besides apostle Paul’s first missionary journey, you can now view the approximate route of all his journeys in Google Earth format, by clicking on the link below.
The other day whilst hearing about the apostle Paul’s missionary journeys in church, I was finding it hard to remember all the names of the places where he brought the gospel, let alone where on earth they are! And then a thought came to my mind which hasn’t left me since, why not visualize his missionary journeys in Google Earth? I am sure many people with an interest in the Bible would want to check this out. So I did a quick google for Bible places in order to pinpoint the towns he visited. Fortunately others have spent vast amounts of time (from the looks of it) in pinpointing Biblical places, so ‘all’ I had to do was create a Google Earth path to connect this places in the right order. You need Google Earth Pro (trial) for this.I have a ‘beta’ of the first missionary journey available for you to check out here. The rest will follow as soon as I find enough of my precious time :-).
![]()

