Giter Site home page Giter Site logo

pygeoplot's Introduction

PyGeoPlot

A library for plotting data on the map.

Demo: Moscow CCTV cameras

Teaser Image: Using PyGeoPlot in IPython Notebook

Tutorial

Installing

To install PyGeoPlot just clone the repository and run setup.py.

$ git clone https://github.com/romovpa/pygeoplot.git
$ cd pygeoplot
$ python setup.py install

Creating map canvas

import pygeoplot as gp

m = gp.Map()

To see empty map in your Notebook say display():

m.display()

You can specify size of the map container and even make it resizeable (by dragging the lower right corner):

m.display(width=600, height=300, resizeable=True)

Drawing a line

points = [
    (55.864414, 37.401979),
    (55.575286, 37.635438),
    (55.845875, 37.801606),
    (55.665433, 37.426698),
    (55.685610, 37.830446),
    (55.864414, 37.401979),
]
m.add_line(line_points, color="#FF0000", width=10, opacity=0.6)

Setting zoom and the center point

center_point = (55.72, 37.64)
m.set_state(center_point, zoom=12)

Adding placemarks

m.add_placemark((55.702770, 37.529184),
                hint='Alma Mater', content='Moscow State University')
m.add_placemark((55.711552, 37.621861),
                hint='The Center of the pentagram')

The content could contain any valid HTML:

m.add_placemark((55.711552, 37.621861), hint='A Cat',
    content='<img width=300 height=200 src="http://www.findcatnames.com/wp-content/uploads/2014/09/453768-cats-cute.jpg" />')

Heatmap

You can visualize a set of geo-points with heatmap. The feature is implemented by using Yandex Maps API Heatmap Module.

points = [
    (55.864414, 37.401979),
    ...
]
m.add_heatmap(heatmap_points)

Moscow CCTV cameras demo contains an example of the heatmap of the real data.

Saving map to stand-alone HTML file

After completing your visualization, you could write it into stand-alone HTML file and share with colleagues.

m.save_html('map_with_data.html')

An example of exported HTML from CCTV demo: ipynb/demo-moscow-cctv-heatmap.html.

Further Work

Todo-list

  • robust and clear javascript code base
  • drawing polygons and circles
  • changing locales

Wanna-list

pygeoplot's People

Contributors

alexfridman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygeoplot's Issues

Can't import after install

import pygeoplot
Traceback (most recent call last):
File "", line 1, in
File "C:\Python37\lib\site-packages\pygeoplot_init_.py", line 1, in
from api import *
ModuleNotFoundError: No module named 'api'

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.