'Map' object has no attribute 'resize'?

View: New views
2 Messages — Rating Filter:   Alert me  

'Map' object has no attribute 'resize'?

by Tim Boothby :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi All,

 

I’m new to Mapnik and have been trying to get it set up with the ultimate aim of setting up tile server to serve customised OpenStreetmap tiles of the UK. Working through the tutorials on the website I’ve got the “Hello world” examples working. I’ve not imported the whole world into PostGIS, but have (I think!) successfully imported extracts for the UK.

 

However when I try to render tiles I get the following error after a few seconds –

 

[root@mapnik mapnik]# source set-mapnik-env

[root@mapnik mapnik]# ./customize-mapnik-map >$MAPNIK_MAP_FILE

[root@mapnik mapnik]# ./z0_generate_tiles.py

render_tiles( (-180.0, -90.0, 180.0, 90.0) /root/mapnik/osm.xml /root/mapnik/tiles/ 0 0 World )

Exception in thread Thread-1:

Traceback (most recent call last):

  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner

    self.run()

  File "/usr/lib/python2.5/threading.py", line 446, in run

    self.__target(*self.__args, **self.__kwargs)

  File "./z0_generate_tiles.py", line 106, in loop

    self.render_tile(tile_uri, x, y, z)

  File "./z0_generate_tiles.py", line 82, in render_tile

    self.m.resize(render_size, render_size)

AttributeError: 'Map' object has no attribute 'resize'

 

My Googling of this error has been fruitless, so is anybody able to shed any light on what the problem here is? Any ideas would be very much appreciated.

 

Thanks in advance,


Tim



This email and any files transmitted with it are confidential and intended solely for the use of the individual or organisation to whom they are addressed. If you have received this email in error please notify the sender immediately. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, this email and any attachments have been checked for viruses, but recipients should make their own checks. The company accepts no liability for any damage caused by any virus transmitted by this email.

Opinion Research Services Ltd is registered in England and Wales: company number 2904006

ORS, The Strand, Swansea SA1 1AF – 01792 535300 – www.ors.org.uk

_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: 'Map' object has no attribute 'resize'?

by Dane Springmeyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 14, 2009, at 7:57 AM, Tim Boothby wrote:

AttributeError: 'Map' object has no attribute 'resize'
 
My Googling of this error has been fruitless, so is anybody able to shed any light on what the problem here is? Any ideas would be very much appreciated.

Upgrade to Mapnik 0.6.1. The 'resize' function was not added until the 0.6.0 release.

or change generate_tiles.py to be compatible still with Mapnik 0.5.x:

Index: generate_tiles.py
===================================================================
--- generate_tiles.py (revision 17801)
+++ generate_tiles.py (working copy)
@@ -79,7 +79,8 @@
         # Bounding box for the tile
         bbox = mapnik.Envelope(c0.x,c0.y, c1.x,c1.y)
         render_size = 256
-        self.m.resize(render_size, render_size)
+        self.m.width = render_size
+        self.m.height = render_size
         self.m.zoom_to_box(bbox)
         self.m.buffer_size = 128

Dane



_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users