openoereb / pyramid_oereb_mfp

Implementation of a static extract (PDF export) for the pyramid_oereb server with MapFish-Print
1 stars 3 forks source link

96-label-flaeche #104

Closed michmuel closed 2 years ago

michmuel commented 2 years ago

fix https://github.com/openoereb/pyramid_oereb_mfp/issues/96

jwkaltz commented 2 years ago

Thanks @michmuel is it OK if we wait for Marion's return for the review? I would feel more confident.

michmuel commented 2 years ago

That's fine. Maybe she knows if it is possible to define a variable for the position offset to improve the readability (fewer repetitions of the same code).

michmuel commented 2 years ago

@marionb If Display_RealEstate_SubunitOfLandRegister==False the respective row is not displayed. This causes a change of the vertical position of the row with the area information, and, according to the specs, also a vertical shift of all elements below. See: https://www.cadastre.ch/content/cadastre-internet/de/manual-oereb/publication/instruction.download/cadastre-internet/de/documents/oereb-weisungen/Weisung-statischer-Auszug-de.pdf

I am wondering if something like this works (conceptually described):

if Display_RealEstate_SubunitOfLandRegister
    delta_vertical_pos = 0
else
   delta_vertical_pos = y_offset
...
<reportElement x="0" y="540+delta_verical_pos" width="493" height="17" uuid="22ad5f4f-d1eb-4eef-ad76-4458ea1734df">

So, the code would not have to be duplicated. But maybe, there is no such option.

marionb commented 2 years ago

OK I currently am looking at a version using. I think the easiest is to use two different sub-reports (using only one subreport unfortunately will not work for that we will probably have to restructure how the data comes in from pyramid_oereb and that will cost too much time to do). The best is to do something similar to what we already have for the tittle. Like this there will still be a lot of code duplication but it will be easier to read and hopefully understand ;-) I'll make a commit with a suggestion.