-
-
Notifications
You must be signed in to change notification settings - Fork 88
Add Overture data source support #541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bdon
merged 63 commits into
protomaps:main
from
migurski:migurski/add-overture-basemap-source
Mar 2, 2026
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
36e46ab
Recoded Claude-provided plan for Overture addition
migurski 28524b8
Added script to download Overture data as Parquet
migurski 00b9401
Updated Overture plan with some manual edits
migurski cb02f31
Implemented --overture CLI flag and got it working with just land & w…
migurski c9ee800
Expanded Overture theme=base to landuse layer
migurski 65fd1fb
Added Overture theme=buildings to buildings layer
migurski d16a5d9
Added Overture theme=transportation to roads layer
migurski 82eee1b
Added Overture theme=places to pois layer
migurski c6819af
Added first failing Overture POI tests
migurski 5e77576
Added feature finder script to assist with Overture test cases
migurski 95bbe7a
Sped up feature finder with RTree
migurski a123a2b
Added more failing Overture POI tests
migurski f39a97a
Replaced failing OGR SQL queries that were too long
migurski 725656a
Added failing Overture POI test
migurski 4ac6f0b
Sped up feature finder with more parallel ops
migurski 045380d
Added numerous failing RoadsTest cases
migurski d57e774
Added failing trunk and motorway tests
migurski fc66900
Added test for all classes of link roads
migurski 89d5d71
Switched from raw tags to assigned kind in POI zooms to prepare for O…
migurski b853d50
Passed all Overture POI tests by applying new rules
migurski 2ed573d
Added QRank for Overture
migurski 4dbf500
Added basic kind assignments for Overture roads
migurski cf129c5
Added basic zoom assignments for Overture roads
migurski 93ff106
Add comprehensive tests for Overture roads oneway/is_link extraction …
migurski e0f1b30
Implement Overture roads line splitting for partial bridge/tunnel/one…
migurski 8511405
Fix Linear.splitAtFractions() to preserve intermediate vertices for c…
migurski d114227
Reimplemented Linear.java using existing JTS linear referencing support
migurski f86f81d
Fixed split geometry tests to correctly handle world coordinates
migurski 5048106
Corrected oneway=yes to get arrows showing up
migurski 7839ce3
Minor cleanup
migurski 6f90bad
...
migurski e6c9dce
Shortened some superlong function bodies
migurski cd2c77b
Migrated OSM minZoom to highwayZoomsIndex
migurski c24d9d2
Separated remaining zoom-related rules for OSM roads
migurski 784deb3
Claude's version of Places.java
migurski 8ebf9db
Organized Places rules to separate kinds and zooms indexes
migurski 7262047
kindRank can come from osmKindsIndex (for now!) and zoomsIndex, but n…
migurski c1149b0
Building parts look nice
migurski e02778d
Added rendering and tests for theme=transportation/type=segment rail …
migurski 9cec3fb
Delete outdated implementation plan
migurski 6c91ab3
Added basic Overture landcover
migurski ddd8947
Replaced Python scripts with https://gist.github.com/migurski/8765492…
migurski 055ec6b
Bumped version to 4.14
migurski 0fe3068
Applied suggestion from https://github.com/protomaps/basemaps/pull/539
migurski 804729f
Applied SonarQube suggestions for high-priority issues
migurski 8b30585
Applied SonarQube suggestions for high-priority issues
migurski 4f10714
Applied SonarQube suggestions for high-priority issues
migurski 7e92e50
Applied SonarQube suggestions for medium-priority issues
migurski 7b71dc7
Applied SonarQube suggestions for low-priority issues
migurski daa710a
Linted
migurski 01821cc
Improved Landcover test coverage
migurski e33842c
Applied SonarQube suggestions for low-priority issues
migurski 0088a65
Applied SonarQube suggestions for TODO issues
migurski 92f765b
Trying to eke out a little bit more test coverage
migurski 614301e
Removing early returns for MultiExpressions that include default values
migurski a459963
Added Overture water tests
migurski 06ad283
Merge remote-tracking branch 'upstream/main' into migurski/add-overtu…
migurski 160a21c
Read bounds from GeoParquet metadata and pass to tile archive
migurski a40943e
Add test coverage for GeoParquet bounds extraction
migurski 8ab0268
Added sf.canBePolygon() per notes
migurski f517a1e
Updated changelog
migurski 182553d
Addressed PR feedback
migurski 94cc627
Merge branch 'main' of https://github.com/protomaps/basemaps into mig…
migurski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
113 changes: 113 additions & 0 deletions
113
tiles/src/main/java/com/protomaps/basemap/geometry/Linear.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| package com.protomaps.basemap.geometry; | ||
|
|
||
| import java.util.*; | ||
| import org.locationtech.jts.geom.Geometry; | ||
| import org.locationtech.jts.geom.LineString; | ||
| import org.locationtech.jts.linearref.LengthIndexedLine; | ||
|
|
||
| /** | ||
| * Utility class for linear geometry operations, particularly splitting LineStrings at fractional positions. | ||
| */ | ||
| public class Linear { | ||
|
|
||
| private Linear() { | ||
| // Utility class, prevent instantiation | ||
| } | ||
|
|
||
| /** | ||
| * Represents a segment of a line with fractional start/end positions. | ||
| */ | ||
| public static class Segment { | ||
| public final double start; // Fractional position 0.0-1.0 | ||
| public final double end; // Fractional position 0.0-1.0 | ||
|
|
||
| public Segment(double start, double end) { | ||
| this.start = start; | ||
| this.end = end; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Split a LineString at fractional positions and return list of split LineStrings. Preserves all intermediate | ||
| * vertices between split points to maintain curve geometry. | ||
| * | ||
| * @param line The LineString to split | ||
| * @param splitPoints List of fractional positions (0.0-1.0) where to split | ||
| * @return List of LineString segments | ||
| */ | ||
| public static List<LineString> splitAtFractions(LineString line, List<Double> splitPoints) { | ||
| if (splitPoints.isEmpty()) { | ||
| return List.of(line); | ||
| } | ||
|
|
||
| // Sort split points and remove duplicates, ensure 0.0 and 1.0 are included | ||
| Set<Double> pointSet = new TreeSet<>(); | ||
| pointSet.add(0.0); | ||
| pointSet.addAll(splitPoints); | ||
| pointSet.add(1.0); | ||
|
|
||
| List<Double> points = new ArrayList<>(pointSet); | ||
| List<LineString> segments = new ArrayList<>(); | ||
|
|
||
| // Use JTS LengthIndexedLine for efficient extraction | ||
| double totalLength = line.getLength(); | ||
| LengthIndexedLine indexedLine = new LengthIndexedLine(line); | ||
|
|
||
| // For each pair of split points, create a segment preserving intermediate vertices | ||
| for (int i = 0; i < points.size() - 1; i++) { | ||
| double startFrac = points.get(i); | ||
| double endFrac = points.get(i + 1); | ||
|
|
||
| double startLength = startFrac * totalLength; | ||
| double endLength = endFrac * totalLength; | ||
|
|
||
| Geometry segment = indexedLine.extractLine(startLength, endLength); | ||
| if (segment instanceof LineString ls && ls.getNumPoints() >= 2) { | ||
| segments.add(ls); | ||
| } | ||
| } | ||
|
|
||
| return segments; | ||
| } | ||
|
|
||
| /** | ||
| * Create list of Segments representing the split ranges between all split points. | ||
| * | ||
| * @param splitPoints List of fractional positions (0.0-1.0) where to split | ||
| * @return List of Segment objects with start/end fractions | ||
| */ | ||
| public static List<Segment> createSegments(List<Double> splitPoints) { | ||
| if (splitPoints.isEmpty()) { | ||
| return List.of(new Segment(0.0, 1.0)); | ||
| } | ||
|
|
||
| // Sort split points and remove duplicates, ensure 0.0 and 1.0 are included | ||
| Set<Double> pointSet = new TreeSet<>(); | ||
| pointSet.add(0.0); | ||
| pointSet.addAll(splitPoints); | ||
| pointSet.add(1.0); | ||
|
|
||
| List<Double> points = new ArrayList<>(pointSet); | ||
| List<Segment> segments = new ArrayList<>(); | ||
|
|
||
| for (int i = 0; i < points.size() - 1; i++) { | ||
| segments.add(new Segment(points.get(i), points.get(i + 1))); | ||
| } | ||
|
|
||
| return segments; | ||
| } | ||
|
|
||
| /** | ||
| * Check if a segment defined by [segStart, segEnd] overlaps with a range [rangeStart, rangeEnd]. | ||
| * | ||
| * @param segStart Start of segment (0.0-1.0) | ||
| * @param segEnd End of segment (0.0-1.0) | ||
| * @param rangeStart Start of range (0.0-1.0) | ||
| * @param rangeEnd End of range (0.0-1.0) | ||
| * @return true if the segment overlaps with the range | ||
| */ | ||
| public static boolean overlaps(double segStart, double segEnd, double rangeStart, double rangeEnd) { | ||
| // Segments overlap if they share any fractional position | ||
| return segEnd > rangeStart && segStart < rangeEnd; | ||
| } | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please use "overture" instead of "pm:overture" to align it with the "osm" source...