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, i.e. maps based on the numerical part of Dutch postal codes. 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 install map-nl, simply run:
pip install map-nl
or a similar command for your dependency manager.
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.
Attribution & License
By default, a geojson file with PC4 polygons is downloaded from Opendatasoft.com. The file is provided by Central Bureau voor de Statistiek & Basisregistratie Kadaster and usage of this file falls under the CC BY 4.0 license.
Repository initiated with fpgmaas/cookiecutter-poetry.
Icon created by Roundicons - Flaticon
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.10.tar.gz
.
File metadata
- Download URL: map_nl-0.0.10.tar.gz
- Upload date:
- Size: 9.8 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 | 7c1df2d9f670f68f2ff854cda5d8385a84de6cf839512a56f4794902f55b2a89 |
|
MD5 | c66ea82a1898364f1d3841735e113650 |
|
BLAKE2b-256 | c64d3d3a2e41b702bdc7ba79e7905e1d66f81369c711bd0e07b65c80e7ca309f |
File details
Details for the file map_nl-0.0.10-py3-none-any.whl
.
File metadata
- Download URL: map_nl-0.0.10-py3-none-any.whl
- Upload date:
- Size: 11.6 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 | d4188005cfdba4cbb4bf12acc4ef07d3b0244fd068b3f6303b5bb1ce709039ee |
|
MD5 | c05a836df368e57fa353cbcd7f5ce7b1 |
|
BLAKE2b-256 | 6b5eb7ef01ace5ab0a2f756afb21c96a4dc2824f8f2c7565676d6a810c6ea390 |