mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-03 16:41:26 +01:00
feat(core,fuse,gui): Proton theme, photos on the map and an opt-in street map
- The Proton accent preference becomes a whole Proton theme that also holds against a GTK theme imported from gtk.css; folders get Proton's purple folder icon while it is on. - Places map markers show one of each town's photos with a count, and zoomed in on a town every photo sits where it was taken (Request::PlaceLocations). Photos taken on one spot are listed in a popover. "Show on map" in the photo viewer goes to the Places map. - The built-in map draws country borders, sea and land in their own colours. - An opt-in street map from OpenFreeMap (vector tiles drawn with cairo, cached on disk up to 256 MB), with the OpenStreetMap credit on the map and in About. - Translations for all catalogs; changelog folded into 2.3.0.
This commit is contained in:
1 parent
4fd14eb745
commit
fde9c2d271
37 files changed
+5846
-2214
No files matched your search
@@ -1,9 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Regenerate crates/pdfs-gui/data/land.txt from Natural Earth's land polygons.
|
||||
"""Regenerate crates/pdfs-gui/data/land.txt from Natural Earth's land polygons,
|
||||
and crates/pdfs-gui/data/borders.txt from its country borders.
|
||||
|
||||
Usage:
|
||||
curl -LO https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_land.geojson
|
||||
scripts/natural-earth-land.py ne_50m_land.geojson crates/pdfs-gui/data/land.txt
|
||||
curl -LO https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_boundary_lines_land.geojson
|
||||
scripts/natural-earth-land.py ne_50m_admin_0_boundary_lines_land.geojson crates/pdfs-gui/data/borders.txt
|
||||
|
||||
Natural Earth is in the public domain; the About dialog credits it anyway.
|
||||
|
||||
@@ -12,7 +15,8 @@ pairs rounded to two decimals (about a kilometre). Each ring is simplified
|
||||
with Ramer-Douglas-Peucker to TOLERANCE degrees, which is finer than the map
|
||||
can show at its closest zoom, and rings left with fewer than four points
|
||||
(islets smaller than the tolerance) are dropped. Holes (lakes) are dropped
|
||||
too: the map fills the land and draws nothing on top of it.
|
||||
too: the map fills the land and draws nothing on top of it. Borders are lines
|
||||
rather than rings, simplified the same way; a line needs two points.
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -54,16 +58,27 @@ def main(source, target):
|
||||
lines = []
|
||||
for feature in features:
|
||||
geometry = feature["geometry"]
|
||||
polygons = (
|
||||
geometry["coordinates"]
|
||||
if geometry["type"] == "MultiPolygon"
|
||||
else [geometry["coordinates"]]
|
||||
)
|
||||
for polygon in polygons:
|
||||
ring = simplify(polygon[0])
|
||||
if len(ring) < 4:
|
||||
kind = geometry["type"]
|
||||
if kind in ("LineString", "MultiLineString"):
|
||||
paths = (
|
||||
geometry["coordinates"]
|
||||
if kind == "MultiLineString"
|
||||
else [geometry["coordinates"]]
|
||||
)
|
||||
shortest = 2
|
||||
else:
|
||||
polygons = (
|
||||
geometry["coordinates"]
|
||||
if kind == "MultiPolygon"
|
||||
else [geometry["coordinates"]]
|
||||
)
|
||||
paths = [polygon[0] for polygon in polygons]
|
||||
shortest = 4
|
||||
for path in paths:
|
||||
path = simplify(path)
|
||||
if len(path) < shortest:
|
||||
continue
|
||||
lines.append(" ".join(f"{lon:.2f},{lat:.2f}" for lon, lat in ring))
|
||||
lines.append(" ".join(f"{lon:.2f},{lat:.2f}" for lon, lat in path))
|
||||
with open(target, "w") as out:
|
||||
out.write("\n".join(lines) + "\n")
|
||||
|
||||
|
||||
Reference in new issue
Block a user