Giter Site home page Giter Site logo

vahadruya / python_map_plotting Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 626 KB

Plotting customized interactive maps using python roughly, as a temporary substitude to Tableau. Maharashtra state with district borders taken as an example

Jupyter Notebook 100.00%
cartopy folium geojson geopandas interactive-map ipython-display latitude-longitude matplotlib shapefile python

python_map_plotting's Introduction

Python Map Plotting

Contents
  1. About
  2. Methods
  3. Requirements
  4. Transliteration System
  5. Conclusion
  6. Contact

Note

  • Remember to use CTRL+left click on the links
  • There may be display issues for the interactive map in github. Try opening it in colab.

About

Plotting maps using python. Coded roughly, as a quick and temporary substitution for Tableau, when creating a customized map of Maharashtra with relevant locations. For now, minus the terrain and rails/roads, just the state and district borders are of interest.

Maharashtra map just for reference.

Methods

Have plot using two methods.

  1. First using geopandas and cartopy, which produced a crude map which required shapefiles of Maharashtra, a good one of which was difficult to come by. Nevertheless, found some here.
  2. Second, used folium for an interactive map. Much better and refined, location names come as pop-ups on clicks. Required geoJSON files of Maharashtra, got it (with district borders) quite easily from here

Requirements

  1. As stated earlier, shapefiles or geoJSON files depending on the method.
  2. Latitude and Longitude of locations. Easily found from GoogleMaps

Transliteration system

For the location names: To maintain vernacular pronunciation, while still preserving readability as per original script, I have used a self-tampered Harvard-Kyoto transliteration - with the voiced retroflex lateral approximant ळ written as La, and the schwa as Ə.

Example, माळठाण in HK and modified HK are mALaThANa and mALəThANə respectively.

Conclusion

Typically, I'd have preferred the method using geopandas where I can add the distance scale using geopy.distance on the axes limits. The folium method while being interactive and also quite fluid, I cannot seem to find a method to lock in the zoom. Lack of a good shapefile for MH state influences the decision in favour of folium. But, better shapefiles (like one for NYC I found here) would make me choose geopandas.

Contact

Linkedin Gmail

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.