maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   License for Finnish topo maps has expired? (https://talk.maemo.org/showthread.php?t=65922)

jussihoo 2010-11-20 11:33

License for Finnish topo maps has expired?
 
I noticed yesterday that the license for the Finnish topographical map tiles from the National Land Survey Of Finland (Maanmittauslaitos) has been expired.
:mad::mad::mad:

I have this URL for these Finnish topo maps set on the Mappero and it has worked just fine on both my N810 and N900 since two years.

But yesterday when I moved to a place where I didn't have maps on the cache and the Mappero tried to download the map tiles I got just a white tile with the following text: "Maastokarttojen koekäyttö on päättynyt" which means that the trial to use the topo maps has expired.

This is awful news. I have been using Mappero + topomaps for geocaching and for other activities on the terrain.

Does anybody know more about this and how to get these topo maps to N810 and to N900 even with a paid service? Who should I ask this from Nokia as I understood that in 2008 Nokia and National Land Survey Of Finland made this deal.

ju-maha 2010-11-22 15:17

Re: License for Finnish topo maps has expired?
 
This was bad news for me also!! :(

Is it possible to get maps from this web-site? http://kansalaisen.karttapaikka.fi/k...aku.html?lang=

Could someone help with that?Please!

cybe 2010-11-23 19:48

Re: License for Finnish topo maps has expired?
 
Sad news indeed...

extechop 2010-11-26 17:31

Re: License for Finnish topo maps has expired?
 
You will see the same message from the actual website.

Indeed, this is sad news, and I feel that Nokia has let us down again: no pre-warning, and no info on alternate ways to get the data (even purchase options). And of course similar data is available for Symbian phones for free...

oldchap 2010-12-05 11:22

Re: License for Finnish topo maps has expired?
 
I noticed this just today. I couldn't agree more with previous senders. Again bad policy from Nokia. This was the best feature of my old N810 and now it is unusable. I guess there is no workaround for this.

orava 2010-12-05 20:58

Re: License for Finnish topo maps has expired?
 
2 Attachment(s)
I made a Python script that fetches and transforms map images from Kansalaisen karttapaikka and Retkikartta to Mappero suitable from. Fetching is done by using fetch_map and transforming with GDAL. The script can be used from command line or with Apache/mod_python you can use it to create tile source that can be used in Mappero. Transforming one tile takes from 3 to over 10 seconds on N900 (<1sec with 3GHz Pentium 4) so you won't probably want to set tile server running on N900 (and there isn't required version of gdal libraries in maemo repositories so you would have to compile that yourself).

Installation instructions for Linux (with Apache and mod_python already installed):
1) Install required packages proj-bin, libgdal1-1.7.0, python-gdal and python-imaging ("apt-get install proj-bin libgdal1-1.7.0 python-gdal python-imaging").
2) Download fetch_map(http://olammi.iki.fi/sw/fetch_map/download.php) and attached "map.py.gz". Gunzip and copy map.py to some dir on your web server and extract all files from fetch_map dir in fetch_map zip to same directory.
3) Change MAP_CACHE_DIR and use absolute path name(default is "./map_cache" and it doesn't work correctly with mod_python) and allow writing to that directory.
4) Now it should work. You can try to fetch a tile for example with "map.py?kkp2/7/72/36.png". Because of the transformations text in farther zoom levels is not very well readable but closer zoom levels are fine.

If installation succeeded you can add following tile sources/map repositories to Mappero (for every tile source set tile type: XYZ_INV and image type: PNG)

Kansalaisen karttapaikka
http://YourServerIP/MapDir/map.py?kkp/%0d/%d/%d.png
Zoom levels: 6-17

Kansalaisen karttapaikka2
http://YourServerIP/MapDir/map.py?kkp2/%0d/%d/%d.png
Zoom levels: 5-17

Retkikartta
http://YourServerIP/MapDir/map.py?rka/%0d/%d/%d.png
Zoom level: 8-16

Retkikartta2
http://YourServerIP/MapDir/map.py?rka2/%0d/%d/%d.png
Zoom level: 7-16

Kansalaisen karttapaikka airplane pictures
http://YourServerIP/MapDir/map.py?orto/%0d/%d/%d.png
Zoom levels: 6-17

Kansalaisen karttapaikka airplane pictures2
http://YourServerIP/MapDir/map.py?orto2/%0d/%d/%d.png
Zoom levels: 5-17

"orto" uses airplane pictures from Kansalaisen karttapaikka at closer zoom levels and farther zoom levels are same as in "kpa". In number 2 sources tiles are created from images that are zoomed in and in numberless sources tiles are created by zooming out. So 2's maybe have better quality but those also need more performance to create tiles.

---
Asennusohjeet Windowsiin:
1) Asenna Python 2.7 (http://www.python.org/ftp/python/2.7.1/python-2.7.1.msi)
2) Asenna Python Imaging Library (http://effbot.org/media/downloads/PI...in32-py2.7.exe)
3) Asenna osoitteesta (http://www.lfd.uci.edu/~gohlke/pythonlibs/) löytyvät GDAL-1.7.3.win32-py2.7.exe ja numpy-1.5.1.win32-py2.7.exe.
4) Asenna CherryPy (http://download.cherrypy.org/cherryp....1.2.win32.exe)
5) Lisää uusi järjestelmämuuttuja ( Käynnistä > Asetukset > Ohjauspaneeli > Järjestelmä > Lisäasetukset > Ympäristömuuttujat > Järjestelmämuuttujat > Uusi )
Nimi : GDAL_DATA
Arvo : "C:\Python27\Lib\site-packages\osgeo\data\gdal"
6) Muokkaa Path-järjestelmämuuttujaa lisäämällä sen arvon loppuun ";C:\Python27"
7) Kopio liitteenä oleva map-win.py.gz-tiedosto ja pura se (vaikka Winrarilla) kansioon, johon haluat skriptin asentaa (esim. c:\fmap). Tee tähän kansioon myös map_cache-niminen alikansio.
8) Kopio fetch_map (http://olammi.iki.fi/sw/fetch_map/fetch_map_v30k.zip) ja pura zipistä löytyvästä fetch_map-kansiosta kaikki tiedostot samaan kansioon, kuin edellisessä kohdassa.
9) Kopioi zippi osoitteesta (http://download.osgeo.org/proj/proj446_win32_bin.zip) ja pura proj/bin/-kansiosta proj.exe samaan kansioon kuin edellä.
10) Muokkaa map-win.py-tiedostossa rivillä 19 olevan MAP_CACHE_DIR-muuttujan arvoksi kohdassa 7 tehdyn map_cache-kansion sijanti. ( esim. MAP_CACHE_DIR = 'C:/fmap/map_cache/', huom. käytä vinoviivoja )
11) Käynnistä palvelin tuplaklikkaamalla map-win.py:tä. Jos kaikki toimii, ohjelman ikkunan pitäisi jäädä näkyviin.
12) Lisää Mapperoon muuten samat Tile/Map-repositoryt kuin Linux-ohjeessa, mutta käytä seuraavanlaisia osoitteita
Retkikartta
http://YourServerIP/fmap/rka/%0d/%d/%d.png
Retkikartta 2
http://YourServerIP/fmap/rka2/%0d/%d/%d.png
Kansalaisen karttapaikka
http://YourServerIP/fmap/kkp/%0d/%d/%d.png
jne.

Näillä ohjeilla siis pystytetään web-palvelin, josta Mappero voi hakea karttapaloja. Kun Mappero pyytää karttapalan, hakee palvelin ensin karttapalan Kansalaisen karttapaikasta/Retkikartta.fi:stä, muuntaa sen Mapperon käyttämään muotoon ja lähettää Mapperolle. Eli koneen, jossa palvelin pyörii pitää saada yhteys Internetiin ja N900:sta pitää saada yhteys palvelimeen. Palvelin kuuntelee kaikissa koneeseen asetetuissa IP-osoitteissa(portissa 80).

Esim. jos palvelin ja N900:nen on yhdistetty samaan WLAN-reitittimeen, joka sallii liikenteen siihen kytkettyjen laitteiden välillä (ja palvelinkoneessa on palomuurissa sallittu liikenne porttiin 80), pitäisi N900:sesta saada yhteys palvelimeen. Tällöin "YourServerIP"-kohtaan laitettavan IP-osoitteen saa selville (Käynnistä->Suorita->Avaa: "cmd"->OK->ipconfig).

jussihoo 2010-12-06 11:58

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by orava (Post 890055)
Installation instructions for Linux (with Apache and mod_python already installed):

This is awesome news!!!

For me though there is a small problem. I do have a windows XP based Apache webserver with PHP and everything and I could install also Python and mod_python easily but I am afraid that those other files, like libgdal1-1.7.0 can't be installed to that windows server.

Hmmm... I would not like like to set-up a Linux server from scratch but maybe that's the only option. I need to look into this.

ossipena 2010-12-06 18:01

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by jussihoo (Post 878677)
I have this URL for these Finnish topo maps set on the Mappero and it has worked just fine on both my N810 and N900 since two years.

well keeping in mind that topomaps at N900's mappero is a hack, the topomaps were officially for OS2008 (N800&N810).

so licence expiration about 2 years after the release seems pretty logical to me.

yes it is shame but I have been expecting this for over an year now myself...

zimon 2010-12-06 22:35

Re: License for Finnish topo maps has expired?
 
Mappero and modRana can use (a common) sqlite-database nowadays for map tiles.
If you go around license restrictions anyway, why not download all available map tiles and create a sqlite database of those to be shared between Finnish N900-users?

I am sure, the hack like that will stop working in some day when enough people start to use it.

tekojo 2010-12-07 08:50

Re: License for Finnish topo maps has expired?
 
Hi all,

I'm trying to find someone inside Nokia to tell me how the Topomaps deal and system worked. The actual map material is owned by Karttakeskus (Finnish National Survey).

So I'll find out what has happened and can we do something about it, and get back here.
It might take a while though, I have a clue on where to start, but nothing concrete yet.

Tero

P.S. Yes, this came out of the blue to me too. And I would like to have them back. They are the only reliable map I have around our summer cottage.

jussihoo 2010-12-07 11:59

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by tekojo (Post 891293)
Hi all,

I'm trying to find someone inside Nokia to tell me how the Topomaps deal and system worked. The actual map material is owned by Karttakeskus (Finnish National Survey).

So I'll find out what has happened and can we do something about it, and get back here.
It might take a while though, I have a clue on where to start, but nothing concrete yet.

Don't bother. I allready did this some time ago and exchanged a few e-mails both with the NLS (Maanmittauslaitos) and with Nokia. The deal is off and that's it, nothing to be done. But let's see if this awesome service will return some day in some form.

jussihoo 2010-12-07 12:03

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by ossipena (Post 890788)
so licence expiration about 2 years after the release seems pretty logical to me.

I agree. That was what I came to think as well.

extechop 2010-12-09 07:43

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by ossipena (Post 890788)
well keeping in mind that topomaps at N900's mappero is a hack, the topomaps were officially for OS2008 (N800&N810).

so licence expiration about 2 years after the release seems pretty logical to me.

For some reason I think that two years is a slightly short lifetime for devices which cost around 500€, but maybe it's just me...

samivee 2010-12-10 00:42

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by orava (Post 890055)
1) Install required packages proj-bin, libgdal1-1.7.0, python-gdal and python-imaging ("apt-get install proj-bin libgdal1-1.7.0 python-gdal python-imaging").
2) Download fetch_map(http://olammi.iki.fi/sw/fetch_map/download.php) and attached "map.py.gz". Gunzip and copy map.py to some dir on your web server and extract all files from fetch_map dir in fetch_map zip to same directory.
3) If needed modify MAP_CACHE_DIR(default is "./map_cache") and allow writing to that directory.
4) Now it should work. You can try to fetch a tile for example with "map.py?kkp2/7/72/36.png". Because of the transformations text in farther zoom levels is not very well readable but closer zoom levels are fine.

I tried to play around with my Ubuntu 9.10 installation, and I got the apache2 with mod_python installed. The map.py seems to work from command line just OK as does fetch_map.py, but for some reason I get errors when I'm trying to invoke map.py via browser (http://localhost/py/map.py?kkp2/7/72/36.png).

Here's the output:
Code:

MOD_PYTHON ERROR

ProcessId:      15433
Interpreter:    '127.0.1.1'

ServerName:    '127.0.1.1'
DocumentRoot:  '/var/www'

URI:            '/py/map.py'
Location:      None
Directory:      '/var/www/py/'
Filename:      '/var/www/py/map.py'
PathInfo:      ''

Phase:          'PythonHandler'
Handler:        'mod_python.publisher'

Traceback (most recent call last):

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 213, in handler
    published = publish_object(req, object)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 425, in publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

  File "/usr/lib/python2.6/dist-packages/mod_python/util.py", line 554, in apply_fs_data
    return object(**args)

  File "/var/www/py/map.py", line 513, in index
    im = getTile(z,x,y, service)

  File "/var/www/py/map.py", line 91, in getTile
    (im, ozi_map_data) = Fetch_And_Return_Map(fmservice, COORDTYPE, C_N, C_E, size, size, parameters)

  File "/var/www/py/map.py", line 215, in Fetch_And_Return_Map
    fetch_map.DoFetch(0, im, fmservice, LL_N, LL_E, UR_N, UR_E, MAPSIZE_X, MAPSIZE_Y, parameters)

  File "/var/www/py/fetch_map.py", line 770, in DoFetch
    sys.exit(1)

SystemExit: 1

Entering e.g. "python map.py -z 7 -x 72 -y 36 -s kkp2" from command line works OK, so it's likely something in my apache setup? Or does that ending up to sys.exit(1) in line 770 in fetch_map.py indicate that the map_cache directory cannot be accessed?

-sami

orava 2010-12-10 09:12

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by samivee (Post 893666)
I tried to play around with my Ubuntu 9.10 installation, and I got the apache2 with mod_python installed. The map.py seems to work from command line just OK as does fetch_map.py, but for some reason I get errors when I'm trying to invoke map.py via browser (http://localhost/py/map.py?kkp2/7/72/36.png).

Here's the output:
Code:

MOD_PYTHON ERROR

ProcessId:      15433
Interpreter:    '127.0.1.1'

ServerName:    '127.0.1.1'
DocumentRoot:  '/var/www'

URI:            '/py/map.py'
Location:      None
Directory:      '/var/www/py/'
Filename:      '/var/www/py/map.py'
PathInfo:      ''

Phase:          'PythonHandler'
Handler:        'mod_python.publisher'

Traceback (most recent call last):

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 213, in handler
    published = publish_object(req, object)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 425, in publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

  File "/usr/lib/python2.6/dist-packages/mod_python/util.py", line 554, in apply_fs_data
    return object(**args)

  File "/var/www/py/map.py", line 513, in index
    im = getTile(z,x,y, service)

  File "/var/www/py/map.py", line 91, in getTile
    (im, ozi_map_data) = Fetch_And_Return_Map(fmservice, COORDTYPE, C_N, C_E, size, size, parameters)

  File "/var/www/py/map.py", line 215, in Fetch_And_Return_Map
    fetch_map.DoFetch(0, im, fmservice, LL_N, LL_E, UR_N, UR_E, MAPSIZE_X, MAPSIZE_Y, parameters)

  File "/var/www/py/fetch_map.py", line 770, in DoFetch
    sys.exit(1)

SystemExit: 1

Entering e.g. "python map.py -z 7 -x 72 -y 36 -s kkp2" from command line works OK, so it's likely something in my apache setup? Or does that ending up to sys.exit(1) in line 770 in fetch_map.py indicate that the map_cache directory cannot be accessed?

-sami

It seems that relative path names shouldn't be used when script is executed with mod_python. So if you're using default MAP_CACHE_DIR="./map_cache" try to change it to "/var/www/py/map_cache/".

samivee 2010-12-10 21:07

Re: License for Finnish topo maps has expired?
 
Thanks for the help, that was one part of the solution.

In addition to that, the kkp-directory under map_cache was created apparently with such access rights after my command line testing that the apache "www-data" user did not have rights to write to that directory. I gave www-data the rights to map_cache using chown, then deleted the contents of map_cache and then it started to work. Which was nice.

So, thanks a thousand for this. Now it's time to backup my precious Finnish TopoMaps cache and start playing with Mappero....

samivee 2010-12-10 22:50

Re: License for Finnish topo maps has expired?
 
I declare victory! Had to fight a bit with crashing Mappero (it did not want to add new repositories) and then had to figure out how to actually connect to my server through firewall.

But what a reward, Kansalaisen Karttapaikka at least works like a charm. And it's actually pretty fast too.

Once more, a BIG thank you for this gem of a script!

jussihoo 2010-12-10 23:48

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by samivee (Post 894338)
I declare victory! Had to fight a bit with crashing Mappero (it did not want to add new repositories) and then had to figure out how to actually connect to my server through firewall.

But what a reward, Kansalaisen Karttapaikka at least works like a charm. And it's actually pretty fast too.

Once more, a BIG thank you for this gem of a script!

Yes!!!!! It works.... And is suprisingly fast!! What a great start for the weekend!!:D Thanks orava

tanheis 2010-12-12 00:31

Re: License for Finnish topo maps has expired?
 
Hi

I tried to get it work but no luck.
It seems it downloads one png file to map_cache.

Code:

MOD_PYTHON ERROR

ProcessId:      14029
Interpreter:    'localhost.localdomain'

ServerName:    'localhost.localdomain'
DocumentRoot:  '/var/www'

URI:            '/py/map.py'
Location:      None
Directory:      '/var/www/'
Filename:      '/var/www/py/map.py'
PathInfo:      ''

Phase:          'PythonHandler'
Handler:        'mod_python.publisher'

Traceback (most recent call last):

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 213, in handler
    published = publish_object(req, object)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 425, in publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

  File "/usr/lib/python2.6/dist-packages/mod_python/util.py", line 554, in apply_fs_data
    return object(**args)

  File "/var/www/py/map.py", line 513, in index
    im = getTile(z,x,y, service)

  File "/var/www/py/map.py", line 97, in getTile
    gdal.FileFromMemBuffer('/vsimem/pnginmem', png_buf.getvalue())

AttributeError: 'module' object has no attribute 'FileFromMemBuffer'


MODULE CACHE DETAILS

Accessed:      Sun Dec 12 02:25:33 2010
Generation:    10

_mp_fd12b95901119bc5973f096a3acd7cf2 {
  FileName:    '/var/www/py/coordinates.py'
  Instance:    1
  Generation:  1
  Modified:    Fri Aug  6 16:36:29 2010
  Imported:    Sun Dec 12 02:07:22 2010
}

_mp_67ddd361d50674d6ee9af4d957be66c6 {
  FileName:    '/var/www/py/fetch_map.py'
  Instance:    3
  Generation:  9
  Modified:    Sun Dec 12 02:13:59 2010
  Imported:    Sun Dec 12 02:14:02 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fms.py',
                '/var/www/py/fms_kkp.py',
                '/var/www/py/fms_rka.py'
}

_mp_c5e1beab0460b294bbab446b8d633cf6 {
  FileName:    '/var/www/py/fms.py'
  Instance:    1
  Generation:  2
  Modified:    Thu Feb 11 22:01:48 2010
  Imported:    Sun Dec 12 02:07:22 2010
}

_mp_f5f3091beb3a9fcdc266bb60b0f0d9f2 {
  FileName:    '/var/www/py/fms_kkp.py'
  Instance:    1
  Generation:  3
  Modified:    Sat Dec 11 22:42:48 2010
  Imported:    Sun Dec 12 02:07:22 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fms.py'
}

_mp_3b50c43383e854a21433025c31deeaff {
  FileName:    '/var/www/py/fms_rka.py'
  Instance:    1
  Generation:  4
  Modified:    Wed Nov  3 13:50:13 2010
  Imported:    Sun Dec 12 02:07:22 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fms.py'
}

_mp_9c79b27f7f602d61fc4d48f3a5f2dbac {
  FileName:    '/var/www/py/map.py'
  Instance:    3
  Generation:  10
  Modified:    Sun Dec 12 02:12:56 2010
  Imported:    Sun Dec 12 02:14:02 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fetch_map.py'
}

running map.py from console loads more maps but then fails.


Code:

python map.py -z 7 -x 72 -y 36 -s kkp2
Progress: 0.0 %, images left 4 (cached, fetched, blank: 0, 4, 0)
Fetched map image (N,E)=(6540000.00, 0.00)
Progress: 25.0 %, images left 3 (cached, fetched, blank: 0, 3, 0)
Fetched map image (N,E)=(6540000.00, 300000.00)
Progress: 50.0 %, images left 2 (cached, fetched, blank: 0, 2, 0)
Fetched map image (N,E)=(6812500.00, 0.00)
Progress: 75.0 %, images left 1 (cached, fetched, blank: 0, 1, 0)
Fetched map image (N,E)=(6812500.00, 300000.00)
Traceback (most recent call last):
  File "map.py", line 499, in <module>
    main()
  File "map.py", line 489, in main
    im = getTile(z,x,y,service)
  File "map.py", line 97, in getTile
    gdal.FileFromMemBuffer('/vsimem/pnginmem', png_buf.getvalue())
AttributeError: 'module' object has no attribute 'FileFromMemBuffer'

I was just wondering what could be wrong...

purgiaali 2010-12-12 08:45

Re: License for Finnish topo maps has expired?
 
1 Attachment(s)
Tanheis
You might have older vesion of libgdal installed.


I seem to have found a bug in the script.

Attachment 16289
map.py?kpp/15/18606/9313.png

cjp 2010-12-12 09:01

Re: License for Finnish topo maps has expired?
 
You guys are crazy hackers and I love you.

I hope everything works out for all of you o/

orava 2010-12-12 18:32

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by purgiaali (Post 895070)
Tanheis
You might have older vesion of libgdal installed.


I seem to have found a bug in the script.

Attachment 16289
map.py?kpp/15/18606/9313.png

I'm not totally sure what's causing that but changing script to do transformation to bigger map image seems to fix it. This can be done by replacing the number 0.4 with 0.5 on the line 46.

tanheis 2010-12-12 19:14

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by purgiaali (Post 895070)
Tanheis
You might have older vesion of libgdal installed.

I updated libgdal.

Still not working.

apache2 log:
Code:

[Sun Dec 12 21:08:31 2010] [error] [client ::1] SystemExit: 1
[Sun Dec 12 21:09:45 2010] [notice] mod_python (pid=1442, interpreter='::1'): Reimporting module '/var/www/py/map.py'
[Sun Dec 12 21:09:46 2010] [notice] mod_python (pid=1442, interpreter='::1'): Reimporting module '/var/www/py/fetch_map.py'
[Sun Dec 12 21:09:46 2010] [error] [client ::1] mod_python (pid=1442, interpreter='::1', phase='PythonHandler', handler='mod_python.publisher'): Application error
[Sun Dec 12 21:09:46 2010] [error] [client ::1] ServerName: '::1'
[Sun Dec 12 21:09:46 2010] [error] [client ::1] DocumentRoot: '/var/www'
[Sun Dec 12 21:09:46 2010] [error] [client ::1] URI: '/py/map.py'
[Sun Dec 12 21:09:46 2010] [error] [client ::1] Location: None
[Sun Dec 12 21:09:46 2010] [error] [client ::1] Directory: '/var/www/'
[Sun Dec 12 21:09:46 2010] [error] [client ::1] Filename: '/var/www/py/map.py'
[Sun Dec 12 21:09:46 2010] [error] [client ::1] PathInfo: ''
[Sun Dec 12 21:09:46 2010] [error] [client ::1] Traceback (most recent call last):
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n    default=default_handler, arg=req, silent=hlist.silent)
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target\n    result = _execute_target(config, req, object, arg)
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target\n    result = object(arg)
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 213, in handler\n    published = publish_object(req, object)
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 425, in publish_object\n    return publish_object(req,util.apply_fs_data(object, req.form, req=req))
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/usr/lib/python2.6/dist-packages/mod_python/util.py", line 554, in apply_fs_data\n    return object(**args)
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/var/www/py/map.py", line 513, in index\n    im = getTile(z,x,y, service)
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/var/www/py/map.py", line 79, in getTile\n    fmservice = fetch_map.GetFMService(SERVICE_CODE)
[Sun Dec 12 21:09:46 2010] [error] [client ::1]  File "/var/www/py/fetch_map.py", line 407, in GetFMService\n    sys.exit(1)
[Sun Dec 12 21:09:46 2010] [error] [client ::1] SystemExit: 1

This is what I get to www-browser..
Code:

MOD_PYTHON ERROR

ProcessId:      1443
Interpreter:    '::1'

ServerName:    '::1'
DocumentRoot:  '/var/www'

URI:            '/py/map.py'
Location:      None
Directory:      '/var/www/'
Filename:      '/var/www/py/map.py'
PathInfo:      ''

Phase:          'PythonHandler'
Handler:        'mod_python.publisher'

Traceback (most recent call last):

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 213, in handler
    published = publish_object(req, object)

  File "/usr/lib/python2.6/dist-packages/mod_python/publisher.py", line 425, in publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

  File "/usr/lib/python2.6/dist-packages/mod_python/util.py", line 554, in apply_fs_data
    return object(**args)

  File "/var/www/py/map.py", line 513, in index
    im = getTile(z,x,y, service)

  File "/var/www/py/map.py", line 79, in getTile
    fmservice = fetch_map.GetFMService(SERVICE_CODE)

  File "/var/www/py/fetch_map.py", line 407, in GetFMService
    sys.exit(1)

SystemExit: 1


MODULE CACHE DETAILS

Accessed:      Sun Dec 12 21:13:13 2010
Generation:    6

_mp_fd12b95901119bc5973f096a3acd7cf2 {
  FileName:    '/var/www/py/coordinates.py'
  Instance:    1
  Generation:  1
  Modified:    Fri Aug  6 16:36:29 2010
  Imported:    Sun Dec 12 21:08:29 2010
}

_mp_67ddd361d50674d6ee9af4d957be66c6 {
  FileName:    '/var/www/py/fetch_map.py'
  Instance:    2 [RELOAD]
  Generation:  7
  Modified:    Sun Dec 12 21:09:19 2010
  Imported:    Sun Dec 12 21:13:13 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fms.py',
                '/var/www/py/fms_kkp.py',
                '/var/www/py/fms_rka.py'
}

_mp_c5e1beab0460b294bbab446b8d633cf6 {
  FileName:    '/var/www/py/fms.py'
  Instance:    1
  Generation:  2
  Modified:    Thu Feb 11 22:01:48 2010
  Imported:    Sun Dec 12 21:08:29 2010
}

_mp_f5f3091beb3a9fcdc266bb60b0f0d9f2 {
  FileName:    '/var/www/py/fms_kkp.py'
  Instance:    1
  Generation:  3
  Modified:    Sat Dec 11 22:42:48 2010
  Imported:    Sun Dec 12 21:08:29 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fms.py'
}

_mp_3b50c43383e854a21433025c31deeaff {
  FileName:    '/var/www/py/fms_rka.py'
  Instance:    1
  Generation:  4
  Modified:    Wed Nov  3 13:50:13 2010
  Imported:    Sun Dec 12 21:08:29 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fms.py'
}

_mp_9c79b27f7f602d61fc4d48f3a5f2dbac {
  FileName:    '/var/www/py/map.py'
  Instance:    2 [RELOAD]
  Generation:  8
  Modified:    Sun Dec 12 21:09:19 2010
  Imported:    Sun Dec 12 21:13:13 2010
  Children:    '/var/www/py/coordinates.py',
                '/var/www/py/fetch_map.py'
}


orava 2010-12-12 20:07

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by tanheis (Post 895408)
I updated libgdal.

Still not working.

You have maybe misspelled the map service part(kkp, kkp2, rka, rka2...) in the URL?

tanheis 2010-12-14 22:21

Re: License for Finnish topo maps has expired?
 
Got it working.
Thanks for the script!

orava 2010-12-18 09:11

Re: License for Finnish topo maps has expired?
 
I added Finnish instructions how to use script on Windows to post #6 (http://talk.maemo.org/showpost.php?p=890055&postcount=6)

slender 2010-12-18 11:10

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by orava (Post 899271)
I added Finnish instructions how to use script on Windows to post #6 (http://talk.maemo.org/showpost.php?p=890055&postcount=6)

Mahtavaa. Tulipahan mieleen, että pitäisikö tuohon laittaa lisähuomiona, että käyttäjän oletetaan tietävän kuinka mahdollinen palomuuri niin koneella/modeemissa säädetään niin, että tarvittavat portit avataan maailmalle. Tuskin tänne nyt kukaan täysin tietämätön ihan heti eksyy, mutta en nyt kauheasti ihmettele, jos joku valittaa ettei toimi ja kone on esim. NAT:n takana ja kaverilla ei ole mitään hajua siitä miten säädetään, mutta kun ohjeet näytti niin helpoilta :)
---
Just mumbling about noobs and firewalls & NAT.

purgiaali 2010-12-18 13:39

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by orava (Post 899271)
I added Finnish instructions how to use script on Windows to post #6 (http://talk.maemo.org/showpost.php?p=890055&postcount=6)

This might be lighter solution than mine. :)

I used the script in a virtual machine with debian in my windows machine. That felt easier for me.

I also tried running the script in easy-debian chroot in n900, but that turned out to be way too slow. :(

jussihoo 2010-12-19 17:33

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by orava (Post 899271)
I added Finnish instructions how to use script on Windows to post #6 (http://talk.maemo.org/showpost.php?p=890055&postcount=6)

Apache tuossa varmasti myös tarvitaan ja se mod_pyton eikö niin? Windows ohjeissa ei tätä mainittu ollenkaan.

Onko väliä mikä Apachen versio siellä pyörii? Toimiiko noilla ohjeilla XP:llä ja Windows 7:lla.

Suuret kiitokset! :)

orava 2010-12-19 20:04

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by jussihoo (Post 900043)
Apache tuossa varmasti myös tarvitaan ja se mod_pyton eikö niin? Windows ohjeissa ei tätä mainittu ollenkaan.

Onko väliä mikä Apachen versio siellä pyörii? Toimiiko noilla ohjeilla XP:llä ja Windows 7:lla.

Suuret kiitokset! :)

Tossa käytetään CherryPy:tä web-palvelimena eli ei tartte Apachea eikä mod_pythonia. XP:llä toimii ainakin, varmaan seiskallakin.

orava 2010-12-19 20:48

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by slender (Post 899310)
Mahtavaa. Tulipahan mieleen, että pitäisikö tuohon laittaa lisähuomiona, että käyttäjän oletetaan tietävän kuinka mahdollinen palomuuri niin koneella/modeemissa säädetään niin, että tarvittavat portit avataan maailmalle. Tuskin tänne nyt kukaan täysin tietämätön ihan heti eksyy, mutta en nyt kauheasti ihmettele, jos joku valittaa ettei toimi ja kone on esim. NAT:n takana ja kaverilla ei ole mitään hajua siitä miten säädetään, mutta kun ohjeet näytti niin helpoilta :)
---
Just mumbling about noobs and firewalls & NAT.

Joo pitikin alunperin noista mainita, mutta unohdin. Ei välttämättä mikään kovin tietoturvallinen toi skripti eli ite käytän ainakin vaan paikallisessa verkossa.

matinvesi 2010-12-28 07:05

Re: License for Finnish topo maps has expired?
 
Many thanks to Orava. The guidelines are clear. The python script was easy to install and Apache server, too. Does the script suit to 64 bit system? I have 64 bit SuSe linux 11.3 with all needed packages. From command line: python map.py -z 7 -x 72 -y 36 -s kkp2 results: "Segmentation fault".

Mandibela 2011-01-05 19:53

Re: License for Finnish topo maps has expired?
 
Imma warm this thread up. No news with finnish-topomaps sadly!

I found this:

https://projects.forum.nokia.com/ovi.../documentation

Could someone make Mappero use tiles from ovi maps? That could be useful... Not anywhere near the usability of NLS map data, but another tile renderer service nonetheless: https://projects.forum.nokia.com/ovi.../wiki/examples look usable. I'm not too familiar with the Mappero method of requesting tiles... A friendly person could share a suitable method maybe?

In the future, it would be nice to have the ovi map data merged with the digital format available today (for purchase)... like http://www.paikkatietoikkuna.fi - all NLS data is available in vector format alrady, Nokia could purchase the extra data (maybe already has? =) to make an alternative map data source available (for all ovi maps clients), offering similar info as available from NLS in the form of those (old) topomaps. I've seen some garmin handheld GPS devices with vector data on them, they're not too bad looking.

slender 2011-01-11 20:23

Re: License for Finnish topo maps has expired?
 
@ Mandibela
Did you read this topic fully?

matinvesi 2011-01-13 19:55

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by matinvesi (Post 905804)
... python map.py -z 7 -x 72 -y 36 -s kkp2 results: "Segmentation fault".

Server is up and fetching maps to Mappero. Amazing. The problem solved when I find a very good Geo -application repository to SuSe 11.3: http://download.opensuse.org/reposit...plication:/Geo and updated all relevant packages.

Mandibela 2011-03-02 19:19

Re: License for Finnish topo maps has expired?
 
Quote:

Originally Posted by slender (Post 918141)
@ Mandibela
Did you read this topic fully?

Yes.



ö

justjuha 2011-03-14 22:24

Re: License for Finnish topo maps has expired?
 
Can similar trick be done with (or for) N810?
What you have discussed about Mappero looks different in Maemo Mapper.

I guess the maps were anyway loaded from the same place before somebody screw up this whole (really nice) thing.

(Answer in Finnish would be also accepted);)

sconf 2011-03-15 08:30

Re: License for Finnish topo maps has expired?
 
This works for Maemo Mapper also. Just set up repository in Maemo Mapper like it is done there, and use same (well...your own server) urls for repository like instructed in first page of this thread.

Atrakki 2011-03-15 20:42

Re: License for Finnish topo maps has expired?
 
Hello,

I got a following message while trying to fetch the tiles to my phone.

Quote:

[15/Mar/2011:21:31:40] HTTP
Request Headers:
HOST: 192.168.11.4
TE: trailers
USER-AGENT: gnome-vfs/2.16.3 neon/0.25.4
CONNECTION: TE
Remote-Addr: 192.168.11.3
192.168.11.3 - - [15/Mar/2011:21:31:40] "GET /fmap/kkp/14/9451/4480.png HTTP/1.1" 500 1998 "" "gnome
-vfs/2.16.3 neon/0.25.4"
Progress: 0.0 %, images left 4 (cached, fetched, blank: 3, 1, 0)
Using cached map image (N,E)=(6969460.00, 532800.00)
Progress: 25.0 %, images left 3 (cached, fetched, blank: 2, 1, 0)
Fetched map image (N,E)=(6969460.00, 535200.00)
Progress: 50.0 %, images left 2 (cached, fetched, blank: 2, 0, 0)
Using cached map image (N,E)=(6971640.00, 532800.00)
Progress: 75.0 %, images left 1 (cached, fetched, blank: 1, 0, 0)
Using cached map image (N,E)=(6971640.00, 535200.00)
ERROR 4: Unable to open EPSG support file gcs.csv.
Try setting the GDAL_DATA environment variable to point to the
directory containing EPSG csv files.
ERROR 5: Access window out of range in RasterIO(). Requested
(636740,-524566) of size 611x611 on raster of 500x501.
[15/Mar/2011:21:31:43] HTTP Traceback (most recent call last):
File "C:\Python27\lib\site-packages\cherrypy\_cprequest.py", line 606, in respond
cherrypy.response.body = self.handler()
File "C:\Python27\lib\site-packages\cherrypy\_cpdispatch.py", line 25, in __call__
return self.callable(*self.args, **self.kwargs)
File "C:\fmap\map-win.py", line 479, in fmap
im = getTile(int(z),int(x),int(y), service)
File "C:\fmap\map-win.py", line 147, in getTile
scanline = out_ds.ReadAsArray( int(xoff), int(yoff), int(xsize), int(ysize) )
File "C:\Python27\lib\site-packages\osgeo\gdal.py", line 686, in ReadAsArray
return gdalnumeric.DatasetReadAsArray( self, xoff, yoff, xsize, ysize, buf_obj )
File "C:\Python27\lib\site-packages\osgeo\gdal_array.py", line 193, in DatasetReadAsArray
array_list.append( numpy.reshape( band_array, [1,ysize,xsize] ) )
File "C:\Python27\lib\site-packages\numpy\core\fromnumeric.py", line 169, in reshape
return _wrapit(a, 'reshape', newshape, order=order)
File "C:\Python27\lib\site-packages\numpy\core\fromnumeric.py", line 37, in _wrapit
result = getattr(asarray(obj),method)(*args, **kwds)
ValueError: total size of new array must be unchanged

I did everything as it's said in the installation guide, but i had to download a new version of the GDAL-1.8.0.win32-py2.7.exe.

It download the map tiles to my computer, but it doesn't show/load them in my phone.

Problem solved! I simply forgot to save those enviroment variables. :)

Tuhannet kiitokset oravalle hienosta skriptistä!

ofroberg 2011-04-01 13:45

Re: License for Finnish topo maps has expired?
 
I'm running Ubuntu 8.04 on my server and I get the following error (after going through dependency-hell for an hour or so):

Code:

# python map.py
Traceback (most recent call last):
  File "map.py", line 11, in <module>
    from osgeo import gdal
ImportError: No module named osgeo

Help?


All times are GMT. The time now is 12:29.

vBulletin® Version 3.8.8