Quickly create maps of the Netherlands in Python
Project description
map-nl
map-nl is a Python package to help you quickly create PC4 maps of the Netherlands. While that is already possible without map-nl, this package aims to make the process a lot easier. It automatically downloads the geojson files, so all you need to provide is a dataset with two columns: One containing PC4 codes and one with a related value to plot on the map. map_nl then uses folium to plot the map.
For an example map created with map-nl, see here.
Quickstart
Installation
To add map-nl to your project, run one of the following commands:
# Install with poetry
poetry add map-nl
# Install with pip
pip install map-nl
Usage
To create a choropleth map of the average WOZ-value in the Netherlands, you could run the following:
import pandas as pd
from map_nl import ChoroplethMapNL
df = pd.read_csv("https://raw.githubusercontent.com/fpgmaas/map-nl/main/data/woz-pc4.csv")
m = ChoroplethMapNL(geojson_simplify_tolerance=0.0001).plot(
df, pc4_column_name="pc4", value_column_name="WOZ", legend_name="Average WOZ Value"
)
m.save("map.html")
This will download the geojson file to the .map_nl
directory, simplify the geojson file to reduce the disk size of the plot, plot the map and save it to disk.
For more details, see the documentation.
Repository initiated with fpgmaas/cookiecutter-poetry.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file map_nl-0.0.4.tar.gz
.
File metadata
- Download URL: map_nl-0.0.4.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.2.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd411790b6609308fa87d5d890fd797394b4b180a4f87f06b4b17d95f716ef18 |
|
MD5 | 14bf1611df7c5c78cecc22e79eecc325 |
|
BLAKE2b-256 | 5d14bf2e5bc5a7b0f5bdc4c303de48046bf0b075368e826e4791396fea78ce0e |
File details
Details for the file map_nl-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: map_nl-0.0.4-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.2.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33494c7d7f8ffae9caa433181755b0e617f9d589eccff0375da63976dad5b246 |
|
MD5 | 218858777aeb71b72c9404e8e477944c |
|
BLAKE2b-256 | 8aa377841480c6f5daf830a9bce99e4bf11c3227cf85af882e2d362b95018a8c |