Conversation
a905299 to
03a5d92
Compare
|
This is awesome, @migurski. /cc @jonahadkins |
…and line splitting - Updated 6 existing tests to include access_restrictions and road_flags data - Added 6 new splitting tests for partial bridge/tunnel/oneway/level application - Tests use simple geometries (0,0)-(1,0) for easy verification - All 12 tests failing as expected (property extraction and splitting not yet implemented) - References real Overture feature IDs and OSM way IDs in comments
…way/level properties
Major Changes:
- Created com.protomaps.basemap.geometry.Linear utility class for line splitting operations
- Rewrote Roads.processOverture() to handle fractional 'between' ranges from Overture data
- Implemented collectSplitPoints() to gather all split positions from road_flags, access_restrictions, and level_rules
- Implemented extractSegmentProperties() to determine which properties apply to each split segment
- Added emitRoadFeature() to create features with custom split geometries
Results:
- 15/21 tests now passing (6 original property extraction tests now pass)
- 6 splitting tests create correct features with correct attributes and geometries
- Only remaining issue: cosmetic Norm{} wrapper in test assertions (geometries are actually correct)
Implementation handles:
- Partial bridges via road_flags with 'is_bridge' flag
- Partial tunnels via road_flags with 'is_tunnel' flag
- Partial oneway restrictions via access_restrictions with heading='backward'
- Partial level changes via level_rules
- Overlapping property ranges (e.g., bridge + oneway on same segment)
- Multiple split points creating 2-5 output features per input feature
…urved roads - Add comprehensive unit tests for line splitting with curves - Rewrite Linear.splitAtFractions() to preserve all vertices between split points - Add coordinate transformation from lat/lon to world coordinates before emitting - All 9 new Linear tests pass, roads render correctly with curves preserved 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…re-basemap-source
When using --overture with a Parquet file, the basemap now reads the bounding box from the GeoParquet metadata and uses it to set the bounds in the output PMTiles archive. This enables "fit bounds" functionality on maps.protomaps.com to zoom to the precise area covered by the data. The bounds are only applied when no --bounds argument is provided, allowing users to still override with manual bounds if needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The adjustment for this was small, implemented in 160a21c. The input Parquet files don’t consistently have bounding boxes defined when they're generated by DuckDB, so in my tests the output bounds are accurately set to match the whole-earth bbox of the input data. A way around this might be to read the actual envelope from Parquet row groups? I resolved the merge conflicts. |
Refactors bounds reading logic into a separate testable method and adds comprehensive test coverage including valid bounds extraction, missing file handling, and invalid file handling. Includes test GeoParquet file with Alcatraz Island buildings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
tiles/src/main/java/com/protomaps/basemap/layers/Buildings.java
Outdated
Show resolved
Hide resolved
|
Doing some testing in Zürich I saw some differences between the OpenStreetMap version and the Overture version. Let me list them below. |
|
River names show along polygon outline. In the OpenStreetMap version the Limmat river label is in the center of the river. This label in the center is missing in the Overture version, but there is a line label for Limmat along the polygon outline of the river. OpenStreetMap: https://maps.protomaps.com/#flavorName=light&lang=en&map=17.4/47.381202/8.541093&tiles=https://oliverwipfli.ch/data/osm.pmtiles
|
|
Bridge polygons are missing in the Overture version. To make bridges look a little bit better we added polygons for bridges in the OpenStreetMap version. Those are not present in the Overture version. OpenStreetMap: https://maps.protomaps.com/#flavorName=light&lang=en&map=17.4/47.381202/8.541093&tiles=https://oliverwipfli.ch/data/osm.pmtiles
|
wipfli
left a comment
There was a problem hiding this comment.
I would prefer to use string constants with a short prefix instead of variables.
So instead of
const String KIND = "protomaps:kind";
use(KIND, "highway")Do something like
use("pm:kind", "highway")|
@bdon Mike said you did a planet run, can you share a link to the PMTiles file? I found it very useful to inspect visually on maps.protomaps.com what the differences are... |
|
WIP build from 2/12: https://r2-public.protomaps.com/tmp-overture/20260212.pmtiles |
I replaced them throughout the PR. |
- Replaced string constants with literals - Removed old comments
…urski/add-overture-basemap-source
|
|
This looks good to me. I did make some visual checks if Switzerland's OpenStreetMap map still looks the same after this pr and I could not find any differences, so that is a good sign! |
| var buildings = new Buildings(); | ||
| registerHandler(buildings); | ||
| registerSourceHandler("osm", buildings::processOsm); | ||
| registerSourceHandler("pm:overture", buildings::processOverture); |
There was a problem hiding this comment.
nit: please use "overture" instead of "pm:overture" to align it with the "osm" source...






Add basemap support for Overture Maps input data as alternative to OSM extracts. Port
kind=/kind_detail=/min_zoom=mappings with no changes to MapLibre styles.Layers
All Protomaps layers except for Boundaries and Transit have some coverage in this PR.
POIs
theme=placesbasic_categorymapped to Protomapskind, with limited exceptionsRoads
theme=transportationtype=segmentsubtype=road,subtype=rail, andsubtype=waterclassandsubclassmapped to Protomapskind,kind_detail, and internalhighwayroad_flagsto split linestrings on bridge, tunnel, and level flags to match rendering of OSM basemapPlaces
theme=placesBuildings
theme=buildingstype=buildingandtype=building_partto match Protomaps visual styleLanduse
theme=basetype=land_useto match Protomaps visual styleEarth, Water, and Land Cover
theme=basetype=land,type=water,type=land_coverto match Protomaps visual styleTesting
Extract Overture data with e.g. DuckDB:
COPY ( SELECT * FROM read_parquet( 's3://overturemaps-us-west-2/release/2025-12-17.0/**/*.parquet', hive_partitioning=1, filename=1, union_by_name=1 ) WHERE theme IN ('transportation', 'places', 'base', 'buildings', 'divisions') AND bbox.xmin <= -121 AND bbox.xmax >= -123 AND bbox.ymin <= 38 AND bbox.ymax >= 37 ) TO 'data/sources/bay-area.parquet' (FORMAT PARQUET);Generate PMTiles from Overture data:
java -jar target/protomaps-basemap-HEAD-with-deps.jar \ --overture=data/sources/bay-area.parquet --download --forceRun the
app/map frontend or one of the HTML examples to preview.Screenshots
Taken from interactive preview at mike.teczno.com; compare with OSM data at maps.protomaps.com.
Flavor Compatibility
The changes in this PR map Overture properties to existing Protomaps conventions with no changes to styles, so all five of the included flavors are compatible: black, grayscale, white, light, and dark.