mapyta 0.10.0.dev1__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mapyta-1.0.0/.coderabbit.yaml +63 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.ruff.toml +2 -1
- mapyta-1.0.0/PKG-INFO +157 -0
- mapyta-1.0.0/README.md +130 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/.nav.yml +1 -0
- mapyta-1.0.0/docs/_overrides/assets/images/hero-map.png +0 -0
- mapyta-1.0.0/docs/_overrides/assets/images/mapyta-logo-dark-mode.png +0 -0
- mapyta-1.0.0/docs/_overrides/assets/images/mapyta-logo-light-mode.png +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_overrides/assets/stylesheets/extra.css +13 -0
- mapyta-0.10.0.dev1/README.md → mapyta-1.0.0/docs/index.md +30 -25
- mapyta-1.0.0/docs/showcase.md +367 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/animated.md +9 -8
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/choropleth.md +57 -0
- mapyta-1.0.0/docs/tutorial/layers.md +86 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/map.py +221 -41
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/properdocs.yml +0 -1
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/pyproject.toml +7 -1
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_map.py +180 -13
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/uv.lock +1 -1
- mapyta-0.10.0.dev1/PKG-INFO +0 -171
- mapyta-0.10.0.dev1/docs/_scripts/generate_index.py +0 -41
- mapyta-0.10.0.dev1/docs/tutorial/layers.md +0 -48
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.github/workflows/docs-preview.yml +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.github/workflows/docs.yml +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.github/workflows/lint.yml +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.github/workflows/publish.yml +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.github/workflows/tests.yml +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.gitignore +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/.pre-commit-config.yaml +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/LICENSE +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_overrides/assets/images/favicon.ico +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_overrides/assets/images/logo-dark-mode.svg +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_overrides/assets/images/mapyta-logo-dark-mode.svg +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_overrides/assets/images/mapyta-logo-light-mode.svg +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_overrides/assets/javascripts/katex.js +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_overrides/main.html +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_scripts/__init__.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/_scripts/generate_reference_pages.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/.nav.yml +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/advanced.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/clusters.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/configuration.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/coordinates.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/dataframe.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/drawing.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/export.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/faq.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/first-map.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/geodataframe.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/geometries.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/heatmaps.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/index.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/markers.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/min-zoom.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/open-data.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/search.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/text-annotations.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/docs/tutorial/tooltips-popups.md +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/__init__.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/config.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/coordinates.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/dataframe.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/export.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/geojson.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/markdown.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/markers.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/mouse_position.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/style.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/mapyta/tiles.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/__init__.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/conftest.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_data.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_dataframe.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_draw.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_export.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_geometry.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_layers.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_map_creation.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_markers.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_merge_and_chaining.py +0 -0
- {mapyta-0.10.0.dev1 → mapyta-1.0.0}/tests/test_utilities.py +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# CodeRabbit configuration — https://docs.coderabbit.ai/reference/yaml-template
|
|
2
|
+
language: en-US
|
|
3
|
+
|
|
4
|
+
reviews:
|
|
5
|
+
profile: chill
|
|
6
|
+
request_changes_workflow: false
|
|
7
|
+
high_level_summary: true
|
|
8
|
+
poem: false
|
|
9
|
+
review_status: true
|
|
10
|
+
collapse_walkthrough: false
|
|
11
|
+
sequence_diagrams: true
|
|
12
|
+
changed_files_summary: true
|
|
13
|
+
|
|
14
|
+
path_filters:
|
|
15
|
+
- "!**/*.lock"
|
|
16
|
+
- "!**/*.html" # generated Folium/Leaflet map outputs
|
|
17
|
+
- "!site/**" # mkdocs production build
|
|
18
|
+
- "!plan/**" # scratch / planning notes
|
|
19
|
+
- "!**/__pycache__/**"
|
|
20
|
+
- "!venv/**"
|
|
21
|
+
- "!.venv/**"
|
|
22
|
+
|
|
23
|
+
path_instructions:
|
|
24
|
+
- path: "mapyta/**"
|
|
25
|
+
instructions: |
|
|
26
|
+
Public API is the single `Map` class in map.py; the config dataclasses in config.py
|
|
27
|
+
(MapConfig, StrokeStyle, FillStyle, CircleStyle, HeatmapStyle, PopupStyle, TooltipStyle);
|
|
28
|
+
and the names re-exported from __init__.py. Everything else is internal.
|
|
29
|
+
|
|
30
|
+
DOCUMENTATION GATE — apply on every PR that adds or changes public API:
|
|
31
|
+
- If a public method, parameter, default, return type, or config field is added,
|
|
32
|
+
renamed, removed, or changes behaviour, the PR MUST also update documentation.
|
|
33
|
+
If it does not touch docs/, flag it and say exactly which doc is missing/stale.
|
|
34
|
+
- New user-facing feature (e.g. a new `add_*` method or style option) → expect a new
|
|
35
|
+
or updated page under docs/tutorial/, not only a docstring change.
|
|
36
|
+
- The API reference is generated from docstrings, so every public symbol needs an
|
|
37
|
+
accurate NumPy-convention docstring (Parameters / Returns / Raises). Flag added or
|
|
38
|
+
changed public symbols whose docstring is missing or no longer matches the signature.
|
|
39
|
+
- path: "tests/**"
|
|
40
|
+
instructions: |
|
|
41
|
+
pytest. Test public behaviour (the `Map` API).
|
|
42
|
+
Check assertions are meaningful and fixtures/temp files are cleaned up.
|
|
43
|
+
- path: "docs/tutorial/**"
|
|
44
|
+
instructions: |
|
|
45
|
+
Tutorial pages. When docs ARE included in a PR, hold them to the existing house style
|
|
46
|
+
so they read consistently with the rest of docs/tutorial/:
|
|
47
|
+
- Structure: an H1 title, a one- to two-sentence intro, a runnable example fenced as
|
|
48
|
+
```python exec="true" html="true" source="tabbed-right"``` ending in
|
|
49
|
+
`print(m.to_html()) # markdown-exec: hide`, then a `## How it works` section.
|
|
50
|
+
- Examples must use the current public API and run as written; flag any drift from
|
|
51
|
+
the real signatures, removed parameters, or renamed methods.
|
|
52
|
+
- Match the surrounding tone, heading depth, and Markdown conventions of sibling pages.
|
|
53
|
+
- path: "docs/**"
|
|
54
|
+
instructions: |
|
|
55
|
+
Documentation prose. Flag code samples and prose that drift from the current public API.
|
|
56
|
+
|
|
57
|
+
chat:
|
|
58
|
+
auto_reply: true
|
|
59
|
+
|
|
60
|
+
knowledge_base:
|
|
61
|
+
opt_out: false
|
|
62
|
+
learnings:
|
|
63
|
+
scope: auto
|
|
@@ -75,8 +75,9 @@ ignore = [
|
|
|
75
75
|
"RUF002", # ambiguous-unicode-character-docstring
|
|
76
76
|
"RUF003", # ambiguous-unicode-character-comment
|
|
77
77
|
]
|
|
78
|
-
[lint.per-file-ignores]
|
|
78
|
+
[lint.per-file-ignores]
|
|
79
79
|
"docs/*" = ["T201"]
|
|
80
|
+
"scripts/*" = ["T201", "INP001"]
|
|
80
81
|
|
|
81
82
|
[format]
|
|
82
83
|
quote-style = "double"
|
mapyta-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mapyta
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Mapyta, open source python package for GIS mapping and visualization.
|
|
5
|
+
Project-URL: Homepage, https://egarciamendez.github.io/mapyta
|
|
6
|
+
Project-URL: Documentation, https://egarciamendez.github.io/mapyta
|
|
7
|
+
Project-URL: Repository, https://github.com/egarciamendez/mapyta
|
|
8
|
+
Project-URL: Issues, https://github.com/egarciamendez/mapyta/issues
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: GIS,mapping,visualization
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: folium>=0.20.0
|
|
21
|
+
Requires-Dist: geopandas>=1.1.3
|
|
22
|
+
Requires-Dist: pyproj>=3.7.2
|
|
23
|
+
Requires-Dist: shapely>=2.1.2
|
|
24
|
+
Provides-Extra: export
|
|
25
|
+
Requires-Dist: selenium>=4.44.0; extra == 'export'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
<a href="https://egarciamendez.github.io/mapyta">
|
|
30
|
+
<picture>
|
|
31
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/egarciamendez/mapyta/main/docs/_overrides/assets/images/mapyta-logo-dark-mode.png">
|
|
32
|
+
<img src="https://raw.githubusercontent.com/egarciamendez/mapyta/main/docs/_overrides/assets/images/mapyta-logo-light-mode.png" alt="Mapyta" width="320">
|
|
33
|
+
</picture>
|
|
34
|
+
</a>
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<em>One import. A few method calls. A full interactive map.</em>
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<a href="https://pypi.org/project/mapyta/"><img src="https://img.shields.io/pypi/v/mapyta.svg" alt="PyPI version"></a>
|
|
43
|
+
<a href="https://pypi.org/project/mapyta/"><img src="https://img.shields.io/pypi/pyversions/mapyta.svg" alt="Supported Python versions"></a>
|
|
44
|
+
<a href="https://github.com/egarciamendez/mapyta/actions/workflows/tests.yml"><img src="https://github.com/egarciamendez/mapyta/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
|
|
45
|
+
<a href="https://egarciamendez.github.io/mapyta"><img src="https://img.shields.io/badge/docs-mkdocs--material-blue.svg" alt="Documentation"></a>
|
|
46
|
+
<a href="https://github.com/egarciamendez/mapyta/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/mapyta.svg" alt="License: MIT"></a>
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
**Documentation**: [https://egarciamendez.github.io/mapyta](https://egarciamendez.github.io/mapyta)
|
|
52
|
+
|
|
53
|
+
**Source Code**: [https://github.com/egarciamendez/mapyta](https://github.com/egarciamendez/mapyta)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
Build OpenStreetMap visualizations with hover tooltips, choropleths, heatmaps, and export to HTML or PNG all from Shapely geometries.
|
|
58
|
+
|
|
59
|
+
Perfect for geotechnical site plans, infrastructure overviews, or any spatial data visualization where you want more control than static images but don't need the full power of a GIS.
|
|
60
|
+
|
|
61
|
+
*Mapyta is standing on the shoulders of giants like Folium and Leaflet, but it's designed to be more intuitive and
|
|
62
|
+
Pythonic for users who are already familiar with Shapely and GeoPandas. It's not trying to replace a full GIS,
|
|
63
|
+
but rather to provide a simple way to create interactive maps without needing to learn a whole new set of tools.*
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
<a href="https://egarciamendez.github.io/mapyta/showcase/">
|
|
67
|
+
<img src="https://egarciamendez.github.io/mapyta/assets/images/hero-map.png" alt="A mapyta map of Amsterdam with markers, areas, and a walking route" width="820">
|
|
68
|
+
</a>
|
|
69
|
+
</p>
|
|
70
|
+
|
|
71
|
+
👉 **[See the Showcase](https://egarciamendez.github.io/mapyta/showcase/)** — every feature as a live, interactive map on a single page.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Key features
|
|
76
|
+
|
|
77
|
+
- 🗺️ **[Shapely-native](https://egarciamendez.github.io/mapyta/tutorial/geometries/)** — pass `Point`, `Polygon`, `LineString` directly, including multi-geometries
|
|
78
|
+
- 📝 **[Markdown/HTML hover and popup text](https://egarciamendez.github.io/mapyta/tutorial/tooltips-popups/)** — bold, italic, links, lists, and code in tooltips
|
|
79
|
+
- 📌 **[Emoji & icon markers](https://egarciamendez.github.io/mapyta/tutorial/markers/)** — any text or Font Awesome icons as markers
|
|
80
|
+
- 🎨 **[Choropleth & heatmaps](https://egarciamendez.github.io/mapyta/tutorial/choropleth/)** — color-coded maps from numeric data
|
|
81
|
+
- 📊 **[GeoPandas integration](https://egarciamendez.github.io/mapyta/tutorial/geodataframe/)** — `Map.from_geodataframe()` one-liner
|
|
82
|
+
- 🗂️ **[DataFrame support](https://egarciamendez.github.io/mapyta/tutorial/dataframe/)** — `add_dataframe()` works with any Pandas or Polars DataFrame with a WKT geometry column
|
|
83
|
+
- 🌐 **[Auto CRS detection](https://egarciamendez.github.io/mapyta/tutorial/coordinates/)** — RD New (EPSG:28992) coordinates transform automatically
|
|
84
|
+
- 📤 **[Export anywhere](https://egarciamendez.github.io/mapyta/tutorial/export/)** — HTML, PNG, SVG, GeoJSON, async variants, and `BytesIO` buffers
|
|
85
|
+
- 🧩 **[Feature groups](https://egarciamendez.github.io/mapyta/tutorial/layers/)** — toggleable layers with a built-in layer control
|
|
86
|
+
- 🔌 **[Set of tile providers](https://egarciamendez.github.io/mapyta/tutorial/configuration/)** — OpenStreetMap, CartoDB, Esri, Stamen, and Kadaster
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
Mapyta requires **Python 3.12+**.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
uv add mapyta
|
|
96
|
+
# or
|
|
97
|
+
pip install mapyta
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Exporting maps to **PNG/SVG images** additionally needs a headless browser (Chrome,
|
|
101
|
+
Chromium, or Edge) and the `export` extra:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
uv add "mapyta[export]"
|
|
105
|
+
# or
|
|
106
|
+
pip install "mapyta[export]"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Quickstart
|
|
110
|
+
|
|
111
|
+
Create your first map:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from shapely.geometry import Point
|
|
115
|
+
from mapyta import Map
|
|
116
|
+
|
|
117
|
+
m = Map(title="Hello Utrecht")
|
|
118
|
+
m.add_point(
|
|
119
|
+
point=Point(5.121311, 52.090648),
|
|
120
|
+
tooltip="**Utrecht**",
|
|
121
|
+
popup="**Utrecht**\nCity in the Netherlands\nPopulation: ~350k",
|
|
122
|
+
caption="UTR",
|
|
123
|
+
)
|
|
124
|
+
m.to_html("hello.html")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Open `hello.html` in any browser and you're done.
|
|
128
|
+
|
|
129
|
+
Want the map as an image instead? Get raw PNG bytes or a buffer, no file needed:
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
png_bytes = m.to_image() # bytes, for an HTTP response or an email attachment
|
|
133
|
+
buf = m.to_bytesio() # io.BytesIO, e.g. for Flask/FastAPI/Django
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
See the **[Showcase](https://egarciamendez.github.io/mapyta/showcase/)** for choropleths,
|
|
137
|
+
heatmaps, clusters, drawing tools, and more — each as a live, interactive map — or work
|
|
138
|
+
through the **[Tutorial](https://egarciamendez.github.io/mapyta/tutorial/)** one concept
|
|
139
|
+
at a time.
|
|
140
|
+
|
|
141
|
+
## Contributing
|
|
142
|
+
|
|
143
|
+
Issues and pull requests are welcome. To set up a local development environment:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git clone https://github.com/egarciamendez/mapyta
|
|
147
|
+
cd mapyta
|
|
148
|
+
uv sync --all-extras --all-groups
|
|
149
|
+
uv run pytest
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Please open an [issue](https://github.com/egarciamendez/mapyta/issues) to discuss
|
|
153
|
+
substantial changes before starting.
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
This project is licensed under the terms of the MIT license.
|
mapyta-1.0.0/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://egarciamendez.github.io/mapyta">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/egarciamendez/mapyta/main/docs/_overrides/assets/images/mapyta-logo-dark-mode.png">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/egarciamendez/mapyta/main/docs/_overrides/assets/images/mapyta-logo-light-mode.png" alt="Mapyta" width="320">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<em>One import. A few method calls. A full interactive map.</em>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://pypi.org/project/mapyta/"><img src="https://img.shields.io/pypi/v/mapyta.svg" alt="PyPI version"></a>
|
|
16
|
+
<a href="https://pypi.org/project/mapyta/"><img src="https://img.shields.io/pypi/pyversions/mapyta.svg" alt="Supported Python versions"></a>
|
|
17
|
+
<a href="https://github.com/egarciamendez/mapyta/actions/workflows/tests.yml"><img src="https://github.com/egarciamendez/mapyta/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
|
|
18
|
+
<a href="https://egarciamendez.github.io/mapyta"><img src="https://img.shields.io/badge/docs-mkdocs--material-blue.svg" alt="Documentation"></a>
|
|
19
|
+
<a href="https://github.com/egarciamendez/mapyta/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/mapyta.svg" alt="License: MIT"></a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
**Documentation**: [https://egarciamendez.github.io/mapyta](https://egarciamendez.github.io/mapyta)
|
|
25
|
+
|
|
26
|
+
**Source Code**: [https://github.com/egarciamendez/mapyta](https://github.com/egarciamendez/mapyta)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
Build OpenStreetMap visualizations with hover tooltips, choropleths, heatmaps, and export to HTML or PNG all from Shapely geometries.
|
|
31
|
+
|
|
32
|
+
Perfect for geotechnical site plans, infrastructure overviews, or any spatial data visualization where you want more control than static images but don't need the full power of a GIS.
|
|
33
|
+
|
|
34
|
+
*Mapyta is standing on the shoulders of giants like Folium and Leaflet, but it's designed to be more intuitive and
|
|
35
|
+
Pythonic for users who are already familiar with Shapely and GeoPandas. It's not trying to replace a full GIS,
|
|
36
|
+
but rather to provide a simple way to create interactive maps without needing to learn a whole new set of tools.*
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<a href="https://egarciamendez.github.io/mapyta/showcase/">
|
|
40
|
+
<img src="https://egarciamendez.github.io/mapyta/assets/images/hero-map.png" alt="A mapyta map of Amsterdam with markers, areas, and a walking route" width="820">
|
|
41
|
+
</a>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
👉 **[See the Showcase](https://egarciamendez.github.io/mapyta/showcase/)** — every feature as a live, interactive map on a single page.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Key features
|
|
49
|
+
|
|
50
|
+
- 🗺️ **[Shapely-native](https://egarciamendez.github.io/mapyta/tutorial/geometries/)** — pass `Point`, `Polygon`, `LineString` directly, including multi-geometries
|
|
51
|
+
- 📝 **[Markdown/HTML hover and popup text](https://egarciamendez.github.io/mapyta/tutorial/tooltips-popups/)** — bold, italic, links, lists, and code in tooltips
|
|
52
|
+
- 📌 **[Emoji & icon markers](https://egarciamendez.github.io/mapyta/tutorial/markers/)** — any text or Font Awesome icons as markers
|
|
53
|
+
- 🎨 **[Choropleth & heatmaps](https://egarciamendez.github.io/mapyta/tutorial/choropleth/)** — color-coded maps from numeric data
|
|
54
|
+
- 📊 **[GeoPandas integration](https://egarciamendez.github.io/mapyta/tutorial/geodataframe/)** — `Map.from_geodataframe()` one-liner
|
|
55
|
+
- 🗂️ **[DataFrame support](https://egarciamendez.github.io/mapyta/tutorial/dataframe/)** — `add_dataframe()` works with any Pandas or Polars DataFrame with a WKT geometry column
|
|
56
|
+
- 🌐 **[Auto CRS detection](https://egarciamendez.github.io/mapyta/tutorial/coordinates/)** — RD New (EPSG:28992) coordinates transform automatically
|
|
57
|
+
- 📤 **[Export anywhere](https://egarciamendez.github.io/mapyta/tutorial/export/)** — HTML, PNG, SVG, GeoJSON, async variants, and `BytesIO` buffers
|
|
58
|
+
- 🧩 **[Feature groups](https://egarciamendez.github.io/mapyta/tutorial/layers/)** — toggleable layers with a built-in layer control
|
|
59
|
+
- 🔌 **[Set of tile providers](https://egarciamendez.github.io/mapyta/tutorial/configuration/)** — OpenStreetMap, CartoDB, Esri, Stamen, and Kadaster
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Installation
|
|
64
|
+
|
|
65
|
+
Mapyta requires **Python 3.12+**.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
uv add mapyta
|
|
69
|
+
# or
|
|
70
|
+
pip install mapyta
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Exporting maps to **PNG/SVG images** additionally needs a headless browser (Chrome,
|
|
74
|
+
Chromium, or Edge) and the `export` extra:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv add "mapyta[export]"
|
|
78
|
+
# or
|
|
79
|
+
pip install "mapyta[export]"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Quickstart
|
|
83
|
+
|
|
84
|
+
Create your first map:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from shapely.geometry import Point
|
|
88
|
+
from mapyta import Map
|
|
89
|
+
|
|
90
|
+
m = Map(title="Hello Utrecht")
|
|
91
|
+
m.add_point(
|
|
92
|
+
point=Point(5.121311, 52.090648),
|
|
93
|
+
tooltip="**Utrecht**",
|
|
94
|
+
popup="**Utrecht**\nCity in the Netherlands\nPopulation: ~350k",
|
|
95
|
+
caption="UTR",
|
|
96
|
+
)
|
|
97
|
+
m.to_html("hello.html")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Open `hello.html` in any browser and you're done.
|
|
101
|
+
|
|
102
|
+
Want the map as an image instead? Get raw PNG bytes or a buffer, no file needed:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
png_bytes = m.to_image() # bytes, for an HTTP response or an email attachment
|
|
106
|
+
buf = m.to_bytesio() # io.BytesIO, e.g. for Flask/FastAPI/Django
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
See the **[Showcase](https://egarciamendez.github.io/mapyta/showcase/)** for choropleths,
|
|
110
|
+
heatmaps, clusters, drawing tools, and more — each as a live, interactive map — or work
|
|
111
|
+
through the **[Tutorial](https://egarciamendez.github.io/mapyta/tutorial/)** one concept
|
|
112
|
+
at a time.
|
|
113
|
+
|
|
114
|
+
## Contributing
|
|
115
|
+
|
|
116
|
+
Issues and pull requests are welcome. To set up a local development environment:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
git clone https://github.com/egarciamendez/mapyta
|
|
120
|
+
cd mapyta
|
|
121
|
+
uv sync --all-extras --all-groups
|
|
122
|
+
uv run pytest
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Please open an [issue](https://github.com/egarciamendez/mapyta/issues) to discuss
|
|
126
|
+
substantial changes before starting.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
This project is licensed under the terms of the MIT license.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -68,4 +68,17 @@
|
|
|
68
68
|
.md-typeset h5,
|
|
69
69
|
.md-typeset h6 {
|
|
70
70
|
font-weight: 700;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Make the whole grid card clickable, not just the link text.
|
|
74
|
+
Scoped to cards that contain a single link (all of ours), so a stretched
|
|
75
|
+
overlay can never swallow a second link in some future multi-link card. */
|
|
76
|
+
.md-typeset .grid.cards > ul > li:has(a:only-of-type) {
|
|
77
|
+
position: relative;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
.md-typeset .grid.cards > ul > li:has(a:only-of-type) a:only-of-type::after {
|
|
81
|
+
content: "";
|
|
82
|
+
position: absolute;
|
|
83
|
+
inset: 0;
|
|
71
84
|
}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://egarciamendez.github.io/mapyta">
|
|
3
|
-
<img src="https://egarciamendez.github.io/mapyta/_overrides/assets/images/mapyta-logo-light-mode.svg" alt="Mapyta">
|
|
4
|
-
</a>
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
1
|
---
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**Source Code**: [https://github.com/egarciamendez/mapyta](https://github.com/egarciamendez/mapyta)
|
|
12
|
-
|
|
2
|
+
hide:
|
|
3
|
+
- navigation
|
|
13
4
|
---
|
|
14
5
|
|
|
6
|
+
{ display: flex; justify-content: center; align-items: center; }
|
|
7
|
+
{ display: flex; justify-content: center; align-items: center; }
|
|
15
8
|
|
|
16
9
|
**One import. A few method calls. A full interactive map.**
|
|
17
10
|
|
|
@@ -19,24 +12,30 @@ Build OpenStreetMap visualizations with hover tooltips, choropleths, heatmaps, a
|
|
|
19
12
|
|
|
20
13
|
Perfect for geotechnical site plans, infrastructure overviews, or any spatial data visualization where you want more control than static images but don't need the full power of a GIS.
|
|
21
14
|
|
|
22
|
-
*Mapyta is standing on the shoulders of giants like Folium and Leaflet, but it's designed to be more intuitive and
|
|
23
|
-
Pythonic for users who are already familiar with Shapely and GeoPandas. It's not trying to replace a full GIS,
|
|
15
|
+
*Mapyta is standing on the shoulders of giants like Folium and Leaflet, but it's designed to be more intuitive and
|
|
16
|
+
Pythonic for users who are already familiar with Shapely and GeoPandas. It's not trying to replace a full GIS,
|
|
24
17
|
but rather to provide a simple way to create interactive maps without needing to learn a whole new set of tools.*
|
|
25
18
|
|
|
19
|
+
👉 **[See the Showcase](showcase.md)** — every feature as a live, interactive map on a single page.
|
|
20
|
+
|
|
26
21
|
---
|
|
27
22
|
|
|
28
23
|
**Key features:**
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
25
|
+
<div class="grid cards" markdown>
|
|
26
|
+
|
|
27
|
+
- 🗺️ **[Shapely-native](tutorial/geometries.md)** — pass `Point`, `Polygon`, `LineString` directly, including multi-geometries
|
|
28
|
+
- 📝 **[Markdown/HTML hover and popup text](tutorial/tooltips-popups.md)** — bold, italic, links, lists, and code in tooltips
|
|
29
|
+
- 📌 **[Emoji & icon markers](tutorial/markers.md)** — any text or Font Awesome icons as markers
|
|
30
|
+
- 🎨 **[Choropleth & heatmaps](tutorial/choropleth.md)** — color-coded maps from numeric data
|
|
31
|
+
- 📊 **[GeoPandas integration](tutorial/geodataframe.md)** — `Map.from_geodataframe()` one-liner
|
|
32
|
+
- 🗂️ **[DataFrame support](tutorial/dataframe.md)** — `add_dataframe()` works with any Pandas or Polars DataFrame with a WKT geometry column
|
|
33
|
+
- 🌐 **[Auto CRS detection](tutorial/coordinates.md)** — RD New (EPSG:28992) coordinates transform automatically
|
|
34
|
+
- 📤 **[Export anywhere](tutorial/export.md)** — HTML, PNG, SVG, GeoJSON, async variants, and `BytesIO` buffers
|
|
35
|
+
- 🧩 **[Feature groups](tutorial/layers.md)** — toggleable layers with a built-in layer control
|
|
36
|
+
- 🔌 **[Set of tile providers](tutorial/configuration.md)** — OpenStreetMap, CartoDB, Esri, Stamen, and Kadaster
|
|
37
|
+
|
|
38
|
+
</div>
|
|
40
39
|
|
|
41
40
|
---
|
|
42
41
|
|
|
@@ -70,7 +69,7 @@ but rather to provide a simple way to create interactive maps without needing to
|
|
|
70
69
|
popup_style={"width": 300, "height": 120},
|
|
71
70
|
)
|
|
72
71
|
m.add_point(
|
|
73
|
-
point=Point(4.
|
|
72
|
+
point=Point(4.884335, 52.37521),
|
|
74
73
|
marker="📖",
|
|
75
74
|
tooltip="**Anne Frank House**",
|
|
76
75
|
popup="**Anne Frank House**\nPrinsengracht 263\nVisitors/year: ~1.3 million",
|
|
@@ -145,4 +144,10 @@ Open `hello.html` in any browser and you're done.
|
|
|
145
144
|
|
|
146
145
|
## License
|
|
147
146
|
|
|
148
|
-
This project is licensed under the terms of the MIT license.
|
|
147
|
+
This project is licensed under the terms of the MIT license.
|
|
148
|
+
|
|
149
|
+
<style>
|
|
150
|
+
h1:first-of-type {
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
</style>
|