Python modules for image / map manipulation?

Robert Kern rkern at ucsd.edu
Mon Apr 4 21:35:40 EDT 2005


Stewart Midwinter wrote:
> I would like to do some image / map manipulation with Python. 
> 
> I've got a very large map file in .png format. My thought is to chop
> it up into small tiles using some method.  What Python module would be
> helpful for this?

The PIL. I'm not sure how well it handles files of your size (not least 
because you haven't actually *said* how large it is).

   http://www.pythonware.com/products/pil/

If that doesn't work, non-Python software, like ImageMagick, might do 
the trick.

   http://www.imagemagick.org/

> Next, when I obtain the start and end co-ordinates of a user's trip,
> I'd like to stitch together the approriate tiles and present the
> images that show the terrain the user has travelled over.
> 
> Lastly, I'd like to plot the GPS tracklog of the trip on top of the map. 
> 
> Any suggestions for modules or projects to help accomplish this?  It's
> a non-commercial hobby application.

Even if the PIL can't handle the big image, it should work like a charm 
piecing together the tiles afterwards.

I use PROJ.4 via pipes for cartographic projections.

   http://proj.maptools.org/

There is an addon to the matplotlib plotting library that contains a 
binding for the PROJ.4 library, but I haven't gotten it to work on my Mac.

   http://matplotlib.sourceforge.net/toolkits.html
 
http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=142792

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter




More information about the Python-list mailing list