{"id":16723320,"url":"https://github.com/chrieke/geojson-validator","last_synced_at":"2025-12-14T14:28:00.033Z","repository":{"id":213992766,"uuid":"728342125","full_name":"chrieke/geojson-validator","owner":"chrieke","description":"🛠️ Validate GeoJSON and automatically fix invalid geometries","archived":false,"fork":false,"pushed_at":"2025-08-01T22:30:10.000Z","size":377,"stargazers_count":36,"open_issues_count":3,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-24T21:52:41.292Z","etag":null,"topics":["geojson","geometry","geospatial","json","linestring","linter","polygon","validation","vector"],"latest_commit_sha":null,"homepage":"https://geojson-validator.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrieke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-06T18:27:35.000Z","updated_at":"2025-07-27T09:37:51.000Z","dependencies_parsed_at":"2023-12-28T13:38:21.385Z","dependency_job_id":"ff931beb-575f-4c00-b987-d78292db0383","html_url":"https://github.com/chrieke/geojson-validator","commit_stats":{"total_commits":213,"total_committers":4,"mean_commits":53.25,"dds":"0.014084507042253502","last_synced_commit":"c89656e50edc083814e05e63f6827f0001e1c995"},"previous_names":["chrieke/geojsonvalidate","chrieke/geojson-validate","chrieke/geojson_validate","chrieke/geojsonfix","chrieke/geojson-validator"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/chrieke/geojson-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrieke%2Fgeojson-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrieke%2Fgeojson-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrieke%2Fgeojson-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrieke%2Fgeojson-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrieke","download_url":"https://codeload.github.com/chrieke/geojson-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrieke%2Fgeojson-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278399690,"owners_count":25980332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["geojson","geometry","geospatial","json","linestring","linter","polygon","validation","vector"],"created_at":"2024-10-12T22:37:43.094Z","updated_at":"2025-10-05T02:08:09.762Z","avatar_url":"https://github.com/chrieke.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GeoJSON Validator\n\n\u003cimg src=\"./repo-images/header_img.jpeg\"\u003e\n\n**Validate GeoJSON and automatically fix invalid geometries**. Like *geojsonhint*, but with geometry checks \u0026 fixes!\n\n- 🔴 **Detects invalid geometries** \u0026 🟢 **fixes them** : *Unclosed, wrong winding order etc.* \n- 🟨 **Problematic** geometries (for many tools \u0026 APIs): *Self-intersection, crossing anti-meridian etc.*\n- Checks 🧬 **structure** according to GeoJSON specification\n- Use **Website** or **Python package**\n\n\u003cbr\u003e\n\n\u003ch3 align=\"center\"\u003e\n    🎈 \u003ca href=\"https://geojson-validator.streamlit.app/\"\u003egeojson-validator.streamlit.app in the Browser 🎈 \u003c/a\u003e\n\u003c/h3\u003e\n\n\u003cimg src=\"./repo-images/gif.gif\"\u003e\n\n\u003cbr\u003e\n\nAlso see the \n[geojson-invalid-geometry](https://github.com/chrieke/geojson-invalid-geometry) list for detailed explanations of all possible GeoJSON issues.\n\n### Quickstart Python\n\n```bash\n# Installation\npip install geojson-validator\n```\n\nData input can be any type of GeoJSON object, a filepath/url, and anything with a `__geo_interface__` (shapely, geopandas etc.).\n\n```python\nimport geojson_validator\n\ngeojson_input = {'type': 'FeatureCollection',\n                 'features': [{'type': 'Feature', 'geometry':\n                     {'type': 'Point', 'coordinates': [-59.758285, 8.367035]}}]}\n\ngeojson_validator.validate_structure(geojson_input)\ngeojson_validator.validate_geometries(geojson_input)\ngeojson_validator.fix_geometries(geojson_input)\n```\n\u003cbr\u003e\n\n### 1. Validate GeoJSON structure 🧬\n\nChecks the structure \u0026 formatting of the GeoJSON, e.g. required elements, data \u0026 geometry types, coordinate array depth etc.\n\n```python\ngeojson_validator.validate_structure(geojson_input, check_crs=False)\n```\n\nReturns the reasons why the input does not conform to the GeoJSON specification.\nAlso gives the line location and feature index to more quickly localize the issues. \nExample: `{\"Missing 'type' member\": {\"line\": [4], \"feature\": [0]}`.\n\n\n### 2. Validate geometries 🟥\n\nChecks the GeoJSON geometry objects for inconsistencies and geometric issues. See \n[geojson-invalid-geometry](https://github.com/chrieke/geojson-invalid-geometry) for a detailed description of all \ninvalid and problematic criteria. You can choose to validate only specific criteria, by default all are selected.\n\n```python\n# Invalid according to the GeoJSON specification\ncriteria_invalid = [\"unclosed\", \"less_three_unique_nodes\", \"exterior_not_ccw\",\n                    \"interior_not_cw\", \"inner_and_exterior_ring_intersect\"]\n\n# Problematic with some tools \u0026 APIs\ncriteria_problematic = [\"holes\", \"self_intersection\", \"duplicate_nodes\", \n                        \"excessive_coordinate_precision\", \"excessive_vertices\", \n                        \"3d_coordinates\", \"outside_lat_lon_boundaries\", \"crosses_antimeridian\"]\n\ngeojson_validator.validate_geometries(geojson, criteria_invalid, criteria_problematic)\n```\nReturns the reasons (example below) and positional indices of the invalid geometries, e.g. features `[0, 3]`. Also indicates if a \nsub-geometry of a MultiType geometry make it invalid e.g. `{2:[0, 5]}`.\n\n```\n{\"invalid\": \n      {\"unclosed\": [0, 3],\n       \"exterior_not_ccw\":  [{2:[0, 5]}],  \n \"problematic\":\n      {\"crosses_antimeridian\": [1]},\n \"count_geometry_types\": \n      {\"Polygon\": 3,\n       \"MultiPolygon\": 1}}\n```\n\n\n\n### 3. Fix GeoJSON geometries 🟩\n\nAutomatically repairs some of the most common categories of invalid geometries. \nAlways fixes *[\"unclosed\", \"exterior_not_ccw\", \"interior_not_cw\"]*.\nSelect additional, non-essential fixes with the parameter `optional`.\nMore fixes and helper-functions (for issues that require user descisions) **coming soon**!\n\n\n\n```python\ngeojson_validator.fix_geometries(geojson_input, optional=[\"duplicate_nodes\"])\n```\n\nThe result is a GeoJSON FeatureCollection with the fixed geometries.\n\n\n\n### FAQ:\n- Why not use geojson-pydantic for the schema validation?\npydantic error messages a bit convulted (if one coordinate is missing error 4 times), very schema like, not custom, not easy to understand for no nprogrammers.\noften would need to be translated.\n- Too many logging messages, can I disable them? You can disable or configure the logging behavior via `geojson_validator.configure_logging(enabled=True, level=\"DEBUG\")` which also returns the logger instance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrieke%2Fgeojson-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrieke%2Fgeojson-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrieke%2Fgeojson-validator/lists"}