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

Indexing / Bounding Polygon / Reproject if needed #7340

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

Namascae
Copy link
Contributor

Fix for #6955

@fxprunayre fxprunayre changed the title fix(fao): conversion between gml to geojson Indexing / Bounding Polygon / Reproject if needed Sep 27, 2023
@fxprunayre fxprunayre added this to the 4.4.0 milestone Sep 27, 2023
@fxprunayre fxprunayre merged commit 2d8e711 into geonetwork:main Sep 27, 2023
@josegar74
Copy link
Member

I've tested a polygon:

<gml:MultiSurface xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink" gml:id="d4076e275" srsName="urn:ogc:def:crs:EPSG:6.6:4326">
    <gml:surfaceMember>
        <gml:Polygon gml:id="d4076e277" srsName="urn:ogc:def:crs:EPSG:6.6:4326">
            <gml:exterior>
                <gml:LinearRing>
                    <gml:posList srsDimension="2">24.47116421995193 -26.36779052315607 5.527160033376219 -10.633710334476831 6.243369907068981 41.572416380789036 20.094587041392174 41.19974807032591 25.661911015886105 -7.601709905660341 24.47116421995193 -26.36779052315607</gml:posList>
                </gml:LinearRing>
            </gml:exterior>
        </gml:Polygon>
    </gml:surfaceMember>
</gml:MultiSurface>

The geometry after parsing the GML:

MULTIPOLYGON (((24.47116421995193 -26.36779052315607, 5.527160033376219 -10.633710334476831, 6.243369907068981 41.572416380789036, 20.094587041392174 41.19974807032591, 25.661911015886105 -7.601709905660341, 24.47116421995193 -26.36779052315607)))

The geometry after the transform:

MULTIPOLYGON (((-26.36779052315607 24.47116421995193, -10.633710334476831 5.527160033376219, 41.572416380789036 6.243369907068981, 41.19974807032591 20.094587041392174, -7.601709905660341 25.661911015886105, -26.36779052315607 24.47116421995193)))

Axis order is switched. We need to confirm if that is correctly indexed in ElasticSearch.

fxprunayre added a commit that referenced this pull request Sep 27, 2023
Follow up of #7340

Clarify coordinate order for geo_shape field: 
"In GeoJSON and WKT, and therefore Elasticsearch, the correct coordinate order is longitude, latitude (X, Y) within coordinate arrays. This differs from many Geospatial APIs (e.g., Google Maps) that generally use the colloquial latitude, longitude (Y, X)."

Test :
* https://www.geocat.ch/geonetwork/srv/api/records/78a41177-6125-4f11-ac8b-4ec6166dad70/formatters/iso19139?output=xml
* check coordinate order in default view (advanced view is fine because base on the XML)
josegar74 pushed a commit that referenced this pull request Sep 27, 2023
Follow up of #7340

Clarify coordinate order for geo_shape field: 
"In GeoJSON and WKT, and therefore Elasticsearch, the correct coordinate order is longitude, latitude (X, Y) within coordinate arrays. This differs from many Geospatial APIs (e.g., Google Maps) that generally use the colloquial latitude, longitude (Y, X)."

Test :
* https://www.geocat.ch/geonetwork/srv/api/records/78a41177-6125-4f11-ac8b-4ec6166dad70/formatters/iso19139?output=xml
* check coordinate order in default view (advanced view is fine because base on the XML)
josegar74 pushed a commit that referenced this pull request Sep 27, 2023
Follow up of #7340

Clarify coordinate order for geo_shape field:
"In GeoJSON and WKT, and therefore Elasticsearch, the correct coordinate order is longitude, latitude (X, Y) within coordinate arrays. This differs from many Geospatial APIs (e.g., Google Maps) that generally use the colloquial latitude, longitude (Y, X)."

Test :
* https://www.geocat.ch/geonetwork/srv/api/records/78a41177-6125-4f11-ac8b-4ec6166dad70/formatters/iso19139?output=xml
* check coordinate order in default view (advanced view is fine because base on the XML)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants