fmidev / fmi-avi-messageconverter

API classes for aviation weather message handling
MIT License
4 stars 6 forks source link

Polygon direction in model #75

Open petringo opened 3 years ago

petringo commented 3 years ago

The model should represent the information of aviation weather messages represented in both TAC and IWXXM formats. The direction on polygon points is specified differently in these formats:

It must be de defined how these different direction requirements are handled without confusion. Currently the model does not opine on direction of polygons. This leads to problems if e.g. TAC parser reads a clockwise polygon into the model, and then IWXXM serializer reads the polygon from the model as is without reversing the direction.

Possible alternatives for a solution could be:

  1. Declare model polygons to be always clockwise.
  2. Declare model polygons to be always counter-clockwise.
  3. Add a flag or a method in the model to determine if represented polygon is clockwise or counter-clockwise.
    • This could be developed further, if seen appropriate, providing additional methods like getExteriorRingPositionsClockwise() and getExteriorRingPositionsCounterClockwise()
  4. Something else?