https://github.com/andrewannex/planetcantile
tile matrix sets for other planets
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 2 committers (100.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Repository
tile matrix sets for other planets
Basic Info
- Host: GitHub
- Owner: AndrewAnnex
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Size: 7.58 MB
Statistics
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 6
- Releases: 1
Metadata Files
README.md
Planetcantile
Planetcantile provides TileMatrixSets (TMS) for planetary bodies throughout the solar system, enabling tiled map visualization and analysis for the Moon, Mars, and many other celestial bodies using standard web mapping techniques.
A TileMatrixSet defines how a spatial area (like a planet) is divided into a hierarchy of tiles at different zoom levels. By implementing the OGC TileMatrixSet standard for planetary bodies, Planetcantile makes it possible to use Earth-focused web mapping tools with data from across the solar system.
Table of Contents
- Features
- Getting Started
- Usage
- Supported Planetary Bodies
- Integration with Other Libraries
- Contributing
- License
Features
Extensive Coverage: Support for ~100 celestial bodies including planets, moons, asteroids, and comets
Multiple Projection Types:
- Geographic (regular lat/lon) - Standard equirectangular/plate carrée projection
- Equidistant Cylindrical - Cylindrical projection preserving distances along meridians
- World Mercator - "Mercator (variant A)" (EPSG 9804)
- Web Mercator - "Popular Visualisation Pseudo Mercator" (EPSG 1024)
- North Polar Stereographic - Projection centered on the North Pole
- South Polar Stereographic - Projection centered on the South Pole
Coordinate System Support: Handles different coordinate systems for planetary bodies:
- Sphere (spherical approximation)
- Ocentric (planetocentric, center-based coordinates)
- Ographic (planetographic, surface-based coordinates)
Multiple coordinate system options are available for many celestial bodies.
Coalesced Grids: Special grid layouts that reduce the number of tiles needed near poles, optimizing storage and performance.
Cloud Optimized GeoTIFF (COG) Support: Works with COG, STAC, and MosaicJSON through TiTiler integration
Seamless Integration: Works with morecantile, TiTiler, and other OGC-compatible web mapping tools
Getting Started
Prerequisites
- Python 3.10 or higher
- Pip package manager
Installation
Basic Installation (Python Library)
```
Make sure pip is up to date
python -m pip install -U pip
Install planetcantile
python -m pip install planetcantile ```
Installation with Web Application
```
Install with web application dependencies
python -m pip install "planetcantile[app]"
Launch the application
python -m uvicorn planetcantile.app:app --host 0.0.0.0 --port 8000 ```
Installation from Source
```
Clone the repository
git clone https://github.com/AndrewAnnex/planetcantile.git cd planetcantile
Install with web application (Includes the core library plus dependencies)
pip install -e ".[app]"
Or install for development (Includes all dependencies plus development tools)
pip install -e ".[dev]"
Then launch the application (with auto-reload for development)
uvicorn planetcantile.app:app --host 0.0.0.0 --port 8000 --reload ```
Docker Container (Experimental)
Warning: The Docker container is currently experimental and may crash unexpectedly. It can be useful for quick exploration but is not recommended for production use: planetcantile_docker
Usage
Option 1: Using the Web API
After starting the web application, the API interface will be accessible at http://localhost:8000/docs
More information about endpoints is available in the TiTiler documentation.
Example tile request:
http://localhost:8000/cog/tiles/MarsGeographicSphere/{z}/{x}/{y}?url=https://path/to/mars.tif
For local files, replace the URL with the local file path: url=file:///home/user/path/to/mars.tif.
Option 2: As a Python Library
Using planetcantile directly
```python
Import the planetary TMS collection
from planetcantile import planetary_tms
List available TMS
print(planetary_tms.list())
Get a specific TMS
marstms = planetarytms.get("MarsGeographicSphere")
Register a custom TMS (example)
planetarytms.register(customtms)
Now use with morecantile
from morecantile import Tile tile = Tile(x=0, y=0, z=0) bounds = mars_tms.bounds(tile) print(f"Bounds of Mars tile: {bounds}") ```
Using morecantile directly (without importing planetcantile)
```python import os import sysconfig from pathlib import Path
Find planetcantile's TMS definitions directory
sitepackages = sysconfig.getpath('purelib') tmsdir = Path(sitepackages) / "planetcantile" / "data" / "tms"
if tmsdir.exists(): # Set the environment variable for morecantile os.environ["TILEMATRIXSETDIRECTORY"] = str(tmsdir) else: print(f"Warning: TMS directory not found at {tmsdir}")
Now use morecantile directly with planetcantile's TMS definitions
from morecantile import tms
List available TMS (including planetcantile ones)
print(tms.list())
Get a specific planetary TMS
mars_tms = tms.get("MarsGeographicSphere")
Use it with a tile
from morecantile import Tile tile = Tile(x=0, y=0, z=0) bounds = mars_tms.bounds(tile) print(f"Bounds of Mars tile: {bounds}") ```
Environment Variables
TILEMATRIXSET_DIRECTORY This environment variable allows you to specify a directory containing custom TileMatrixSet JSON definitions. Planetcantile will merge these with its own TMS definitions.
You can set this programmatically before importing planetcantile:
```python import os
Option 1: Point to your custom TMS definitions
os.environ["TILEMATRIXSET_DIRECTORY"] = "/path/to/your/custom/tms/definitions"
Option 2: Point to planetcantile's TMS definitions (for using with morecantile)
import sysconfig from pathlib import Path sitepackages = sysconfig.getpath('purelib') planetcantiletmsdir = Path(sitepackages) / "planetcantile" / "data" / "tms" if planetcantiletmsdir.exists(): os.environ["TILEMATRIXSETDIRECTORY"] = str(planetcantiletmsdir) else: print(f"Warning: TMS directory not found at {planetcantiletmsdir}")
Now import and use either planetcantile or morecantile
from morecantile import tms
or
from planetcantile import planetary_tms ```
Extending with Custom Definitions
Planetcantile supports two approaches for adding custom TMS definitions:
Using the generate.py script: This gives you fine-grained control over how the TMS definitions are generated, particularly when working with complex planetary coordinate reference systems.
Adding JSON files directly: As a simpler alternative, you can create TMS JSON definition files and add them to your custom directory specified by the
TILEMATRIXSET_DIRECTORYenvironment variable.
Supported Planetary Bodies
Planetcantile includes TMS definitions for:
- Planets: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune
- Dwarf Planets: Ceres, Pluto
- Moons: Including the Earth's Moon and various moons of Mars, Jupiter, Saturn, Uranus, and Neptune
- Asteroids: Including Vesta, Eros, Ida, and others
- Comets: Including Halley, Wild2, Churyumov-Gerasimenko, and others
Each body has multiple projection types available (see Features section).
All TMS definitions are based on official International Astronomical Union (IAU) Coordinate Reference Systems (CRS) registered with the Open Geospatial Consortium (OGC). The complete catalog of these CRS is available at the VESPA-CRS Registry.
Integration with Other Libraries
morecantile
Planetcantile extends morecantile by providing TMS definitions for celestial bodies beyond Earth. When you import planetcantile, it automatically registers all its planetary TMS definitions with morecantile, making them available through morecantile's API.
TiTiler
The web application component uses TiTiler, a dynamic tile server for Cloud Optimized GeoTIFFs. Planetcantile's TMS definitions enable TiTiler to serve planetary data with the correct projections.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
Distributed under the BSD 3-Clause License.
For more information:
GitHub Repository
Morecantile documentation
TiTiler documentation
Related abstract (2025)
Owner
- Name: Dr. Andrew Annex
- Login: AndrewAnnex
- Kind: user
- Location: Pasadena, CA
- Company: SETI Institute
- Website: http://andrewannex.com
- Twitter: AndrewAnnex
- Repositories: 179
- Profile: https://github.com/AndrewAnnex
Coder and Planetary Science PhD from Johns Hopkins University. Fmr Postdoc @ Caltech, Current Senior Science Systems Engineer @ SETI Institute
GitHub Events
Total
- Create event: 4
- Release event: 2
- Issues event: 3
- Watch event: 4
- Delete event: 1
- Issue comment event: 1
- Push event: 12
- Pull request review comment event: 8
- Pull request review event: 3
- Pull request event: 11
- Fork event: 2
Last Year
- Create event: 4
- Release event: 2
- Issues event: 3
- Watch event: 4
- Delete event: 1
- Issue comment event: 1
- Push event: 12
- Pull request review comment event: 8
- Pull request review event: 3
- Pull request event: 11
- Fork event: 2
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 28
- Total Committers: 2
- Avg Commits per committer: 14.0
- Development Distribution Score (DDS): 0.036
Top Committers
| Name | Commits | |
|---|---|---|
| Andrew Annex | a****y@v****u | 27 |
| Laura, Jason R | j****a@u****v | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: almost 2 years ago
All Time
- Total issues: 15
- Total pull requests: 10
- Average time to close issues: 12 days
- Average time to close pull requests: 9 days
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 1.73
- Average comments per pull request: 3.3
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 14 days
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- AndrewAnnex (10)
- jlaura (5)
- toptalent0921 (1)
Pull Request Authors
- AndrewAnnex (12)
- Astrareach (2)
- jlaura (2)
- nyvlunx (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 16 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
pypi.org: planetcantile
TMS tilesets for Planets
- Documentation: https://planetcantile.readthedocs.io/
- License: BSD License
-
Latest release: 0.5.0
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- click ^8.1.3
- morecantile ^3.2.1
- pyproj ^3.4.0
- python ^3.10
- actions/checkout v4 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- pypa/gh-action-pypi-publish release/v1 composite