Giter Site home page Giter Site logo

py-modestmmarkers's Introduction

modestMMarkers is a simple helper class for drawing polylines and point markers
on ModestMaps derived images using the Cairo vector libraries.

--
        
Here is a very simple example of how to use the code, written in more-or-less
working pseudo-code:

	# points is just a list/tuple of dictionaries
        # with latitude and longitude keys 

        points = [ {'latitude': 123.45, 'longitude' : 67.890}, ... ]

        # The ModestMaps Python interface is out of scope for this
        # document so let's assume you've got things set up and are
        # calling the mapByExtent method

        mm_obj = ModestMaps.mapByExtent( ... )
        mm_img = mm_obj.draw()
            
	# Hey look! modestMMarkers!!

        markers = modestMMarkers.modestMMarkers(mm_obj)

        mm_img = markers.draw_bounding_box(mm_img, points, colour=(1, 0, .005), opacity_fill=.1)
        mm_img = markers.draw_polylines(mm_img, polys)
	mm_img = markers.draw_points(mm_img, points, colour=(.5, 0, 1))

	# That's it. Really.
        
        mm_img.save("/path/to/map.png")

--

In order to use modestMMarkers you will need to install ModestMaps by hand. You
can get all the details for that here:

http://modestmaps.mapstraction.com/trac/wiki/SubversionAccess

There are other dependencies, notably py-cairo and the Python Imaging
Library. The setup.py installation script *should* try to do the right thing but
if you need to install those packages by hand as well, here are the relevant
links: 

http://cairographics.org/pycairo/

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

--

modestMMarker has a long, twisty and tortured beginning that it's trying to
leave behind. If you're bored and want to read about it, start here:

http://www.aaronland.info/weblog/2009/05/02/yakshed/#turkishmmap

py-modestmmarkers's People

Contributors

thisisaaronland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

py-modestmmarkers's Issues

modestMMarkers attribute

I can't get this code to work. It's bailing on

markers = modestMMarkers.modestMMarkers(mm_obj)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'modestMMarkers'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.