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

Change GeoJSON to be used for f=json, add f=elastic-json for old format #119

Merged
merged 5 commits into from
Oct 23, 2024

Conversation

davidblasby
Copy link
Contributor

@davidblasby davidblasby commented Oct 22, 2024

The OGCAPI-Records spec says to use GeoJSON for /collections/<collectionId>/items and /collections/<collectionId>/items/<itemId> responses.

This PR changes the current default (the underlying Elastic Search results) and, instead, uses GeoJSON.

I've also added a f=elastic-json for the old behaviour. This shouldn't be used, and will be removes in the future. However, I don't want to remove it now since people might be relying on it, and its useful for debugging.

Also, see #118 for improvements to the GeoJSON output.

@davidblasby
Copy link
Contributor Author

@josegar74 @fxprunayre - I will merge this thursday (after the geojson changes).

@@ -55,5 +58,6 @@ public GnMediaType(String type) {
APPLICATION_GN_XML = new MediaType("application", "gn+xml");
APPLICATION_JSON_LD = new MediaType("application", "ld+json");
APPLICATION_GEOJSON = new MediaType("application", "geo+json");
APPLICATION_ELASTICJSON = new MediaType("application", "elastic+json");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
APPLICATION_ELASTICJSON = new MediaType("application", "elastic+json");
APPLICATION_ELASTICJSON = new MediaType("application", "gnindex+json");

maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @fxprunayre - I've changed it to "gnindex+json".

Thanks for the review - its really really helpful!

@davidblasby davidblasby merged commit 266cf36 into geonetwork:main Oct 23, 2024
1 check passed
Copy link

sonarcloud bot commented Oct 23, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants