Showing posts with label openstreetmap. Show all posts
Showing posts with label openstreetmap. Show all posts

Tuesday, February 17, 2015

Interactive piste map on Sailfish OS

Found libosmscout a while back and that gave me an idea, but never had time to look into it properly. But last summer I tried making piste specific styles and it did what I wanted. Then I forgot all about it more or less.

But now I've been playing with creating ski specific stylesheets for a while now and it is starting to look like a nice piste map.

Today I got inspired to get the libraries and example QtQuick component up and running on Jolla. First test app was up and running quite fast.

Example map  data from Åre.



Test Mobile Åre piste map

Thursday, March 14, 2013

GPS, Mapping and picture taking

This news reminded me of how absurd it can sometimes be when doing mapping work. I was a couple of years back in Limnos, Greece on a two week holiday.

Mmm, good food


As I've been an OpenStreetMapper since about 2006 I of course wanted to check out the if it had been mapped or not. Only some very rough main roads had been drawn there. This was just a bit after OSM got the nice Yahoo/Bing aerial photos and luckily for me there where quite good aerial photos of Limnos. So mapping I went, from my home and couple of thousand kilometers away. And got it mostly mapped in time for my travels.

Limnos map, looks good or what ? :)


Yeah, whatever I hear you thinking, what does this have anything to do with China ?

Limnos has a heavy army presence, there are many military bases and bunkers all around and a large radar installation. And for example the airport/airfield is a military area (you can even make out the planes/helicopers in the aerial images). And of course you aren't allowed to take any photos anywhere near these places.

No, not a military base (but there is one not far from here). Myrina.


What makes this absurd is that everything is available on the Internet anyway. And if some neighbouring enemy country would like to bomb the hell out of some base, all they need to do is fire up Bing maps or Google maps to find them.3

So why the hell can't a tourist take photos of these places ? Just wondering...

Friday, August 17, 2012

OpenStreetMap tiles on N9 Foursquare app

A cute little hack, use proper OpenStreetMap maps with map tile caching instead of always re-downloading the Nokia Map tiles.

Notice something different ? :)
Details later...

Wednesday, August 08, 2012

OpenStreetMap Maps with QML Map object

QtQuick/QML comes with a nice ready made Map element that can show map tiles and dots and polygons and stuff. Really nice and all, unfortunately the default and only map available is Nokia maps. And well, I prefer free maps. So, how to get OpenStreetMap working ?

One option is to make your own QML based map element, I started on that but never had enough patience to finish it.

But after some googling around I found qtm-geoservices-extras ! Today I started to look into it a bit more and trying to figure out how to get in working when targeting the N9 as we have the silly problem that anything submitted to the Nokia Store can not depend on any outside packages. Extremely annoying that.

The extra geoservices contain Qt plugins for providing map (and route, search, etc) features from OSM and Google. I didn't care of the goolge plugin at all.

So how to get the plugin working when you make your own app ?

Adding OpenStreetMap Qt map provider to your app


QML Map with OpenStreetMap tiles, running on the simulator


First, checkout qtm-geoservices-extras
git clone git://gitorious.org/qtm-geoservices-extras/qtm-geoservices-extras.git

Then copy the openstreetmap directory into your own project

cp -a qtm-geoservices-extras/openstreetmap your-map-app/

The edit your projects .pro file to include:
include(openstreetmap/openstreetmap.pro)

And in your main.cpp (or whatever), add:

#include <qtplugin>
Q_IMPORT_PLUGIN(qtgeoservices_osm)
Then edit the openstreetmap.pro file in the openstreetmap directory, like this:
  1. Add static to CONFIG
  2. Remove or comment out the include(../common.pri)
  3. Remove or comment out TARGET=
  4. Remove or comment out TEMPLATE=
  5. Add 
    INCLUDEPATH += $$PWD
    DEPENDPATH += $$PWD
End result should look something like this:

#TEMPLATE = lib
CONFIG += plugin
#TARGET = $$qtLibraryTarget(qtgeoservices_osm)
PLUGIN_TYPE=geoservices
# include(../common.pri)
QT += network
CONFIG += mobility static
MOBILITY = location
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD

Then add the map element to your QML code

import QtMobility.location 1.2

    Map {
        id: nmap
        width: 480;
        height: 300;
        anchors.top: osm.bottom;
        zoomLevel: 10
        center: mypos;
        connectivityMode: Map.OfflineMode;
        plugin : Plugin {
                name : "openstreetmap"
                PluginParameter{ name:  "mapping.cache.directory" ; value: "/tmp/qtmap" }
                PluginParameter{ name:  "mapping.cache.size" ; value: "200000" }
            }
    }

    Coordinate {
        id: mypos
        latitude: 60.45;
        longitude: 22.25;
    }

And that should do it. Build your app and try it out!