Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-04-interlis-export-orientation-option #217

Merged
merged 29 commits into from
May 7, 2024

Conversation

sjib
Copy link
Contributor

@sjib sjib commented Apr 23, 2024

No description provided.

@sjib sjib marked this pull request as draft April 23, 2024 19:53
@sjib
Copy link
Contributor Author

sjib commented Apr 23, 2024

Should solve #216

"""
Returns an angle between 0 and 359.9 (for Orientierung in Base_d-20181005.ili)
"""
if val is None:
return None

# add selected_orientation
val = val + selected_orientation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@domi4484 Is this enough to add the selected_orientation to val or do I need to adapt something else in the function call?

"textori": self._modulo_angle(row["properties"]["LabelRotation"]),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No you have to pass the angle to the modulo function and to the exporter

@sjib sjib requested a review from domi4484 April 24, 2024 19:26
Copy link
Contributor

@domi4484 domi4484 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the comments # neu export orientation can be removed as they don't make the code more readable and are its clear by git that this option was added in a second time

@ponceta ponceta added this to the TEKSI Wastewater 2024.1 milestone Apr 25, 2024
sjib and others added 7 commits April 25, 2024 10:49
…dialog.py


rename selected_orientation to labels_orientation_offset

Co-authored-by: Damiano Lombardi <[email protected]>
export_orientation initialized as float

Co-authored-by: Damiano Lombardi <[email protected]>
 Add export_orientation=export_orientation to _export_to_intermediate_schema function
@sjib sjib requested a review from domi4484 April 25, 2024 12:25
@sjib sjib self-assigned this Apr 25, 2024
@sjib sjib added the enhancement New feature or request label Apr 25, 2024
@sjib sjib marked this pull request as ready for review April 25, 2024 12:26
@@ -341,6 +350,7 @@ def _export_to_intermediate_schema(
export_model,
file_name=None,
selected_ids=None,
export_orientation=90.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you also need to pass this parameter to InterlisExporterToIntermediateSchema

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export_orientation=selected_orientation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not to work like that:
==================================== ERRORS ==================================== ___________ ERROR collecting teksi_wastewater/tests/test_interlis.py ___________ teksi_wastewater/tests/test_interlis.py:8: in <module> from teksi_wastewater.interlis.interlis_importer_exporter import ( teksi_wastewater/interlis/interlis_importer_exporter.py:56: in <module> class InterlisImporterExporter: teksi_wastewater/interlis/interlis_importer_exporter.py:156: in InterlisImporterExporter export_orientation=selected_orientation, E NameError: name 'selected_orientation' is not defined =========================== short test summary info ============================ ERROR teksi_wastewater/tests/test_interlis.py - NameError: name 'selected_ori... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.73s =============================== 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@domi4484 Is this now set as it should with: export_orientation=90.0,

@sjib sjib requested a review from domi4484 May 4, 2024 19:24
@ponceta ponceta merged commit b787e01 into main May 7, 2024
4 checks passed
@ponceta ponceta deleted the 2024-04-interlis-export-orientation-option branch May 7, 2024 06:12
cymed added a commit to cymed/TEKSI-wastewater that referenced this pull request Jul 4, 2024
Up to now, the labels_orientation_offset is not passed to the function _modulo_angle in the intermediate schema.

This PR takes the changes from teksi#217 and applies the following fixes:

- tww:extractlabels_interlis has no Parameter "EXPORT_ORIENTATION". Parameter is dropped on export of labels. file.
- On Export, the orientation offset is passed to the intermediate schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants