Skip to content

uitr-lab/py-map-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

py-map-gen

Easy to use map generator, generates a self contained html file that displays a hex-map, square-map, or custom (shp file) polygon histogram map

  1. Get an access-token from mapbox.
  2. Update config in VIS.ipynb
  3. Generate output map

Hex grid with arcs

config={
    "input": "./example/Book3.xlsx",
    "map": {
        
        # go to https://www.mapbox.com/ sign up and find your access token
        "access-token": "XXXXXXXXX",
        "options-json":{
            "style": "dark", # [light, dark, street]
            "grid":"hex", # [hex, square] default: hex, 
            "source-color": "#d00b8abd",  # [00-ff], #{a}{r}{g}{b}
            "dest-color": "#b0c334eb",
            "hex-grid-zoom":8, # only if using hexmap
            "square-size":1000, # meters, only if using square cells
            "min-height":50,
            "height-scale":30,
            "arc-width":1,
            "data-sample":1,
            "arc-opacity":0.6, # if 0, then arcs are ommited
            "arc-sample":0.2,
            "grid-opacity":0,
        }
    }
}
Hex Grid: 8z with arcs

Hex Grid: 8z with arcs

Square grid with arcs

config={
    "input": "./example/Input_Arc.csv",
    "map": {
        
        # go to https://www.mapbox.com/ sign up and find your access token
        "access-token": "XXXXXXXXX",
        "options-json":{
            "style": "light", # [light, dark, street]
            "grid":"square", # [hex, square] default: hex, 
            "source-color": "#d00b8abd",  # [00-ff], #{a}{r}{g}{b}
            "dest-color": "#b0c334eb",
            "hex-grid-zoom":8, # only if using hexmap
            "square-size":400, # meters, only if using square cells
            "min-height":50,
            "height-scale":1,
            "arc-width":1,
            "data-sample":1,
            "arc-opacity":0.2, # if 0, then arcs are ommited
            "arc-sample":0.02,
            "grid-opacity":0.2,
        }
    }
}
Square Grid: 400m with arcs

Custom (Shapefile) grid

config={
    "input": "./example/Input_Arc.csv",
    "grid":"./example/Grid",
    "map": {
        
        # go to https://www.mapbox.com/ sign up and find your access token
        "access-token": "XXXXXXXXX",
        "options-json":{
            "style": "light", # [light, dark, street]
            "grid":"hex", # [hex, square] default: hex, 
            "source-color": "#d00b8abd",  # [00-ff], #{a}{r}{g}{b}
            "dest-color": "#b0c334eb",
            "hex-grid-zoom":8, # only if using hexmap
            "square-size":400, # meters, only if using square cells
            "min-height":50,
            "height-scale":1,
            "arc-width":2,
            "data-sample":1,
            "arc-opacity":0, # if 0, then arcs are ommited
            "arc-sample":0.1,
            "grid-opacity":0.9,
        }
    }
}
Polygon Grid

About

quick hex/grid/square/polygon map generators for histogram maps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published