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

Geo: Add GeoJson parser to libs/geo classes #41575

Merged
merged 6 commits into from
Apr 29, 2019

Conversation

imotov
Copy link
Contributor

@imotov imotov commented Apr 26, 2019

Adds GeoJson parser for Geometry classes defined in libs/geo. This
should allow us to bypass ShapeBuilders in geosql and is the first
step in ShapeBuilder refactoring. The provided functionality should
be sufficient for geosql parsing, but additional functionality will
be required for complete parity with ShapeBuilder parser - we need
to add handling of mapper parameters in WKT parser as well. That
will be added in a follow up PR.

Relates #40908 and #29872

Adds GeoJson parser for Geometry classes defined in libs/geo. This
should allow us to bypass ShapeBuilders in geosql and is the first
step in ShapeBuilder refactoring. The provided functionality should
be sufficient for geosql parsing, but additional functionality will
be required for complete parity with ShapeBuilder parser - we need
to add handling of mapper parameters in WKT parser as well. That
will be added in a follow up PR.

Relates elastic#40908
@imotov imotov added :Analytics/Geo Indexing, search aggregations of geo points and shapes >refactoring v8.0.0 v7.2.0 labels Apr 26, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@imotov
Copy link
Contributor Author

imotov commented Apr 26, 2019

@elasticmachine run elasticsearch-ci/1

1 similar comment
@imotov
Copy link
Contributor Author

imotov commented Apr 26, 2019

@elasticmachine run elasticsearch-ci/1

@imotov imotov requested a review from talevy April 26, 2019 17:18
Copy link
Contributor

@talevy talevy left a comment

Choose a reason for hiding this comment

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

overall looks good. I am still digging through the tests :)

@@ -33,4 +35,8 @@
LINEARRING, // not serialized by itself in WKT or WKB
ENVELOPE, // not part of the actual WKB spec
CIRCLE; // not part of the actual WKB spec

public static ShapeType forName(String geoshapename) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we camelCase that variable name?


@Override
public String visit(LinearRing ring) {
throw new UnsupportedOperationException("line ring cannot be serialized using GeoJson");
Copy link
Contributor

Choose a reason for hiding this comment

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

s/line ring/linearRing?

/**
* Parses supplied XContent into Geometry
*/
static Geometry parse(XContentParser parser, BaseGeoShapeFieldMapper shapeMapper) throws IOException, ParseException {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to remove the dependency on a field mapper here. maybe require the three attributes explicitly

@imotov imotov merged commit 6d3fd84 into elastic:master Apr 29, 2019
imotov added a commit to imotov/elasticsearch that referenced this pull request Apr 29, 2019
Adds GeoJson parser for Geometry classes defined in libs/geo.

Relates elastic#40908 and elastic#29872
imotov added a commit that referenced this pull request Apr 29, 2019
Adds GeoJson parser for Geometry classes defined in libs/geo.

Relates #40908 and #29872
akhil10x5 pushed a commit to akhil10x5/elasticsearch that referenced this pull request May 2, 2019
Adds GeoJson parser for Geometry classes defined in libs/geo.

Relates elastic#40908 and elastic#29872
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
Adds GeoJson parser for Geometry classes defined in libs/geo.

Relates elastic#40908 and elastic#29872
@imotov imotov deleted the issue-40908-add-libs-geo-geojson-parser branch May 1, 2020 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >refactoring v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants