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

GSLUX-737: Export drawn feature as gpx, kml and shapefile #156

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

AlitaBernachot
Copy link
Contributor

@AlitaBernachot AlitaBernachot commented Oct 9, 2024

JIRA issue

https://jira.camptocamp.com/browse/GSLUX-737

Description

Export drawn feature as gpx, kml and shapefile + fix export gpx for circle and polygon (does not work in prod).
Export gpx and kml does not call api anymore.

NB. use chrome plugin for CORS policy when exporting to shapefile (you need v3 running on localhost:8080)

Copy link
Contributor

github-actions bot commented Oct 9, 2024

GitHub Pages links: * Luxembourg-geoportail: https://geoportail-luxembourg.github.io/luxembourg-geoportail/GSLUX-737-export-feat/

Copy link
Contributor

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Thanks for the clean architecture and the unit tests @AlitaBernachot!

PR LGTM, only thing I noticed testing is that production also exports feature properties in a <ExtendedData> tag within KML, not shapefile though. So I don't know if it's relevant.

@AlitaBernachot
Copy link
Contributor Author

PR LGTM, only thing I noticed testing is that production also exports feature properties in a <ExtendedData> tag within KML, not shapefile though. So I don't know if it's relevant.

There are ExtendedData in kml files exported by v3 because v3 is setting some properties on ol layers (__editable__, __refreshProfile__, __map_id__, __selected__, display_order, name, isLabel, opacity, shape, ...). It looks like these are properties made for the Controller more than for the kml export functionality. Maybe there is a functionality to import kml and in that case it will be relevant, but for now I am just ignoring these prop.

@AlitaBernachot
Copy link
Contributor Author

AlitaBernachot commented Oct 14, 2024

There are ExtendedData in kml files exported by v3 because v3 is setting some properties on ol layers (__editable__, __refreshProfile__, __map_id__, __selected__, display_order, name, isLabel, opacity, shape, ...). It looks like these are properties made for the Controller more than for the kml export functionality. Maybe there is a functionality to import kml and in that case it will be relevant, but for now I am just ignoring these prop.

@tkohr after checking with the client, it is possible to import kml but you need to login first and use MyMaps. Since this is related to MyMaps functionality, I suggest to handle this during the dev for MyMaps (https://camptocamp.atlassian.net/browse/GSLUX-710).

@AlitaBernachot AlitaBernachot force-pushed the GSLUX-737-export-feat branch 2 times, most recently from 76d8cf6 to 56998af Compare October 15, 2024 07:51
@AlitaBernachot
Copy link
Contributor Author

AlitaBernachot commented Oct 15, 2024

@tkohr just tested adding random custom property to the feature (eg. feature.set('__my_totoprop__', 'Toto')), ol kml writer automatically creates <ExtendedData> with the custom prop <Data name="__my_totoprop__"><value>Toto</value></Data> in the kml, so it should be easy in the future to add all the custom props related to mymaps (editable, refreshProfile, map_id, selected)

@AlitaBernachot AlitaBernachot merged commit a76b429 into main Oct 15, 2024
2 checks passed
@AlitaBernachot AlitaBernachot deleted the GSLUX-737-export-feat branch October 15, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants