55++++ 
66
77The `geo_shape` data type facilitates the indexing of and searching
8- with arbitrary geo shapes  such as rectangles and polygons. It should be
8+ with arbitrary geoshapes  such as rectangles and polygons. It should be
99used when either the data being indexed or the queries being executed
1010contain shapes other than just points.
1111
@@ -98,7 +98,7 @@ greater false positives. Note: This parameter is only relevant for `term` and
9898
9999|`orientation`
100100a|Optional. Default <<polygon-orientation,orientation>> for the field's
101- polygons.
101+ WKT  polygons.
102102
103103This parameter sets and returns only a `RIGHT` (counterclockwise) or `LEFT`
104104(clockwise) value. However, you can specify either value in multiple ways.
@@ -147,7 +147,7 @@ and reject the whole document.
147147[[geoshape-indexing-approach]]
148148[discrete]
149149==== Indexing approach
150- GeoShape  types are indexed by decomposing the shape into a triangular mesh and
150+ Geoshape  types are indexed by decomposing the shape into a triangular mesh and
151151indexing each triangle as a 7 dimension point in a BKD tree. This provides
152152near perfect spatial resolution (down to 1e-7 decimal degree precision) since all
153153spatial relations are computed using an encoded vector representation of the
@@ -332,7 +332,7 @@ API. The following is an example of a point in GeoJSON.
332332POST /example/_doc 
333333{ 
334334  "location" : { 
335-     "type" : "point ", 
335+     "type" : "Point ", 
336336    "coordinates" : [-77.03653, 38.897676] 
337337  } 
338338} 
@@ -352,23 +352,23 @@ POST /example/_doc
352352[[geo-linestring]]
353353===== http://geojson.org/geojson-spec.html#id3[LineString]
354354
355- A ` linestring`  defined by an array of two or more positions. By
356- specifying only two points, the ` linestring`  will represent a straight
355+ A linestring defined by an array of two or more positions. By
356+ specifying only two points, the linestring will represent a straight
357357line. Specifying more than two points creates an arbitrary path. The
358- following is an example of a LineString  in GeoJSON.
358+ following is an example of a linestring  in GeoJSON.
359359
360360[source,console]
361361-------------------------------------------------- 
362362POST /example/_doc 
363363{ 
364364  "location" : { 
365-     "type" : "linestring ", 
365+     "type" : "LineString ", 
366366    "coordinates" : [[-77.03653, 38.897676], [-77.009051, 38.889939]] 
367367  } 
368368} 
369369-------------------------------------------------- 
370370
371- The following is an example of a LineString  in WKT:
371+ The following is an example of a linestring  in WKT:
372372
373373[source,console]
374374-------------------------------------------------- 
@@ -378,7 +378,7 @@ POST /example/_doc
378378} 
379379-------------------------------------------------- 
380380
381- The above ` linestring`  would draw a straight line starting at the White
381+ The above linestring would draw a straight line starting at the White
382382House to the US Capitol Building.
383383
384384[discrete]
@@ -387,22 +387,22 @@ House to the US Capitol Building.
387387
388388A polygon is defined by a list of a list of points. The first and last
389389points in each (outer) list must be the same (the polygon must be
390- closed). The following is an example of a Polygon  in GeoJSON.
390+ closed). The following is an example of a polygon  in GeoJSON.
391391
392392[source,console]
393393-------------------------------------------------- 
394394POST /example/_doc 
395395{ 
396396  "location" : { 
397-     "type" : "polygon ", 
397+     "type" : "Polygon ", 
398398    "coordinates" : [ 
399399      [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] 
400400    ] 
401401  } 
402402} 
403403-------------------------------------------------- 
404404
405- The following is an example of a Polygon  in WKT:
405+ The following is an example of a polygon  in WKT:
406406
407407[source,console]
408408-------------------------------------------------- 
@@ -421,7 +421,7 @@ of a polygon with a hole:
421421POST /example/_doc 
422422{ 
423423  "location" : { 
424-     "type" : "polygon ", 
424+     "type" : "Polygon ", 
425425    "coordinates" : [ 
426426      [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], 
427427      [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ] 
@@ -430,7 +430,7 @@ POST /example/_doc
430430} 
431431-------------------------------------------------- 
432432
433- The following is an example of a Polygon  with a hole in WKT:
433+ The following is an example of a polygon  with a hole in WKT:
434434
435435[source,console]
436436-------------------------------------------------- 
@@ -445,22 +445,29 @@ POST /example/_doc
445445===== Polygon orientation
446446
447447A polygon's orientation indicates the order of its vertices: `RIGHT`
448- (counterclockwise) or `LEFT` (clockwise).
448+ (counterclockwise) or `LEFT` (clockwise). {es} uses a polygon’s orientation to
449+ determine if it crosses the international dateline (+/-180° longitude). 
449450
450- You can set a default orientation for a `geo_shape` field using the
451- <<geo-shape-mapping-options,`orientation` mapping parameter>>. You can override
452- this default for specific polygons using the document-level `orientation`
453- parameter.
451+ You can set a default orientation for WKT polygons using the
452+ <<geo-shape-mapping-options,`orientation` mapping parameter>>. This is because
453+ the WKT specification doesn't specify or enforce a default orientation.
454454
455- For example, the following indexing request specifies a document-level
456- `orientation` of `LEFT`.
455+ GeoJSON polygons use a default orientation of `RIGHT`, regardless of
456+ `orientation` mapping parameter's value. This is because the
457+ https://tools.ietf.org/html/rfc7946#section-3.1.6[GeoJSON specification]
458+ mandates that an outer polygon use a counterclockwise orientation and interior
459+ shapes use a clockwise orientation.
460+ 
461+ You can override the default orientation for GeoJSON polygons using the
462+ document-level `orientation` parameter. For example, the following indexing
463+ request specifies a document-level `orientation` of `LEFT`.
457464
458465[source,console]
459466---- 
460467POST /example/_doc 
461468{ 
462469  "location" : { 
463-     "type" : "polygon ", 
470+     "type" : "Polygon ", 
464471    "orientation" : "LEFT", 
465472    "coordinates" : [ 
466473      [ [-177.0, 10.0], [176.0, 15.0], [172.0, 0.0], [176.0, -15.0], [-177.0, -10.0], [-177.0, 10.0] ] 
@@ -470,15 +477,15 @@ POST /example/_doc
470477---- 
471478
472479{es} only uses a polygon’s orientation to determine if it crosses the
473- international dateline (+/-180° longitude) . If the difference between a
474- polygon’s minimum longitude  and the maximum longitude is less than 180°, the
475- polygon doesn't cross the  dateline and its orientation has no effect.
480+ international dateline. If the difference between a polygon’s minimum longitude 
481+ and the maximum longitude is less than 180°, the polygon doesn't cross  the
482+ dateline and its orientation has no effect.
476483
477484If the difference between a polygon’s minimum longitude and the maximum
478485longitude is 180° or greater, {es} checks whether the polygon's document-level
479- `orientation` differs from the default in  the ` orientation` mapping parameter. 
480- If the orientation differs,  {es} considers the polygon to cross the
481- international dateline and splits the  polygon at the dateline.
486+ `orientation` differs from the default orientation. If  the orientation differs, 
487+ {es} considers the polygon to cross the international dateline and splits  the
488+ polygon at the dateline.
482489
483490[discrete]
484491[[geo-multipoint]]
@@ -491,7 +498,7 @@ The following is an example of a list of GeoJSON points:
491498POST /example/_doc 
492499{ 
493500  "location" : { 
494-     "type" : "multipoint ", 
501+     "type" : "MultiPoint ", 
495502    "coordinates" : [ 
496503      [102.0, 2.0], [103.0, 2.0] 
497504    ] 
@@ -520,7 +527,7 @@ The following is an example of a list of GeoJSON linestrings:
520527POST /example/_doc 
521528{ 
522529  "location" : { 
523-     "type" : "multilinestring ", 
530+     "type" : "MultiLineString ", 
524531    "coordinates" : [ 
525532      [ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0] ], 
526533      [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0] ], 
@@ -551,7 +558,7 @@ The following is an example of a list of GeoJSON polygons (second polygon contai
551558POST /example/_doc 
552559{ 
553560  "location" : { 
554-     "type" : "multipolygon ", 
561+     "type" : "MultiPolygon ", 
555562    "coordinates" : [ 
556563      [ [[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]] ], 
557564      [ [[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], 
@@ -582,14 +589,14 @@ The following is an example of a collection of GeoJSON geometry objects:
582589POST /example/_doc 
583590{ 
584591  "location" : { 
585-     "type": "geometrycollection ", 
592+     "type": "GeometryCollection ", 
586593    "geometries": [ 
587594      { 
588-         "type": "point ", 
595+         "type": "Point ", 
589596        "coordinates": [100.0, 0.0] 
590597      }, 
591598      { 
592-         "type": "linestring ", 
599+         "type": "LineString ", 
593600        "coordinates": [ [101.0, 0.0], [102.0, 1.0] ] 
594601      } 
595602    ] 
0 commit comments