European Commission logo
INSPIRE Community Forum

Orientation of polygons created using HALE

Bas VANMEULEBROUK
By Bas VANMEULEBROUK Replies (16)

During the workshop on extending the INSPIRE PS Theme for CDDA Reporting at the EEA we have used HALE to transform shape files to the new INSPIRE compliant CDDA datamodel. There is one problem with the generated GML file: it contains clockwise outer polygons whereas the GML specifications prescribes outer polygons should be counter clockwise. This is probably due to the fact that in a shape file outer polygons should be clockwise. Anyone come across this problem and found a solution?

  • Stefania MORRONE

    By Stefania MORRONE

    Hi Thorsten,

    I tested the new "Unify winding order" feature, re-running old projects.

    Validation of the GML datasets created selecting the "Unify winding order to counterclockwise" option is successful .

    So, thank you for implementing !

    Stefania

     

  • Iurie MAXIM

    Hi Thorsten,

    Is there any solution to implement this as a mapping/transformation function, rather than at it is now implemented at the end of the process, only when exporting the GML ?

    I am asking this because if storing counterclocwise spatial data in a PostGIS database and if records will be added or edited with qGIS for example, (or if a shapefile is imported in PostGIS) then only the added/edited records will be stored clocwise, so in the same table will have both types> clockwise and counter clockwise.

    Even if  PostGIS and qGIS have no problem with this, still a mapping problem exist.

    On the other hand, is there any function in app-schema that deals with this issue?

    Best regards,

    Iurie Maxim

  • Thorsten REITZ

    By Thorsten REITZ

    Hi Iurie,

    In this case, we've implemented the Control Winding Order feature as part of the encoding, because at least some variants of GML explicitly require control of the encoding. As of now, there is no transformation function available that does the same thing. I've added an issue to Github's halestudio repo, but I don't think we can include this feature for the next release. If you need a quick fix, you could build a custom function using java/groovy to achieve the same thing.

    All the best,

    Thorsten

  • Stefania MORRONE

    By Stefania MORRONE

    Hi Iurie,

    good question indeed!

    I am facing the same problem (how to deal with updated/new records) and I am thinking of trying Postgis functions ST_ForceRHR and ForceLHR to force a polygon's geometry to follow either a right or left hand rule or ST_Reverse function. 

    Have you ever used them?

    Stefania

  • Iurie MAXIM

    Hi Stefania,

    Of course we tested ST_ForceRHR and ForceLHR. Both are crashing when using on large spatial features. PostgreSQL is restarted/shut down when using any of these functions on large spatial features. On small features there are no problems.

    For example using ST_ForceRHR or ForceLHR for the boundary of a country will not work, except if the country is small. We faced this issue for biogeographical regions. They have a lot of vertices.

    Best regards,

    Iurie Maxim

  • Iurie MAXIM

    Hi Thorsen,

    Thanks for pointing the java/groovy custom function for future use. Currently we solved the issue by using two databases, MS SQL and PostGIS.

    There is any solution/work around for app-schema ?

    Best reagrds,

    Iurie

     

This discussion is closed.

This discussion is closed and is not accepting new comments.

Biodiversity & Area Management

Biodiversity & Area Management

If themes like Protected Sites, Area Management/Restriction/Regulation Zones and Reporting Units, Habitats and Biotopes, Species Distribution, Bio-geographical Regions matters to you, join these groups!