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

parse xml metadata to identify ogc layers #12

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Conversation

mki-c2c
Copy link
Contributor

@mki-c2c mki-c2c commented Jan 24, 2025

No description provided.



class Meta:
def __init__(self, zipfile: bytes):
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make 2 init class depending on which format we use (from xml for from mef zip)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, good idea.
there will be more functionalities with the zip file, but there is also common stuff like layer parsing

dr = DictReader(StringIO(zip_properties), delimiter=";")
self.properties = next(dr)

self.xml_bytes = zf.read(f"{self.properties['uuid']}/metadata/metadata.xml")
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure this is a static name file,
it is depending of the iso schema used
exemple :
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the default metadata can be found at this (static path), additionnally, the othe format may be added as a suffix

Copy link
Contributor

Choose a reason for hiding this comment

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

actually it is depending on the default format, for example
is there is only iso19139 it will have only one file name medatada.xml
but if there is both iso 19139 and 19115 there will be two files matedata-iso19139 and metadata (from my sample) but it might be the opposite

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as far as I understand, the default schema is defined in the schema column of index.csv. The metadata corresponding to this default format will be called metadata.xml, there may be additional xml files with suffix in other formats and can be ignorer.
But we know, that metadata.xml is in the format given by index.csv.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should ignore other format if we want to make a real copy
but yes true the default is in index.csv

Copy link
Contributor Author

Choose a reason for hiding this comment

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

everything will be copied, the default format is just used for parsing the layers since we can be sure that it exists


self.xml_bytes = zf.read(f"{self.properties['uuid']}/metadata/metadata.xml")

schema = self.properties.get("schema", "iso19139")
Copy link
Contributor

Choose a reason for hiding this comment

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

schema is not "static"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is read from the csv file, which should have a 'schema' column/ Do you think this is not reliable ?

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess yes it is reliable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@@ -32,6 +32,8 @@ services:
volumes:
- ./backend:/app
- georchestra_datadir:/etc/georchestra
environment:
- LOCAL_LOGIN=admin
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see it use anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I think this goes with the other PR

@mki-c2c mki-c2c merged commit caf8947 into main Jan 28, 2025
3 checks passed
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