S-101-Portrayal-subWG / Working-Documents

17 stars 5 forks source link

Incorrect drawing of some Complex line styles #89

Closed alvarosanuy closed 1 year ago

alvarosanuy commented 2 years ago

Dedicated Github issue to discuss topic presented by dKart (@IngaFjellanger) in the paper below (bullet point 7):

Comments to Portrayal Catalogue_last version.docx

Extract from paper:

  1. The drawing of some linear patterns (e.g. DWRTCL05, DWRTCL06, DWRTCL07, DWRTCL08, DWLDEF01 and etc.) is not correct. The pattern does not begin into start of the line object. There are significant shifts from the start point. It is caused a wrong description of the patterns in the corresponding xml files. The position values of pattern’s elements have been taken exactly from S-52 Addendum to Annex A, ENC symbol Catalogue. However, implementation of the drawing line patterns from .lin files and .xml are different. We don’t need to shift off the start point (e.g. 8.7 mm) for the pattern since we can use value to start the next iteration of the pattern. As a result, we can start next iteration at any place of the line.
alvarosanuy commented 2 years ago

Initial comment provided by Hugh on 27/7/22:

I traced through the conversion of each and found the following.

DWRTCL07 - Reported problem – first dash is not at start of line.
Assessment: the original S-52 DAI had an offset before the first dash and it can be seen in the S-52 screenshots. However, it seems that the bounding box info in the header is incorrect so the conversion to S-101 also carries across the incorrect cover. The linestyle will probably draw ok but strictly has some errors stemming from S-52. I can add some notes to the github issue once it is available.

IngaFjellanger commented 2 years ago

linear_pattern_start Picture to show the situation as we found it

IngaFjellanger commented 2 years ago

DeepWater_Line_comment#7.zip Here is our suggestion how to use xml to get a correct style. (Headers are not up to date)

mikan66 commented 2 years ago

Based on Hugh's comments this implies broader conversion issues with DAI files of this type. Is re-conversion necessary of the entire set?

TDYCARHugh commented 2 years ago

I don't think this is a conversion issue. The conversion was meant only to reproduce what was in S-52 not to rationalize or repair the content.

I took a look into the DWRTCL07 Linestyle.

In the S-52 4.0.0 DAI it looks like this: image

The parsed fields break down to this: LIND field LINM = DWRTCL07 LICL = 01236 Pivot point column 12.36mm LIRW = 01415 Pivot point row 14.15mm LIHL = 01307 width of bounding box 13.07mm LIVL = 00000 height of bounding box 0mm LIBXC = 02421 bounding box upper left column Adjust to pivot point 2421-1236 = 1185 X=11.85 LIBXR = 01415 bounding box upper left row. Adjust to pivot point 01415 -01415 = 0 Y=0 LCRF A= TRFCD LVCT pen A, width =1 (0.32) MoveTo 2221,1415 DrawTo 2630,1415 LVCT MoveTo 2879,1425 Symbol EMDWRTC2 Orientation=2 (90 to line) LVCT Pen A, Width 1, MoveTo 3129,1415, DrawTo 3529,1415 LVCT MoveTo 4050,1415 Symbol EMDWRUT2 rotation = 2 (90)

Line 9.85,0 to 13.94,0 length = 13.94 – 9.85 = 4.09
Symbol EMDWRTC2 at 16.43,0 Line 18.93,0 to 22.93.0 length = 4 Symbol EMDWRUT2 at 28.14,0

IntervalLength = total pattern width = Bounding box upper left X + bounding box width = 11.85 + 13.07 = 24.92 The line definitely starts with an offset of 9.85mm, the IntervalLength is suspect because there is a symbol at position 28.14 but the interval length is 24.92. It seems that the IntervalLenth should be at least 28.14, perhaps greater if you account for the width of the symbol EMDWRUT2.

The screenshot from S-52 4.0.3 shows that the DW lines are all offset. The image was produced using the same length sample line for each linestyle but you can see the top linestyles don’t start at the beginning of the line. Also the DW is drawn past the end of the line. This correlates to what we are seeing in the S-101 linestyle where the first dash is 9.9mm from the start of the line and the last DW symbol is being drawn past the end of the line pattern interval.

image

Conclusion: the conversion result is a reflection of what was in the DAI. Perhaps these linestyles should be edited and cleaned up but it would be a manual effort.

DavidGrant-NIWC commented 1 year ago

Will implement line styles from @IngaFjellanger in PC 1.1.0

alvarosanuy commented 1 year ago

Portrayal subWG meeting - 11th January 2023

  1. Decided to use new files provided by @IngaFjellanger above. @DavidGrant-NIWC to update header and upload to this space so Alvaro can commence registration of the new versions in the IHO GI Registry.

  2. For PC 1.1.0.

DavidGrant-NIWC commented 1 year ago

Implemented in PC 1.1.0

Before After
image image
alvarosanuy commented 1 year ago

@DavidGrant-NIWC - Can you please upload here the updated versions (new header) of symbols DWRTCLnn (x5).

alvarosanuy commented 1 year ago

@DavidGrant-NIWC @mikan66 - - Can you please upload here the updated versions (new header) of symbols DWRTCLnn (x5). I need them to proceed with their registration in the GI Registry.

mikan66 commented 1 year ago

Here are the files from the main baseline. DWLineStyles.zip

alvarosanuy commented 1 year ago

Implemented in PC 1.1.0.

Updated line styles have been submitted to the GI Registry.