Giter Club home page Giter Club logo

autozoom's Introduction

autozoom

Fast and automated formatting toolkit for Folium maps

Summary

autozoom parses and manages your geoJSON data to make Folium more convient. For example, autozoom will zoom to a specific state in a map of the US. When the map loads, it will be centered on that state instead of Folium's default extent, which in this case would be the entire country. autozoom calculates the 3D centroid of the spherical polygon created by the maximum bounding triangle of a specified geography. Folium then zooms to extent of bounding polygon and centers the map on the polygon's spherical center of mass.

autozoom is built to work in Folium without additional dependencies, and calculations use only standard libraries. It's based off of Shapely, but is designed to be cloned and run within your own projects to reduce dependencies and speed up processing. It offers a set of spherical geometry and and spatial statistics tools that integrate seamlessly into Folium, Leaflet and web mapping workflows. Check out the full set of features and the development progress below.

Motivation

autozoom grew out of a series of data analysis projects for the Rhode Island Division of Planning, where I worked with the Statewide Planning Program to analyze RIGIS data and identify where suburban sprawl occurred and is likely to accelerate. After the analysis finished, I got fixated on why sprawl was happening in some places (like the southern part of the state) and not others (the north). I aim to use Census nonemployer statistics to analyze trends in the workforce that accompany or drive sprawl and map those changes with Folium.

However, although data analysis in Python is robust, web mapping in Python is limited. autozoom contributes to a growing set of tools for web mapping in Python that integrate with common Python data analysis workflows—like coverting Pandas dataframes to geoJSON.

Updates

1/15/17: installed parse(). parse() works with pandas to manage geoJSON latitude and longitude data when developing a Folium chloropleth. Enter any dataframe to into parse(df) to zoom to the geography (e.g., a database of states) specified in the dataframe. Pandas dataframes bind with Folium chloropleths using the sample below.

map_it.choropleth(geo_path = geo_path,
                 data = df,
                 columns = ['code', 'value'],
                 key_on = 'feature.properties.STATE',
                 fill_color = 'PuRd',
                 fill_opacity = 0.9,
                 line_opacity = 0.2)

1/24/17: started center(). center() finds the spherical centroid of data entered into parse(). center() makes it easy for Folium to center a map on a geoJSON file, or on a sub-section of geoJSON data specified with a pandas dataframe.

Next: test and update center(); install manager(), a system to connects various functions, such as parse() and center(), in a user-friendly interface you can call in your web mapping workflow.

autozoom's People

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.