kartoza / gfdrr_oondra

GFDRR Challenge Online Operational Natural Disaster Risk Assessment platform
0 stars 3 forks source link

Improve geonode metadata in database #30

Closed NyakudyaA closed 7 years ago

NyakudyaA commented 8 years ago

Problem

When uploading a layer without specifying the preserve metadata tag. The inasafe keywords cannot be added to the geonode ui because the inasafe keywords are xml encoded with tags. The metadata record is uploaded to the postgres database base_resourcebase.

Example: `

    <inasafe>
      <population_field>
        <gco:CharacterString/>
      </population_field>`

Solution

Allow geonode ui to upload supplementary keywords as xml tags. This mean we need to find ways of inserting xml tags into the database table or strip inasafe keywords tags properly so that they can be inserted into the database table

gubuntu commented 7 years ago

@nyakudya please clean up your description, it's hard to follow. This needs to go upstream to the Geonode project, which @lucernae can do

lucernae commented 7 years ago

@NyakudyaA the fastest way to do something like this is for now is to strip inasafe keywords tags and insert it to supplementalInformation using Geonode's Edit Layer UI (click the layers > Edit Layers > Edit Metadata > Supplemental Information). However this string will be escaped, so I need to do another preprocess to insert it to GeoSAFE. But with this, I would be able to easily find that InaSAFE metadata (which is in supplementalInformation and can be extracted via CSW). The ideal solutions would be by doing modification in InaSAFE so that its keywords fully conforms GMD ISO Metadata, and I think now understand the real problem after exploring some metadata stuffs. But I need to read more about the standard. I suggests for now we put InaSAFE keywords in supplemental information using Geonode's UI even if it will be escaped.

NyakudyaA commented 7 years ago

@lucernae I have written database triggers to correct the special characters that are inserted into the metadata record. If we go ahead with it we will return metadata that is properly formated and this would mean some code in geosafe needs to match this. This helps us when using metadata in QGIS. metadata

lucernae commented 7 years ago

I would say to go with it. So, I will change the code in GeoSAFE if you already made changes to oondra.

gubuntu commented 7 years ago

I don't think database triggers are a good long term solution unless they are scripted into the oondra deployment repo.

gubuntu commented 7 years ago

This issue was moved to kartoza/geonode#269