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

Add GeoJSON<->JSON conversion (and vice versa) #25

Closed
ghost opened this issue Oct 19, 2022 · 9 comments
Closed

Add GeoJSON<->JSON conversion (and vice versa) #25

ghost opened this issue Oct 19, 2022 · 9 comments

Comments

@ghost
Copy link

ghost commented Oct 19, 2022

Apparently there is script in standard repo to do this, we want this to be moved into this repository. Once that is done, make sure cove can load both, and can provide a conversion in the same way it converts to XLSX.

@ghost ghost changed the title Add GeoJSON<->JSON convesion (and vice versa) Add GeoJSON<->JSON conversion (and vice versa) Oct 19, 2022
@lgs85
Copy link

lgs85 commented Oct 19, 2022

This is the issue that covers this in the standard repo, to-do also pasted below.

And here is @duncandewhurst's conversion function (note that there is at least one auxiliary function also within that script).

@odscjames we use this code as part of the schema development process (to update example files) so it would be good to consider that when use case when porting it over to here if possible.

Alpha

  • Check and update the transformation script and specification against the final alpha schema (need to handle network packages and JSON Lines) and update the publication guidance accordingly
  • Author more content for the publication formats reference and guidance

Beta

  • Action to-dos in transformation script code
  • Write a script to convert from GeoJSON format to JSON format
  • Add output path/name as an argument to convert-to-geojson, especially if we're going to leave it in manage.py for now.
  • Add tests and error handling

Documentation

  • Shift the specification into a table for easier reading/reference (@duncandewhurst will do)

@ghost
Copy link
Author

ghost commented Oct 19, 2022

Is there a reason that nodes & links are dumped to separate files instead of the same one?

@lgs85
Copy link

lgs85 commented Oct 19, 2022

@odscjames remembered that it's because there's no way to specify that a feature is a node or a link if we have them together. We discussed it in this issue

@duncandewhurst
Copy link
Contributor

On reflection, I would prefer it if we can put the conversion script in a standalone repository similar to OCDS Kit and using Click. That can then be used as a library by lib-cove-ofds.

I think that makes sense as it is the same was we do spreadsheet conversion - Flatten Tool is in a separate repository.

Also, I think it will make maintenance and adding new commands easier. I find it really easy to contribute to the OCDS Kit codebase but I have no idea how to contribute to the lib-cove codebase.

@ghost
Copy link
Author

ghost commented Oct 20, 2022

I find it really easy to contribute to the OCDS Kit codebase but I have no idea how to contribute to the lib-cove codebase.

I want to unpack this more later, this shouldn't be and also I suspect you might think the way we need to use click is complicated. (having a strong python API between click and the code that does the actual work, this is needed so other python libraries can reuse. This is something I've tried to put into OCDSKit when working on it)

That said, I don't have strongly held views on this so in the interests on just getting on with it I'm happy to start OFDSKit.

@ghost ghost transferred this issue from Open-Telecoms-Data/lib-cove-ofds Oct 20, 2022
@duncandewhurst
Copy link
Contributor

Thanks! Happy to discuss how we can make contributing easier (elsewhere, I guess) but will log here that these instructions certainly help: https://ocdskit.readthedocs.io/en/latest/contributing.html#adding-a-command

@ghost
Copy link
Author

ghost commented Oct 25, 2022

If GeoJSON has inconsistent dereferenced data, raise an error and don't continue.

@ghost
Copy link
Author

ghost commented Nov 7, 2022

I'm going to say this is basically done once next PR has been merged in. I've spun other issues off to allow them to be prioritised / actioned separately. Any small details could be handled in new small issues as they are discovered!

ghost pushed a commit that referenced this issue Nov 7, 2022
ghost pushed a commit that referenced this issue Nov 7, 2022
@duncandewhurst
Copy link
Contributor

Closing in favour of Open-Telecoms-Data/cove-ofds#5, which has some issues that need resolving.

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

No branches or pull requests

2 participants