{"id":13749450,"url":"https://github.com/Turfjs/turf-inside","last_synced_at":"2025-05-09T12:32:53.937Z","repository":{"id":15616748,"uuid":"18353206","full_name":"Turfjs/turf-inside","owner":"Turfjs","description":"Checks to see if a point is inside of a polygon.","archived":true,"fork":false,"pushed_at":"2019-05-09T16:26:10.000Z","size":29,"stargazers_count":41,"open_issues_count":9,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-29T21:39:37.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/Turfjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-02T03:16:10.000Z","updated_at":"2024-12-04T10:50:50.000Z","dependencies_parsed_at":"2022-07-25T22:18:10.551Z","dependency_job_id":null,"html_url":"https://github.com/Turfjs/turf-inside","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turfjs%2Fturf-inside","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turfjs%2Fturf-inside/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turfjs%2Fturf-inside/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turfjs%2Fturf-inside/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Turfjs","download_url":"https://codeload.github.com/Turfjs/turf-inside/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253251762,"owners_count":21878561,"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":[],"created_at":"2024-08-03T07:01:02.216Z","updated_at":"2025-05-09T12:32:53.698Z","avatar_url":"https://github.com/Turfjs.png","language":"JavaScript","readme":"# DEPRECATED - replaced by [`@turf/boolean-point-in-polygon`](https://www.npmjs.com/package/@turf/boolean-point-in-polygon)\n\n# turf-inside\n\n[![build status](https://secure.travis-ci.org/Turfjs/turf-inside.png)](http://travis-ci.org/Turfjs/turf-inside)\n\nturf inside module\n\n\n### `turf.inside(point, polygon)`\n\nTakes a Point and a Polygon or MultiPolygon and determines if the point resides inside the polygon. The polygon can\nbe convex or concave. The function accounts for holes.\n\n\n### Parameters\n\n| parameter | type                              | description                   |\n| --------- | --------------------------------- | ----------------------------- |\n| `point`   | Feature\\.\\\u003cPoint\\\u003e                | input point                   |\n| `polygon` | Feature\\.\\\u003cPolygon|MultiPolygon\\\u003e | input polygon or multipolygon |\n\n\n### Example\n\n```js\nvar pt1 = {\n  \"type\": \"Feature\",\n  \"properties\": {\n    \"marker-color\": \"#f00\"\n  },\n  \"geometry\": {\n    \"type\": \"Point\",\n    \"coordinates\": [-111.467285, 40.75766]\n  }\n};\nvar pt2 = {\n  \"type\": \"Feature\",\n  \"properties\": {\n    \"marker-color\": \"#0f0\"\n  },\n  \"geometry\": {\n    \"type\": \"Point\",\n    \"coordinates\": [-111.873779, 40.647303]\n  }\n};\nvar poly = {\n  \"type\": \"Feature\",\n  \"properties\": {},\n  \"geometry\": {\n    \"type\": \"Polygon\",\n    \"coordinates\": [[\n      [-112.074279, 40.52215],\n      [-112.074279, 40.853293],\n      [-111.610107, 40.853293],\n      [-111.610107, 40.52215],\n      [-112.074279, 40.52215]\n    ]]\n  }\n};\n\nvar features = {\n  \"type\": \"FeatureCollection\",\n  \"features\": [pt1, pt2, poly]\n};\n\n//=features\n\nvar isInside1 = turf.inside(pt1, poly);\n//=isInside1\n\nvar isInside2 = turf.inside(pt2, poly);\n//=isInside2\n```\n\n\n**Returns** `Boolean`, `true` if the Point is inside the Polygon; `false` if the Point is not inside the Polygon\n\n## Installation\n\nRequires [nodejs](http://nodejs.org/).\n\n```sh\n$ npm install turf-inside\n```\n\n## Tests\n\n```sh\n$ npm test\n```\n\n\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTurfjs%2Fturf-inside","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTurfjs%2Fturf-inside","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTurfjs%2Fturf-inside/lists"}