-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
WKT and GeoJSON's shape types need proper capitalization #49568
Comments
Pinging @elastic/es-analytics-geo (:Analytics/Geo) |
Switches generated WKT to upper case to conform to the stanard recommendation. Relates elastic#49568
Switches generated WKT to upper case to conform to the standard recommendation. Relates #49568
Switches generated WKT to upper case to conform to the standard recommendation. Relates #49568
Switches generated WKT to upper case to conform to the standard recommendation. Closes elastic#49568
Switches generated GeoJson type names to camel case to conform to the standard. Closes #49568
Switches generated WKT to upper case to conform to the standard recommendation. Relates elastic#49568
elastic#50400) Switches generated GeoJson type names to camel case to conform to the standard. Closes elastic#49568
Is this really fixed? "hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 8.791588,
"hits": [{
"_index": "spatial_simplified_0.001_ogrimport_precision_ms",
"_type": "_doc",
"_id": "jE3kVH4BJtEXbncSuIz8",
"_score": 8.791588,
"_source": {
"ogc_fid": 205,
"geometry": {
"type": "multipolygon",
"coordinates": [
[
[
[-7.431,
4.351
],
[-7.442,
4.348
],
[-7.466,
4.345
],
[-7.498,
4.347
],
...
[
...
]
]
]
]
}
}
}]
} |
Yes, this is fixed but you need to understand that this only works on generated geojson not in the geojson that you give to Elasticsearch. To explain that let's look at the following example. First we create an index:
When ingesting for example GeoJson, Elasticsearch is relax on the captilization of the geometry and accepts any. For example we ingest the following 4 points with different upper and lower case for
The four points are ingested successfully and if we retrieve the documents using the default fetch strategy what Elasticsearch is doing is to return the original documents and therefore the original capitalisation:
This is what you are seeing. If we change the strategy and use the recently added fields API, then we are asking Elasticsearch to generate the Geojson and therefore it comes with standard capitalisation:
Hope this helps. |
Thank you very much for clearing this up, this really helps! Do you know if the default Kibana strategy uses the Thanks again! :) |
|
Oh sorry, I was very unspecific right there. I didn't mean the maps application but rather the standard search that is conducted using the search bar in the "discover" function. Because the results there seem to be correct (capitalized). Nonetheless, I will have a look if my Spring Boot backend & the ElasticsearchRepository can adapt to the fields API in this purpose of retrieving GeoJSONs. Thank you Ignacio! |
situation
Elasticsearch's WKT and GeoJSON writers lowercase a shape's type.
So WKT's
POINT
is written aspoint
, and GeoJSON'sPoint
is writtenas
point
. The specs for these formats explicitly define proper capitalizationrules.
Another point: Elasticsearch's parsers are case-insensitive... need to determine
whether that is OK to keep.
The only place that this seems to be a user-facing problem is with the
Circle Processor:
GeoJSON Spec
link: https://tools.ietf.org/html/rfc7946
WKT Spec
link: http://docs.opengeospatial.org/is/18-010r7/18-010r7.html
Proposed Fix
To adhere to the GeoJSON spec, it is important that proper capitalization
of the geometry types are used. The WKT spec is flexible, but since it is
common practice to capitalize the types for human-readability, it would be
nice to capitalize them in WKT as well.
The text was updated successfully, but these errors were encountered: