Ya so you are falling into a few ditches with clashing names.
That 'mapnik' folder you downloaded from openstreetmaps svn is just
the stylesheet for rendering osm data with Mapnik (it really should be
renamed to prevent honest folks like yourself from being rightly
confused). Rename that folder to something like 'osm-stylesheets' to
avoid python finding that folder and confusing it with the actual
Mapnik installation.
Also you must have a file in there that you named 'cairo.py'. In short
never do that because when your current working directory is the one
containing that file it will be assumed by python to be Cairo rather
than the actual Cairo module. So basically a tricky problem we all get
burned by and hopefully only have to learn once.
Dane
--- \o/ ---
Sent from my phone
On Aug 21, 2010, at 8:19 PM, simon blackmore <[email protected]>
wrote:
Thanks for your help Dane,
Ah I see Cairo is there. Appologies, I think I got confused somewhere.
Removed the macport install now : )
'/Library/Frameworks/Mapnik.framework/Versions/Current/Python/System/
2.5/site-packages/mapnik/__init__.py'
What is really confusing me is that the package I installed from the
following "installing Mapnik" instructions..
"If you haven't already done so, export the Mapnik stuff from the
OSM subversion repository:
svn export http://svn.openstreetmap.org/applications/rendering/mapnik
cd mapnik"
Is here.
/usr/local/Cellar/mapnik/
So currently this is where I edit the xml files, keep the shape
files etc.
But as far as I can make out I only have the one Unix Executable and
thats in the framework. If I move it, I can no longer use Mapnik.
So Mapnik seems to be running fine.
But when I try to import Cairo I get this error.
>>> import mapnik
>>> import cairo
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/mapnik/cairo.py", line 19, in <module>
surface = cairo.SVGSurface(file.name, mapnik_map.width,
mapnik_map.height)
AttributeError: 'module' object has no attribute 'SVGSurface'
>>>
However if I start python from home$
No problem.
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
>>>
Basically I think I have misunderstood where the Mapnik folder with
xml files should be kept.
Any help would be much appreciated.
Many thanks
Simon
to see where your mapnik is coming from. I recommend only
installing mapnik and cairo from one source, and the binary
installer above should work on a vanilla osx system without
homebrew or macports. I recommend uninstalling all things that you
installed with those package managers relating to Mapnik and Cairo.
If the binary installer did not work alone, post why.
I wanted to give Cairo a try so I followed the Mapnik instructions
through Macports and now
that lives here
/opt etc.
When I run the Mapnik svg example script I get this error.
File "./cairo.py", line 8, in <module>
import cairo
File "/usr/local/Cellar/mapnik/cairo.py", line 19, in <module>
surface = cairo.SVGSurface(file.name, mapnik_map.width,
mapnik_map.height)
AttributeError: 'module' object has no attribute 'SVGSurface'
So I guess Mapnik is not finding the Cairo files.
Any ideas what I can do to get my Mapnik files to find them?
Would some sort of symbolic link do it or do I need to try and
reinstall Mapnik ?
Thanks for your help
Simon
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users