Skip to content

Fix coordinates deserialization errors

Rustam Lotsmanenko (EPAM) requested to merge fix-position-deserealization into master

Description:

Issue: #63 (closed)

There is a bug related to the deserialization of such geodata as MultiLineString, MultiPoint, LineString, MultiPolygon whenever such type of geodata contains altitude, deserialization does not work correctly in various ways. As a fix, we suggest deserializing coordinates for those types explicitly, taking into account the level of nesting of those coordinates.

How to test:

Functionality was tested via unit tests, and record index requests, after fixing records that contain geodata MultiLineString, MultiPoint, LineString, MultiPolygon with `altitude' becomes searchable:

curl --location --request POST 'https://preship.gcp.gnrg-osdu.projects.epam.com/api/search/v2/query' \
--header 'data-partition-id: odesprod' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer' \
--data-raw '{
    "kind": "odesprod:wks:master-data--Wellbore:1.0.0",
    "query": "id:\"odesprod:master-data--Wellbore:5May3Dimplicit\""
}'
{
    "results": [
        {
            "data": {
                "GeographicBottomHoleLocation.SpatialParameterTypeID": null,
                "GeographicBottomHoleLocation.CoordinateQualityCheckPerformedBy": null,
                "ResourceLifecycleStatus": null,
                "TargetFormation": null,
                "DefaultVerticalMeasurementID": "Measured_From",
                "SpatialLocation.Wgs84Coordinates": {
                    "geometries": [
                        {
                            "coordinates": [
                                [
                                    34.51305348816962,
                                    0.035298719063461145,
                                    7.0
                                ],
                                [
                                    34.513062650895186,
                                    0.030790856372375844,
                                    7.0
                                ],
                                [
                                    34.513071785973196,
                                    0.0262829935696415,
                                    7.0
                                ]
                            ],
                            "type": "linestring"
                        }
                    ],
                    "type": "geometrycollection"
                },
....

Changes include:

  • Bugfix (a non-breaking change that solves an issue).

Changes in:

  • Common code

Dev Checklist:

  • Added Unit Tests, wherever applicable.
  • Updated the Readme, if applicable.
  • Existing Tests pass
  • Verified functionality locally
  • Self Reviewed my code for formatting and complex business logic.
Edited by Rustam Lotsmanenko (EPAM)

Merge request reports