MapTiles.jl
MapTiles.jl copied to clipboard
Add CRS support to tiles and tile grids
Summary
This PR adds explicit CRS (Coordinate Reference System) support to tiles and tile grids, making it clear which coordinate system a tile is using.
Changes
- Created abstract types
AbstractTileandAbstractTileGridfor interface definitions - Added CRS field to
TileandTileGridconcrete types - Implemented interface functions:
crs(tile)- Get the CRS of a tile/gridx(tile),y(tile),z(tile)- Access tile indiceszoom(tile)- Alias for z(tile)bounds(tile)- Get bounds in native CRSbounds(tile, target_crs)- Get bounds projected to target CRS
- Maintained backward compatibility (tiles default to WebMercator when CRS not specified)
- Added comprehensive test suite for new functionality
Test plan
- [x] All existing tests pass
- [x] New tests added for CRS interface (
test/test_crs_interface.jl) - [x] Type stability tests included
- [x] Backward compatibility verified
🤖 Generated with Claude Code
does this approach seem fine @rafaqz @visr? Web merc or wgs84 in this package are singletons so the struct should have the same size and no mutability. This was ai generated so I didn't have it try anything fancy.