{"id":46691412,"url":"https://github.com/ryodohemmi/mkgraticule_planet","last_synced_at":"2026-03-09T04:01:36.284Z","repository":{"id":342056979,"uuid":"1172550965","full_name":"ryodohemmi/mkgraticule_planet","owner":"ryodohemmi","description":"Create planetary graticules for IAU coordinate systems and export them as GeoPackage (GDAL / QGIS friendly).","archived":false,"fork":false,"pushed_at":"2026-03-04T14:51:01.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-04T21:44:40.409Z","etag":null,"topics":["cartography","gdal","gdal-python","geopackage","gis","iau","planetary","planetary-science","qgis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryodohemmi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-04T12:44:38.000Z","updated_at":"2026-03-04T14:51:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ryodohemmi/mkgraticule_planet","commit_stats":null,"previous_names":["ryodohemmi/mkgraticule_planet"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ryodohemmi/mkgraticule_planet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryodohemmi%2Fmkgraticule_planet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryodohemmi%2Fmkgraticule_planet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryodohemmi%2Fmkgraticule_planet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryodohemmi%2Fmkgraticule_planet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryodohemmi","download_url":"https://codeload.github.com/ryodohemmi/mkgraticule_planet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryodohemmi%2Fmkgraticule_planet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30282529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cartography","gdal","gdal-python","geopackage","gis","iau","planetary","planetary-science","qgis"],"created_at":"2026-03-09T04:01:03.433Z","updated_at":"2026-03-09T04:01:36.263Z","avatar_url":"https://github.com/ryodohemmi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mkgraticule_planet\r\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18864189.svg)](https://doi.org/10.5281/zenodo.18864189)  \r\nCreate planetary graticules for **IAU coordinate systems** and export them as **GeoPackage**.\r\n\r\nA small CLI utility for generating latitude/longitude grids for planetary bodies using **IAU 2015 planetary coordinate systems**.\r\n\r\n## Features\r\n\r\n* Supports **IAU 2015 planetary coordinate systems**\r\n* GeoPackage output\r\n* Compatible with **GDAL 3.x**\r\n* Multiple graticule label styles\r\n* QGIS-friendly output suitable for map production: label fields allow immediate graticule labeling, and CRS metadata ([`definition_12_063`](https://www.geopackage.org/spec/#gpkg_spatial_ref_sys_cols_crs_wkt)) ensures that IAU coordinate systems are correctly recognized when the GeoPackage is loaded in QGIS.\r\n* Optional major/minor classification via `-m/--major` (`grid_type = major|minor`, otherwise NULL)\r\n* Safer handling for projected CRS with limited domains:\r\n  * abort on projected + near-global extent unless `-s/--skipfailures` is used\r\n  * optional `-p/--partial-reprojection` for partial output near projection-domain limits\r\n* Optional dateline de-duplication for near-global longitude ranges: `-nde/--no-duplicate-endpoint`\r\n\r\nLatitude labels:\r\n\r\n* `lat_90` → -90° to 90°\r\n* `lat_ns` → 90°S to 90°N\r\n\r\nLongitude labels:\r\n\r\n* `lon_180` → -180° to 180°\r\n* `lon_ew` → 180°W to 180°E\r\n* `lon_360` → 0° to 360°\r\n* `lon_360e` → 0°E to 360°E\r\n\r\n## Requirements\r\n\r\nPython with GDAL Python bindings.\r\n\r\nIf you are using the OSGeo4W shell bundled with QGIS, GDAL is usually already available, so `conda install gdal` is not required.\r\n\r\nOtherwise, one simple way to install the required GDAL Python bindings is:\r\n\r\n```sh\r\nconda install gdal\r\n```\r\n\r\n## Usage\r\nOutput filenames may be specified either with or without the `.gpkg` extension. If the extension is omitted, it is added automatically.\r\n\r\nThe `-e` option specifies the geographic extent in the order: `xmin ymax xmax ymin` (ullr style).\r\n\r\n### Basic example\r\n\r\n```sh\r\n# Moon\r\npython mkgraticule_planet.py -g 10 10 \\\r\n                             -r 0.2 0.2 \\\r\n                             -srs IAU_2015:30100 \\\r\n                             -e -180 90 180 -90 \\\r\n                             moon_graticule.gpkg\r\n\r\n# Mars\r\npython mkgraticule_planet.py -g 15 15 \\\r\n                             -r 0.5 0.5 \\\r\n                             -srs IAU_2015:49900 \\\r\n                             mars_graticule.gpkg\r\n```\r\n### Major/minor graticules\r\n\r\n```sh\r\npython mkgraticule_planet.py -g 10 10 \\\r\n                             -m 30 30 \\\r\n                             -srs IAU_2015:40100 \\\r\n                             -e -180 90 180 -90 \\\r\n                             phobos_graticule.gpkg\r\n```\r\nIf `-m/--major` is set: `grid_type` will be `\"major\"` or `\"minor\"`.\r\nIf omitted: `grid_type` is NULL.\r\n\r\n## Projected CRS considerations\r\n\r\nSome projected coordinate systems (e.g., polar stereographic) have **limited valid domains**.\r\nIf a near-global geographic extent is requested, reprojection may fail.\r\n\r\n- Default behavior: **abort** with a message suggesting to restrict the extent with `-e`\r\n- Recommended approach: restrict the geographic extent to the valid projection domain (e.g., `-e -180 -60 180 -90` for south polar views)\r\n- To force output anyway (skip features that fail reprojection): `-s/--skipfailures`\r\n- Optionally enable partial reprojection: `-p/--partial-reprojection`\r\n\r\nFor projected + near-global requests, restricting the extent with `-e` is usually the best solution.  \r\nCombining `-s` with `-p` can sometimes produce partial output near projection domain limits.\r\n\r\n### Dateline handling\r\n\r\nIf the longitude span is approximately **360°** (e.g. `-180..180` or `0..360`), duplicate endpoint meridians can be generated.\r\n\r\nTo drop the duplicate endpoint meridian while keeping the minimum longitude endpoint:\r\n\r\n- `-180..180` → keep `-180`, drop `180`\r\n\r\n- `0..360` → keep `0`, drop `360`\r\n\r\n```sh\r\npython mkgraticule_planet.py ... -nde\r\n```\r\n\r\n## Planetary CRS\r\n\r\nThe `-srs` option accepts any coordinate reference system supported by GDAL / PROJ.\r\n\r\nPlanetary coordinate systems typically follow the **IAU 2015 cartographic coordinate system definitions**.\r\nMany IAU CRS definitions can be browsed at:\r\n\r\nhttps://spatialreference.org/\r\n\r\nExample codes:\r\n\r\n- `IAU_2015:30100` — Moon\r\n- `IAU_2015:49900` — Mars\r\n- `IAU_2015:40100` — Phobos\r\n\r\n## QGIS examples\r\n\r\n### Phobos example (with major/minor classification)\r\n\r\nExample global graticule for **Phobos**, generated using major/minor classification.\r\n\r\nCommand:\r\n\r\n```sh\r\npython mkgraticule_planet.py -srs IAU_2015:40100 \\\r\n                             -g 10 10 -m 30 30 \\\r\n                             phobos_grid10x10\r\n```\r\n\r\n![Phobos graticule example](docs/phobos_graticule_example.png)\r\n\r\n### Moon south polar stereographic example\r\n\r\nExample graticule generated for the **Moon south polar stereographic projection**  \r\n(`IAU_2015:30135`).\r\n\r\nBecause polar stereographic projections have a **limited valid domain**,  \r\nthe geographic extent is restricted to the south polar region.  \r\nThe `-nde` option is used to remove the duplicate endpoint meridian.\r\n\r\nCommand:\r\n\r\n```sh\r\npython mkgraticule_planet.py -srs IAU_2015:30135 \\\r\n                             -g 10 1 -m 30 2 \\\r\n                             -e -180 -80 180 -90 -nde \\\r\n                             moon_south_pole_graticule.gpkg\r\n```\r\n\r\n![Moon graticule example](docs/moon_graticule_example.png)\r\n\r\n### Earth Mollweide example\r\n\r\nExample global graticule for the **Earth** using the **World Mollweide projection**  \r\n(`ESRI:54009`).\r\n\r\nThis example shows that the tool can also be used with non-IAU coordinate reference systems supported by GDAL / PROJ.\r\n\r\nCommand:\r\n\r\n```sh\r\npython mkgraticule_planet.py -srs ESRI:54009 \\\r\n                             -g 30 10 \\\r\n                             -m 90 30 \\\r\n                             -e -180 90 180 -90 \\\r\n                             earth_mollweide_graticule.gpkg\r\n```\r\n\r\n![Earth graticule example](docs/earth_graticule_example.png)\r\n\r\n## Output fields\r\n\r\n| Field   | Description                     |\r\n| ------- | ------------------------------- |\r\n| fid     | feature id                      |\r\n| lat     | latitude value                  |\r\n| lon     | longitude value                 |\r\n| lat_90 | latitude label (-90° … 90°)     |\r\n| lat_ns  | latitude label (90°S … 90°N)    |\r\n| lon_180 | longitude label (-180° … 180°)  |\r\n| lon_ew  | longitude label (180°W … 180°E) |\r\n| lon_360 | longitude label (0° … 360°)     |\r\n| lon_360 | longitude label (0°E … 360°E)     |\r\n| grid_type | `\"major\"` / `\"minor\"` when `--major` is used (otherwise NULL) |\r\n\r\n## Acknowledgement\r\n\r\nThis project is based on the GDAL sample script:\r\n\r\nhttps://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/samples/mkgraticule.py\r\n\r\n## Citation\r\n\r\nIf you use this software in your research, please cite:\r\n\r\nHemmi, R. (2026). *mkgraticule_planet*. Zenodo.  \r\nhttps://doi.org/10.5281/zenodo.18864189\r\n\r\n## License\r\n\r\nMIT License. See the LICENSE file for details.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryodohemmi%2Fmkgraticule_planet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryodohemmi%2Fmkgraticule_planet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryodohemmi%2Fmkgraticule_planet/lists"}