feat(render): add sea and ocean rendering from coastline data#193
Open
utaysi wants to merge 2 commits intooriginalankur:mainfrom
Open
feat(render): add sea and ocean rendering from coastline data#193utaysi wants to merge 2 commits intooriginalankur:mainfrom
utaysi wants to merge 2 commits intooriginalankur:mainfrom
Conversation
Build water polygons from OSM coastline lines by splitting the viewport into land and water regions. Fetch coastline as a new data step and render sea areas beneath existing water layers.
Replace center-point heuristic with OSM coastline winding rule (land on left, water on right) so that cities spanning multiple land masses like Istanbul render both sides correctly as land.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Currently, only inland water bodies (rivers, lakes, bays) are rendered. Open seas and oceans are not shown at all, because OSM represents them as coastline lines rather than water polygons. PR #142 addressed sea/ocean rendering and fixed it for several examples shown there. However, the issue persists on the current main branch for other locations. This is especially noticeable for coastal cities like Istanbul, where the sea appears as blank land-colored background.
Solution
Before / After
Istanbul
uv run create_map_poster.py -c "Istanbul" -C "Turkey"
The Bosphorus strait was already rendered as water, but the Sea of Marmara (south) was not — it appeared as blank land-colored background. Now the open sea renders correctly.
Kadikoy
uv run ./create_map_poster.py --city "Kadikoy" --country "Istanbul" -lat 40.9855555556 -long 29.0258055556 -d 4500
Kadikoy (another part of Istanbul outside of 1st map area) appeared almost landlocked. Now the surrounding sea renders correctly, showing it as the coastal peninsula it is.