inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 87 forks source link

serializer: Add mapping from geojson polygon to datacite geoLocationBox #1026

Closed tmorrell closed 7 months ago

tmorrell commented 2 years ago

Is your feature request related to a problem? Please describe.

Add mapping from geojson polygon to DataCite geoLocationBox. The current API accepts geojson polygons, but these do not get serialized to datacite geoLocationBox.

Describe the solution you'd like

Code should be added at:

https://github.com/inveniosoftware/invenio-rdm-records/blob/f8fd99726e4dacb638b5dded764f32828c3e729e/invenio_rdm_records/resources/serializers/datacite/schema.py#L376

Expected transformation:

          "geometry": {
            "coordinates": [
              [
                [
                -105.92,
                  33.17,
                ],
                [
                -106.0,
                  33.17
                ],
                [
                   -106.0,
                  33.0
                ],
                [
                  -105.92,
                  33.0
                ],
                [
                  -105.92,
                  33.17
                ]
              ]
            ],
            "type": "Polygon"
          }
'geoLocationBox': {'eastBoundLongitude': '-105.92',
                                            'northBoundLatitude': '33.17',
                                            'southBoundLatitude': '33.0',
                                            'westBoundLongitude': '-106.0'}
github-actions[bot] commented 1 year ago

This issue was automatically marked as stale.