Tesselllation - Question about creating a new polygon

Hello,

I’m currently trying to use a Tessellation function in Orekit to split a polygon into elementary strips. So far, I had no problem running the example polygons (continental and corsica). But when I tried to input a new polygon, I received an error message saying:
“cannot compute aiming direction at singular point: latitude = 90, longitude = 0”

This is how I defined my polygon:

     final SphericalPolygonsSet myaoi =
             EllipsoidTessellator.buildSimpleZone(1.0e-10,
                                                  new GeodeticPoint(FastMath.toRadians(40.76053),
                                                                    FastMath.toRadians(95.50688),
                                                                    0.0),
                                                  new GeodeticPoint(FastMath.toRadians(39.8784),
                                                                    FastMath.toRadians(99.61012),
                                                                    0.0),
                                                  new GeodeticPoint(FastMath.toRadians(35.58804),
                                                                    FastMath.toRadians(98.26018),
                                                                    0.0),
                                                  new GeodeticPoint(FastMath.toRadians(36.6172),
                                                                    FastMath.toRadians(94.17033),
                                                                    0.0));
          return myaoi;
    }

My polygon above is a rectangular shape with the size about 390x490 km. May be I define something wrong somewhere? Could you please take a look why I get this error message?

Kind regards,
Non

Hello Non!

The Orekit documentation on Tessellation requires the points of the polygon (Area of Interest) to be defined in a CCW (Counterclockwise) direction. This is not the case for the sequence of points that you have provided. The order of the polygon points you provide is clockwise.

The problem with defining clockwise polygons is that instead of defining your AOI, the sphere’s complement AOI is defined, which is the whole globe, minus your polygon! This is explained in the documentation, as below:

Care should be taken with the points ordering as they are expected to surround the zone counterclockwise (i.e. the interior is on the left hand side as we travel from one point to next point). Wrong orientation implies that what is defined is the complement of the desired region, which is much larger and will certainly fail to be tessellated properly as per the limitation explained above.

That part of the globe now contains both the North and South Pole, which are the singularity points of the Earth’s S2 sphere. This is why the program complains.

Please insert the points of the same polygon in the following CCW order. I believe that once you do this your problem will be solved. I used this new order myself and the AOI was tessellated successfully.

Please let us know if you were successful!

Manny

 final SphericalPolygonsSet myaoi =
         EllipsoidTessellator.buildSimpleZone(1.0e-10,
                                              new GeodeticPoint(FastMath.toRadians(39.8784),
                                                                FastMath.toRadians(99.61012),
                                                                0.0),
                                              new GeodeticPoint(FastMath.toRadians(40.76053),
                                                                FastMath.toRadians(95.50688),
                                                                0.0),
                                              new GeodeticPoint(FastMath.toRadians(36.6172),
                                                                FastMath.toRadians(94.17033),
                                                                0.0)
                                              new GeodeticPoint(FastMath.toRadians(35.58804),
                                                                FastMath.toRadians(98.26018),
                                                                0.0));
      return myaoi;
}
1 Like

Hello Manny,

Thank you so much for your help! That explained why my input didn’t work before. All of my polygons are defined clockwise. It was my bad I didn’t read the documentation clearly. The code worked like a charm now. Thank you once again!

Kind regards,
Non

1 Like