![]() |
2010-12-07
, 11:59
|
Posts: 18 |
Thanked: 4 times |
Joined on Jan 2010
|
#11
|
![]() |
2010-12-07
, 12:03
|
Posts: 18 |
Thanked: 4 times |
Joined on Jan 2010
|
#12
|
![]() |
2010-12-09
, 07:43
|
|
Posts: 51 |
Thanked: 10 times |
Joined on Feb 2010
@ Helsinki, Finland
|
#13
|
![]() |
2010-12-10
, 00:42
|
Posts: 6 |
Thanked: 2 times |
Joined on Dec 2009
|
#14
|
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.
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
The Following User Says Thank You to samivee For This Useful Post: | ||
![]() |
2010-12-10
, 09:12
|
Posts: 223 |
Thanked: 323 times |
Joined on Dec 2010
|
#15
|
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:
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?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
-sami
![]() |
2010-12-10
, 21:07
|
Posts: 6 |
Thanked: 2 times |
Joined on Dec 2009
|
#16
|
![]() |
2010-12-10
, 22:50
|
Posts: 6 |
Thanked: 2 times |
Joined on Dec 2009
|
#17
|
![]() |
2010-12-10
, 23:48
|
Posts: 18 |
Thanked: 4 times |
Joined on Jan 2010
|
#18
|
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!
![]() |
2010-12-12
, 00:31
|
Posts: 4 |
Thanked: 0 times |
Joined on Dec 2010
|
#19
|
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' }
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'