Skip to content

Implement common logic for saving to disk & writing to db for arcgis_feature_layer and comapeo_observations #89

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

rudokemper
Copy link
Member

Goal

Towards #86.

Screenshots

image
For CoMapeo, a GeoJSON file is now saved in the same location as attachments

What I changed

  • Rename save_export_file to save_data_to_file to clarify that it is a generic function that can be used at any time to save data to disk, not only when exporting.
  • The ArcGIS Feature Layer script now uses this save_data_to_file function instead of providing its own bespoke logic to do so.
  • The CoMapeo Observations script now implements both save_data_to_file and save_geojson_to_postgres.
    • download_and_transform_comapeo_data now transforms the incoming CoMapeo Archive Server data into a GeoJSON Feature Collection.
    • CoMapeoDBWriter class was removed entirely. Any business logic e.g. about converting docId was moved to download_and_transform_comapeo_data. Also, one line of code about truncating table names was moved to the GeoJSON-to-Potgres script (as it is good practice for any usage of this script).

What I'm not doing here

  • Adapting the Locus Map script, which will be a decent chunk of work (due to working with 3 different file formats) so will be a separate PR.

@rudokemper rudokemper requested a review from IamJeffG April 18, 2025 17:19
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.

1 participant