determine if a polyline or point is contained within a polygon?

I'm working on a project with several hundred defined polygon areas. I have a polyline which will intersect several of the polygons on its path. I'd like to keep the polygons hidden unless they're intersected by the polyline.

Is it possible to determine which polygons are intersected by the polyline?

Alternatively, I'm prepared to use EllipsoidGeodesic to test several points along the polyline if it's possible to determine if a point is contained within a polygon?

Hi Michael,

Cesium does not have these tests. It does, however, have a triangulation function so you could triangulate the polygon and then do point/polyline with triangle intersection, but it will take a bit of work. I suspect there are other JavaScript libraries you could include for these tests, perhaps even D3.

Patrick

I think I’m going to try this one:
https://github.com/substack/point-in-polygon

Change of course - I found my solution in the ESRI:Terraformer javascript toolkit - search terraformer on github

I actually just found a simpler solution, I had to remove height=device-height from the viewport meta tag and it works great. Check out https://github.com/AnalyticalGraphicsInc/cesium/pull/2133

Apologies, my last reply was in regards to the iPad sizing issue, not this thread.