Ticket #2174 (closed feature: fixed)

Opened 4 years ago

Last modified 4 years ago

Format.WMC write sld:min/maxScaleDenominator in the right place

Reported by: trondmm Owned by: bartvde
Priority: minor Milestone: 2.9 Release
Component: Format.WMC Version: 2.8
Keywords: Cc:
State: Complete

Description

When writing wmc documents, the optional sld:minScaleDenominator and sld:maxScaleDenominator elements is written after the Title element, while the schema places it between the optional StyleList and Extension elements.

Attachments

wmc_minmaxscale.patch Download (1.9 KB) - added by trondmm 4 years ago.
This patch corrects the placement of min and maxScaleDenominator elements - this time according to the revised standard :)
ticket2174.patch Download (5.5 KB) - added by bartvde 4 years ago.
alternative patch for conforming to the OGC WMC schema (includes a testcase)

Change History

follow-up: ↓ 2   Changed 4 years ago by bartvde

Trond are you sure? That's not what I see here:

 http://schemas.opengis.net/context/1.1.0/context.xsd

It's in between MetadataURL and SRS.

in reply to: ↑ 1   Changed 4 years ago by trondmm

  • state changed from Review to Needs More Work

Replying to bartvde:

Trond are you sure? That's not what I see here:  http://schemas.opengis.net/context/1.1.0/context.xsd It's in between MetadataURL and SRS.

Ah. I was looking at the OGC specification for WMC, there it's between StyleList and Extensions. However, I just had a look at the corrigendum, and that moves it to between MetaDataURL and SRS.

Hmm, I still think the logic needs to be changed, though, as it'll fail if an Abstract, DataURL or MetaDataURL element is present.

Changed 4 years ago by trondmm

This patch corrects the placement of min and maxScaleDenominator elements - this time according to the revised standard :)

  Changed 4 years ago by trondmm

  • state changed from Needs More Work to Review

This new patch will make sure that sld:MinScaleDenominator and sld:MaxScaleDenominator elements are placed after Abstract, DataURL and MetaDataURL, and before SRS, FormatList, StyleList, DimensionList and Extensions.

  Changed 4 years ago by tschaub

  • owner changed from tschaub to bartvde

follow-up: ↓ 6   Changed 4 years ago by bartvde

Trond, I've put up an alternative patch, can you see if that works for you as well? All relevant tests still pass.

Changed 4 years ago by bartvde

alternative patch for conforming to the OGC WMC schema (includes a testcase)

in reply to: ↑ 5   Changed 4 years ago by trondmm

Replying to bartvde:

Trond, I've put up an alternative patch, can you see if that works for you as well? All relevant tests still pass.

I've looked at it, but I haven't tested it yet. It looks like it would work, but I think it's unfortunate that it results in a lot of duplication of code between 1_0_0.js and 1_1_0.js. I've been working on another Format/WMC patch, which adds writing of SRS and Dimension elements. This code will also have to be duplicated between v1_0_0.js and 1_1_0.js with your patch. With my patch, it can stay in just v1.js.

It's not a big deal for me, though.

  Changed 4 years ago by bartvde

Hi Trond, Dimension is only in WMC 1.1 and not in 1.0, so that should not be an issue. For SRS it's true.

For me it is a difficult trade-off between your patch and my patch, so I'll ask the dev list for some advice on how to approach this.

  Changed 4 years ago by bartvde

See  http://www.pastebin.org/7157 for a schema comparison of LayerType (top is WMC 1.0, bottom is WMC 1.1).

  Changed 4 years ago by tschaub

  • state changed from Review to Commit

Bart, I think this approach makes sense (second patch). The ideal would be to have a representation of the schema in the format. The layer node writer would be the same for 1.1 and 1.0. The list of child nodes for the layer node would be different between the two versions. I started doing this but then backed off. This format would benefit from being upgraded to the new xml format style first.

In the meantime, I think the duplicated code is ok. Please commit.

  Changed 4 years ago by bartvde

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [9614]) fix up sequence of elements in Web Map Context 1.1 Format when writing, thanks trondmm for the catch and initial patch, r=tschaub (closes #2174)

Note: See TracTickets for help on using tickets.