1. A concise explanation of the problem you're experiencing.
how to find what are the lat longs intersecting on polyline
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Function to find what are the lat longs intersecting on polyline
4. The Cesium version you're using, your operating system and browser.
1.39 cesuim, window 10
I don’t think there’s a way to directly check if something intersects with a polyline, but you can check yourself using the positions and IntersectionTests.
I have tried below code to find intersecting coordinates between from start to end lat longs.
I didn’t get any data.
please help me with functionality.
below code i tried:
I’m still not sure what you are trying to accomplish. Are you trying to test if those two point intersect the line segment, or is the second set of points it’s own line segment?
I think this is not so much a problem with the Cesium API, but rather a geometry problem. You might have more success asking on a Math forum. Then if you then have specific questions about Cesium ask them here.
I have tried and implemented the functionality. Thank you.
Is that possible to compare with an array intersecting between starting and ending point?
I want to test an array of coordinates in center with starting and ending point.
something like this as below example: Please guide me.
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var p0 = Cesium.Cartesian3.fromDegrees([78.38126509772302,17.451123346716912]);
var p1 = Cesium.Cartesian3.fromDegrees([78.3815350820249,17.451429693791102]);
var sphere= new Cesium.BoundingSphere(center,0);
var intersections = Cesium.IntersectionTests.lineSegmentSphere(p0, p1, sphere);
There’s nothing special in the Cesium API to do that, you should be able to iterate through an array of Cartesian3’s and tests the intersections.