You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If I upload a metadata XML (like ISO-19139) file as document the metadata should be used to prefill the GeoNode fields just like using a metadata XML file alongside a shapefile.
Describe the solution you'd like
The metadata XML parsing is already implemented for layer uploads. The used code and methods can be found here:
This will work but is not the solution I would like!
A better option is to refactor the XML parsing and move the code to the base model since the ResourceBase model does provide all metadata fields for all its child (Layer, Document, App, Map). The whole metadata.py file should move to https://github.com/GeoNode/geonode/tree/master/geonode/base.
Describe alternatives you've considered
I took a look at replicating the XML parsing code for documents and think it will be almost identical. Better to improve the generic metadata parsing and maybe use some conditionals in there to make special stuff happen for documents / layers instead of not being DRY.
Additional context
If the Documents API will enable uploads in the future this feature can be used to create a 'harvesting' like CSW ingestion of metadata.
The text was updated successfully, but these errors were encountered:
We at Thünen do use this. To get the code 'upstream ready' I would have to rewrite and refactor most of it. If this Feature Request is of general interest we can work on that.
Is your feature request related to a problem? Please describe.
If I upload a metadata XML (like ISO-19139) file as document the metadata should be used to prefill the GeoNode fields just like using a metadata XML file alongside a shapefile.
Describe the solution you'd like
The metadata XML parsing is already implemented for layer uploads. The used code and methods can be found here:
https://github.com/GeoNode/geonode/blob/master/geonode/layers/metadata.py#L40
Just to have a proof of concept I hacked the above implementation into the current document views.py:
views.py.diff.txt
This will work but is not the solution I would like!
A better option is to refactor the XML parsing and move the code to the base model since the ResourceBase model does provide all metadata fields for all its child (Layer, Document, App, Map). The whole metadata.py file should move to https://github.com/GeoNode/geonode/tree/master/geonode/base.
Describe alternatives you've considered
I took a look at replicating the XML parsing code for documents and think it will be almost identical. Better to improve the generic metadata parsing and maybe use some conditionals in there to make special stuff happen for documents / layers instead of not being DRY.
Additional context
If the Documents API will enable uploads in the future this feature can be used to create a 'harvesting' like CSW ingestion of metadata.
The text was updated successfully, but these errors were encountered: