iho-ohi / S-101-Test-Datasets

A repository of S-101 test datasets which make available for development phases and they will be migrated to the Registry later.
22 stars 6 forks source link

digitising direction in DS017, symbols facing outward. #85

Open kusala9 opened 4 months ago

kusala9 commented 4 months ago

See S-164 issue https://github.com/iho-ohi/S-164-Sub-Group/issues/83. I've fixed a couple but needs looking at in DS017. this assumes it's a digitising direction problem, not a portrayal problem (I'm guessing portrayal can't sense whether the direction is the wrong way round?)

DavidGrant-NIWC commented 4 months ago

I was looking into this a little more; it's an interesting issue. S-57 requires that the outer boundary of a polygon is encoded CW: image

S-101 copies this requirement: image

All the S-101 symbols are designed based on this presumed orientation.

However, in ISO 1907 the outer boundary of a surface can be oriented either CW or CCW, but the "up" side is the one where the orientation is CCW: image

S-101 doesn't distinguish between the top and bottom, so it doesn't really matter if we draw our polygons facing down. For other products this could matter. Additionally, other products may have historically had geometry and symbolizations which were based on a CCW encoding.

This disconnect should at least be mentioned somewhere (S-97?) so that product specs can specify the required orientation, and symbols can be designed based on the required orientation for the given product.

DavidGrant-NIWC commented 4 months ago

I opened an S-100 issue to address this more broadly, but note that S-100 currently requires outer boundaries to be oriented CW and inner to be oriented CCW.

We added a validation check for the polygon orientation, and all the current test datasets have lots of issues. Most of these aren't visible since only a subset of features are outlined with complex line styles, and even then the default is to show plain boundaries. image

kusala9 commented 3 months ago

updated cell 0017.000 (https://github.com/iho-ohi/S-101-Test-Datasets/commit/81e228066ed09ac11411840406b27686a33a455b) - can you check and confirm fixed in this cell, if it is then I'll push it out to the other cells in the morning. Might be an issue with the directions of interiors too but I think that can be dealt with in a similar way...

DavidGrant-NIWC commented 3 months ago

Looks to be fixed (geometry errors would show below in Category "Geometry"), the interiors also appear to be correct in cell 0017. The geometry can get tricky when you have curves which are shared by both Surfaces and Curves with differing orientations.

image

kusala9 commented 3 months ago

new versions of all the TDS cells are in https://github.com/iho-ohi/S-101-Test-Datasets/commit/894363de4c4db806516418175f66c206820b3580 - this corrects the orientation of the surfaces (which is where the mistake was). The other cells also need correcting but it's actually a small number of fixes. The surface has a direction, as do each of the components (potentially). Plus you can orient it in the spatial association field so it's a minefield. The cells all have the original directions now, so it'll be interesting to see if there's any errors. I will correct the US cells, and the S-164 ones if they suffer the same ailment.

kusala9 commented 3 months ago

think this is fixed in the latest update to the datasets. Suggest this is closed and re-opened if it causes another problem.

DavidGrant-NIWC commented 3 months ago

DS20ed6 still contains two issues, the other datasets are ok: image

image image

kusala9 commented 3 months ago

there's something funny going on with DS020 which I think may have been there since it was first made. Needs looking at in more detail. I've looked at both features and I think the direction is ok (of the exterior at least, the interiors may have issues). I've reversed the direction of the exteriors for both surfaces referenced by the features - can you check and see if that fixes the error. Separately I'll look in more detail and propose a change to fix what I think is a topology error. Would be interesting to see what validation throws up for this one in terms of geometry.

Cell is here. ds020.zip

kusala9 commented 3 months ago

the original cell seems to have a clockwise boundary for the feature concerned. Can you isolate whether it's the exterior of the feature or one of the interiors?

image

DavidGrant-NIWC commented 3 months ago

In the current cell from the repo (the updated cell posted above has the outer ring oriented backwards)

Fairway:Feature|48 these two rings are backwards: image

DepthArea:Feature|39 these two rings are backwards: image

DavidGrant-NIWC commented 3 months ago

Corrected in latest edition of DS1-32; recommend close.