How to use the mapclassify.Equal_Interval function in mapclassify

To help you get started, we’ve selected a few mapclassify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spatialucr / geosnap / geosnap / visualize / viz.py View on Github external
def update_graph_1(jsonified_data, overlay_choice, year_choice):

    gdf = gpd.read_file(jsonified_data)
    tmp = map_layout.copy()
    gdf[gdf['year'] == year_choice]
    gdf = gdf.assign(
        cl=mapclassify.Equal_Interval(gdf[overlay_choice], k=6).yb)
    # Create a layer for each region colored by LEP value

    gdf = gdf[['geoid', 'cl', 'geometry']]

    layers = []

    for i, lyr in enumerate(precomputed_color_ranges):
        example = {
            'name': 'Layer name',
            'source': json.loads(gdf[gdf.cl == i].to_json()),
            'sourcetype': 'geojson',
            'type': 'fill',
            'opacity': 0.8,
            'color': lyr
        }
        layers.append(example)

mapclassify

Classification Schemes for Choropleth Maps.

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

79 / 100
Full package analysis

Similar packages