A JavaScript library to enforce correct polygon ring winding order in GeoJSON data for specification compliance.
geojson-rewind is a JavaScript library that corrects the winding order of polygon rings in GeoJSON data to ensure compliance with the official RFC 7946 specification. It solves the common problem of invalid polygon orientations that cause rendering issues in mapping libraries and drawing tools. The tool adjusts ring directions so outer and inner rings follow the required clockwise or counterclockwise order.
Developers and data engineers working with GeoJSON data in mapping applications, GIS tools, or data pipelines who need to validate and correct geometry winding orders. It's particularly useful for those integrating with strict GeoJSON parsers or Canvas-based rendering.
It provides a lightweight, focused solution for a specific but critical GeoJSON compliance issue, with a simple API and multiple distribution formats (npm, CLI, browser). Unlike broader validation libraries, it specializes in winding order correction, ensuring compatibility with tools that rely on correct ring orientation for rendering.
enforce polygon ring winding order for geojson
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically adjusts polygon ring directions to meet RFC 7946 standards, as emphasized in the README for preventing rendering errors in strict parsers.
Ensures proper interior ring shading in Canvas-based drawing by aligning with default fill behaviors, directly referenced in the README's use case descriptions.
Offers a single `rewind(geojson, clockwise)` function that accepts FeatureCollections, Features, or Geometries, making integration straightforward with minimal code.
Available as npm module, CLI tool, and browser script via bundle.run, supporting diverse workflows from development to production environments.
Only corrects Polygon and MultiPolygon types; other GeoJSON geometries are ignored, requiring additional tools for comprehensive data handling.
The README lacks examples for error handling, performance benchmarks, or advanced use cases, leaving developers to trial-and-error for edge scenarios.
Focuses solely on winding order without checking for other GeoJSON issues like invalid coordinates or schema errors, necessitating separate validation steps.