turf-inside | Checks to see if a point is inside of a polygon
kandi X-RAY | turf-inside Summary
kandi X-RAY | turf-inside Summary
Checks to see if a point is inside of a polygon.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Checks if a point is inside of a polygon
- Show documentation .
turf-inside Key Features
turf-inside Examples and Code Snippets
Community Discussions
Trending Discussions on turf-inside
QUESTION
I am displaying a point and a polygon in Cesium.js, and using turf.js to check is the point inside the polygon.
When displayed in Cesium (or geojson.io), the point is clearly outside the polygon, as can be seen here:
http://geojson.io/#id=gist:kujosHeist/1030e392bd751daf5d9af57aa412a49c&map=3/46.80/-22.76
However, when I queried this on the turf.js issiues page:
https://github.com/Turfjs/turf-inside/issues/15
I was told it was because geojson, (and therefore Cesium) is "misrepresenting the point since it uses World Web Mercator projection (EPSG:3857)" and that "viewing the same point/polygon using WGS84 with QGIS" ...shows the point is inside the polygon.
So my question is: How can I change the map projection used in Cesium (and also in geojson.io if possible), so that the point is correctly displayed inside the polygon?
...ANSWER
Answered 2017-Jun-09 at 20:05I am not sure how well geojson.io or Cesium will handle different coordinate systems, but you can specify a CRS element in your GeoJSON that indicates the coordinate system used by points of your features. This is added as a member under your feature collection. For example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install turf-inside
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page