Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/ingest/processors/circle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The response from the above index request:
[30.000365257263184, 10.0]
]
],
"type": "polygon"
"type": "Polygon"
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions server/src/main/java/org/elasticsearch/common/geo/GeoJson.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,17 @@ public static String getGeoJsonName(Geometry geometry) {
return geometry.visit(new GeometryVisitor<>() {
@Override
public String visit(Circle circle) {
return "circle";
return "Circle";
}

@Override
public String visit(GeometryCollection<?> collection) {
return "geometrycollection";
return "GeometryCollection";
}

@Override
public String visit(Line line) {
return "linestring";
return "LineString";
}

@Override
Expand All @@ -402,32 +402,32 @@ public String visit(LinearRing ring) {

@Override
public String visit(MultiLine multiLine) {
return "multilinestring";
return "MultiLineString";
}

@Override
public String visit(MultiPoint multiPoint) {
return "multipoint";
return "MultiPoint";
}

@Override
public String visit(MultiPolygon multiPolygon) {
return "multipolygon";
return "MultiPolygon";
}

@Override
public String visit(Point point) {
return "point";
return "Point";
}

@Override
public String visit(Polygon polygon) {
return "polygon";
return "Polygon";
}

@Override
public String visit(Rectangle rectangle) {
return "envelope";
return "Envelope";
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void testGeoJsonParsing() throws Exception {
assertEquals(new Point(100, 0), format.fromXContent(parser));
XContentBuilder newGeoJson = XContentFactory.jsonBuilder();
format.toXContent(new Point(100, 10), newGeoJson, ToXContent.EMPTY_PARAMS);
assertEquals("{\"type\":\"point\",\"coordinates\":[100.0,10.0]}", Strings.toString(newGeoJson));
assertEquals("{\"type\":\"Point\",\"coordinates\":[100.0,10.0]}", Strings.toString(newGeoJson));
}

XContentBuilder pointGeoJsonWithZ = XContentFactory.jsonBuilder()
Expand Down Expand Up @@ -148,7 +148,7 @@ public void testNullParsing() throws Exception {
// if we serialize non-null value - it should be serialized as geojson
format.toXContent(new Point(100, 10), newGeoJson, ToXContent.EMPTY_PARAMS);
newGeoJson.endObject();
assertEquals("{\"val\":{\"type\":\"point\",\"coordinates\":[100.0,10.0]}}", Strings.toString(newGeoJson));
assertEquals("{\"val\":{\"type\":\"Point\",\"coordinates\":[100.0,10.0]}}", Strings.toString(newGeoJson));

newGeoJson = XContentFactory.jsonBuilder().startObject().field("val");
format.toXContent(null, newGeoJson, ToXContent.EMPTY_PARAMS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void testFromJson() throws IOException {
" \"geo_shape\" : {\n" +
" \"location\" : {\n" +
" \"shape\" : {\n" +
" \"type\" : \"envelope\",\n" +
" \"type\" : \"Envelope\",\n" +
" \"coordinates\" : [ [ 13.0, 53.0 ], [ 14.0, 52.0 ] ]\n" +
" },\n" +
" \"relation\" : \"intersects\"\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void testFromJson() throws IOException {
" }\n" +
"}";
ShapeQueryBuilder parsed = (ShapeQueryBuilder) parseQuery(json);
checkGeneratedJson(json, parsed);
checkGeneratedJson(json.replaceAll("envelope", "Envelope"), parsed);
assertEquals(json, 42.0, parsed.boost(), 0.0001);
}

Expand Down