blob: 8487877fd83059123415cc9486b848d18b5bedda (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# Dog Friendly Data
This repository contains scripts I used to scrape and process data related to potential dog-unfriendly locations.
## Data
I collected this data to create a map of dog-unfriendly locations. The collected data is actually meant to identify possible dog-prohibited areas; only areas that I've confirmed to be dog-restricted are then moved to the concerned category. I always add a justification for each area, and I try to provide a link to the official source of information. If you find any errors or have additional information, please feel free to contact me.
The map I made is available [here](https://www.google.com/maps/d/viewer?mid=1CxFX_yBhNfWjP3vAlOlEF-kZTWBncik&ll=43.223609624672164%2C1.7513799454627321&z=8).

## Setup
```sh
uv sync
```
## Scripts
- `kml_utils.py`: Shared helpers used by the scripts below to build KML documents (placemarks, polygons, writing the file). Not meant to be run directly.
- `geojson2kml.py`: Converts a GeoJSON file (MultiPolygon features only) into a KML file. Example: `uv run src/geojson2kml.py input.geojson -o output.kml`
- `n2000.py`: Scrapes [natura2000.fr](https://www.natura2000.fr/carte-natura2000) for every listed site and exports their boundaries to a KML file. Example: `uv run src/n2000.py -o natura_2000.kml`
- `rn.py`: Scrapes [reserves-naturelles.org](https://reserves-naturelles.org/reserves-naturelles/) for every listed nature reserve and exports their boundaries to a KML file. Example: `uv run src/rn.py -o reserves_naturelles.kml`
- `split_kml.py`: Splits a large KML file into several smaller files under a given size, so they stay under Google My Maps' per-layer size limit.
- `test_export.py`: Tests the export of data to KML format for Google Maps. I used this to make sure I didn't make any mistakes while importing multiple data sources. Example: `uv run src/test_export.py exported_google_layer.kml 'source_files_*.kml'`
|