{"id":15560776,"url":"https://github.com/tyrasd/rfc7946-to-d3","last_synced_at":"2025-04-23T21:20:38.215Z","repository":{"id":66191395,"uuid":"84430695","full_name":"tyrasd/rfc7946-to-d3","owner":"tyrasd","description":"Converts rfc7946 geojson polygons to d3 compatible ones","archived":false,"fork":false,"pushed_at":"2018-05-28T06:41:29.000Z","size":5,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T03:41:09.161Z","etag":null,"topics":["d3","geojson","winding"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tyrasd.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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}},"created_at":"2017-03-09T10:43:27.000Z","updated_at":"2023-03-13T09:00:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebd0583e-46f8-4c02-b34f-86d3163c1b6d","html_url":"https://github.com/tyrasd/rfc7946-to-d3","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":0.5,"last_synced_commit":"3a2120bde736b54fcf31256e6c37cf693d425366"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyrasd%2Frfc7946-to-d3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyrasd%2Frfc7946-to-d3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyrasd%2Frfc7946-to-d3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyrasd%2Frfc7946-to-d3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyrasd","download_url":"https://codeload.github.com/tyrasd/rfc7946-to-d3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250515153,"owners_count":21443328,"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","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":["d3","geojson","winding"],"created_at":"2024-10-02T16:02:51.079Z","updated_at":"2025-04-23T21:20:38.185Z","avatar_url":"https://github.com/tyrasd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"rfc7946-to-d3\n=============\n\nConverts polygon winding order between [RFC7946 geojson](https://tools.ietf.org/html/rfc7946#section-3.1.6) and [D3](https://github.com/d3/d3-geo#d3-geo) [compatible](https://github.com/d3/d3-geo/pull/79) conventions.\n\n![](https://travis-ci.org/tyrasd/rfc7946-to-d3.svg)\n\nWhy\n---\n\nD3 [assumes](https://github.com/d3/d3-geo#d3-geo) GeoJSON polygon coordinates to be sorted in a clockwise order, while rfc7946 GeoJSON assumes the **opposite** (counterclockwise or [right-hand-rule](https://en.wikipedia.org/wiki/Right-hand_rule) winding). This difference causes issues for example when calculating [bounding boxes](https://github.com/d3/d3-geo#geoBounds) or applying [projections](https://github.com/d3/d3-geo-projection#geoProject) on such polygons.\n\nThis module converts between the two convertions by simply reversing the order of all (multi)polygon linear rings of the given input.\n\nUsage\n-----\n\n* as npm module\n\ninstall:\n\n    npm install --save rfc7946-to-d3\n\napi:\n\nA function that takes in rfc7946 geojson and spits out d3 compatible geojson (input is modified in place!).\n\n* as cli utility\n\ninstall:\n\n    [sudo] npm install -g rfc7946-to-d3\n\nuse:\n\n    rfc7946-to-d3 \u003c rfc7946.geojson \u003e d3.geojson\n\nSee also\n--------\n\n* [geojson-rewind](https://github.com/mapbox/geojson-rewind) a module that enforces geojson polygon ring winding order. (Useful when working with [legacy geojson](http://geojson.org/) data: e.g. `cat legacy.geojson | geojson-rewing | rfc7946-to-d3 | geoproject …`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyrasd%2Frfc7946-to-d3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyrasd%2Frfc7946-to-d3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyrasd%2Frfc7946-to-d3/lists"}