Showing posts with label osm. Show all posts
Showing posts with label osm. Show all posts

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!

Thursday, June 14, 2012

OpenStreetMap, Google, Nokia and Bing maps

Vepsä, a tiny island in the Turku archipelago on different map services. There is an enormous difference on the amount of detail available. And on two services the island itself is missing, looks kinda silly checking in on Foursquare on Nokia devices.

Update (02.10.2012): Added screenshot from iOS 6 maps. It has at least the island in place, but not much more.

Vepsä on OpenStreetMap. Roads and trails.

Vepsä on Google. No details. But plenty of tiny islands.

But these two suck, and suck really bad. The complete island is missing.

Vepsä on Nokia maps, nowhere to be seen

Vepsä on Bing maps.. where is it ?
Apple maps in iOS 6 from iPad



Wednesday, May 25, 2011

More openstreetmapping of Limnos, Greece

It's only 4 weeks until our 2 weeks holiday on Limnos. I've made pretty good progress on mapping from the bing satellite images, the island is not empty anymore, but there is still plenty to do. The costline is still blocky in some places, not a big priority but goes with the beach mapping nicely.

I've started to draw forest (what little there are, not much), scrubs and farmlands also to get the island to look more "green", the default grey must be somekind of psychological way to get people to draw nature areas...

Some details:
But as you can see, there is still very much to do, plenty of tiny tracks and a lot of farmland to draw. And beaches as there are many of those all over Limnos.

    Sunday, March 13, 2011

    Deciding on vacation destination and mapping the destination

    Me and my gf finally decided where to go this summer, first the country and the final destination. We where to Parga, a nice little village in Greece, last summer and fell in love with greece. Friendly people, very good and cheap food, especially the sea food.

    So, it was easy to decide on Greece for the country this year too. Then to pick the destination. After looking around in various (finnish) travel agencies we found Limnos (or Lemnos) (Λήμνος). Aurinkomatkat had a cheap 2 week package, but when we finally had decided, it had gone. But who cares about packages... so we just booked the flights EFHK-LGAV-LGLM-LGAV-EFHK from blue1 and now we are looking for somekind of hotel.

    Anyway, I beeing an openstreetmapper (and semi-active geocacher) checked out the map of Limnos.. google maps sucks, bing sucks and openstreetmap sucked, but not anymore ! Thanks to the Bing satellite images available I've been tracing roads couple of hours per day now for almost month and it's starting to look like something now.

    My target is to have every single road that I can see from the satellite images drawn before going, so I have about 3.5 months time to do it :)

    Unfortunately there are only on geocache on the whole island.

    Friday, August 06, 2010

    Creating a large map from OpenStreetMap map tiles

    We where planning at work to print large maps of the BSR on plywood and create a puzzle out of it, I think it was 1x1 meter. I made the following simple bash script to download and stitch the tiles using ImageMagick:

    #!/bin/sh
    #From
    #http://c.tile.cloudmade.com/fd093e52f0965d46bb1c6c6281022199/3/256/7/66/26.png
    #To:
    #http://b.tile.cloudmade.com/fd093e52f0965d46bb1c6c6281022199/3/256/7/76/42.png
    Z=7
    URL=http://tile.cloudmade.com/fd093e52f0965d46bb1c6c6281022199/3/256/
    
    download_tile() {
     FILE=tile_${x}_${y}.png
     if [ -r $FILE ]; then 
      echo .
     else
      curl --output tile_${x}_${y}.png ${URL}/${Z}/${1}/${2}.png
     fi
    }
    
    for ((x=66;x<77;x++)) do
      for ((y=26;y<43;y++)) do
       download_tile $x $y
       sleep 0.1
      done
      montage -geometry 256x256 -tile 1x17 tile_${x}* map_${x}.png
      sleep 1
    done
    

    Unfortunately printing and large sticker or directly on plywood was out of the budget so in the end it wasn't needed. The fallback was handpainting, not as accurate, but looks pretty good still.
    Anyway, I post this tiny script in here in case someone else might need something like it as I didn't find anything suitable when I was searching for a quick and simple solution. The best would of course had been to create a custom map using mapnik and all that, but it would have take too much time (and I don't have any hardware to play with at work, only my laptop with a tiny disk)

    Friday, September 04, 2009

    Mapper things

    I've been working on a partial-rewrite/splitting of Mapper into libraries and components. Unfortunately it takes a bit more time than I have and delays releasing a Mapper 2.0, so I decided a couple of weeks ago to work a bit on the old Mapper branch instead and fix some of the most annoying bugs and add a couple of features to make it nicer to use.
    A new release is already out, available at mapper.tal.org tablet repository. Sources can be there too for those who need them.

    Oh, and I will probably release a new version today, fixing a couple of bugs in the above :)

    Friday, June 05, 2009

    Finding roads to map for OpenStreetMap

    Even if there is still a lot of mapping to do here in Finland, we already have most of the major roads done. I at least are having a problem finding roads to map when I'm not driving just for mapping anymore.
    For example, our family summer cottage is a 240km away from my home, and all the roads that it makes sense to drive trough have already been mapped. And it doesen't help that the fastest way is the E18, starting 100m from home and going almost straight to the summer cottage, with only about 7km of some smaller roads to drive so you tend to prefer that fastest route instead of smaller roads. Not that I personally don't like driving on them, it's the others in the car (read: girl friend :) that like to get there fast.
    So I've been trying to find some way to get myself on smaller roads and I think I've found a nice way that also requires a GPS. And, you guessed it, it's geocaching! I try to look for caches in obscure places so that I need to drive on smaller roads. And the gf, not eager, but at least she likes geocaching and tags along.

    Monday, November 05, 2007

    Some Mapper progress...

    Mapper has now a pretty nice feature list:
    * Can uses OSM data for Places, Streets and POIs
    o Importer converts planet XML file to sqlite database with selected features
    o Reads bzip2 compressed 0.5 API planet XML files
    * POIs and Streets can be searched
    * Displays street and place where you are
    * Setting arbitrary destination point
    * Setting destination to POI or Street
    * Display rough estimate of distance to destination
    * Periodic distance to destination announcement
    * Show a bearing to destination in heading compass
    * Show a bearing to next way point in heading compass
    * Quick POI Add interface (Hard coded list for now)
    * Click POI for information
    * Displays GPS sky and signal information
    * Route way point list with directions
    * Simple Track point filter (by HDOP, VDOP and angle)
    * Speech output for route way points and destination information
    o Uses espeak+gstreamer
    * Supports both normal Desktops (plain Gtk+) and Internet Tablets (770, N800, N810) (Hildon)

    Unfortunately, I haven't had enough free time to work on routing just yet, but it will come soon I hope.

    Friday, October 19, 2007

    Next Mapper version

    Work is getting in the way for all the fun stuff, but some nice Mapper features are planned for the next (1.0.4?) version:
    - Search POIs
    - Search streets
    - Route waypoint display/list
    - Handling of connections with libconic

    Tuesday, July 24, 2007

    Mapper

    I finaly got my maemo-mapper fork in such a shape that it should be usable. Check it out here.

    Tuesday, March 20, 2007

    OpenStreetMaping using satellite images

    As I've written before, I help out with OSM, mainly around Turku, but thanks to Yahoo, OSM can now use high-res satellite maps for some cities. Unfortunately, only the Helsinki/Vantaa/Espoo region is available here in Finland, but I've been making some progress in drawing some of the missing main roads around Helsinki, Espoo and Vantaa. I've also added some nice details like Helsinki-Vantaa and Helsinki-Malmi airports.

    Thursday, January 18, 2007

    OpenStreetMapping Finland

    I got myself a Nokia 770 last summer and been using the most excellent maemo-mapper to navigate around Finland. I'm mostly very happy with it but route planning and place search is something I would really like to have (and for free that is). The biggest problem is that there is no free map data available (for €€€ you can always get the digiroad data but that is not an option).

    On my quest to find map data I found out about the OpenStreetMap project. And since couple of months been eagerly adding as much data as I can gather when I drive around. It's not loong ago when Turku was almost empty, but now it's starting to look like a map. I think I'm mostly alone in Turku, but someone is working around Tampere and Helsinki. But we would really need more people involved.
    There is still a lot of work to do but