Hi @lghizoni
Welcome to the Orekit
I’m not familiar with that Orekit functionalities. However, I can try to help you.
First of all, I think that discussions in the post below can help you a lot. Especially Manny’s remark about the definition of the points of the polygon is very important (i.e. in a CCW direction).
The Orekit user in this post encountered the same problem that you currently have. If you don’t find any improvement, please find some remarks below.
First, could you change the value of hyperplaneThickness
parameter from 10.0
to 1.0e-10
. It is the typical value to use.
Secondly, maybe I’m wrong but your are calculated phi
angle of S2Point
using radians(lat + 90)
. Could you try using radians(90 - lat) ?
Finally, if my two previous remarks don’t help you, could you try to initialize the SphericalPolygonsSet
using the static methods in EllipsoidTessellator
class?
geodeticPoints = []
for lon, lat in zip(longitude, latitude):
geodeticPoints.append(GeodeticPoint(radians(lat), radians(lon), 0.0)
hyperplaneThickness = 1.0e-10
region_polygon = EllipsoidTessellator.buildSimpleZone(hyperplaneThickness, geodeticPoints)
I hope that I will help you. If not, we will try to find another solution.
Best regards,
Bryan