Commit d61431e
authored
Add support for geo_shape represented as Well-Known Text (WKT) (#3377)
* Add support for well known text (wkt) to geo bounding box queries
* Move geo_shape queries into Tests project
This commit moves the geo_shape queries into the Test project.
Missed in the Tests refactoring
* Add support for Z values to GeoCoordinate
* Add support for WKT geo shapes
This commit adds support for Well-Known Text (WKT) representations
of geo_shape. The extent of the implementation is only as far as is
required by the WKT support in Elasticsearch.
Deserialize from WKT to IGeoShape types. The format from which
the shape is deserialized is assigned to an internal format property
on the concrete implementations of GeoShape as the intention is
not to expose this as a property on the IGeoShape interface. The format
is assigned to the instance so that the IGeoShape instance is
serialized to the same format if indexed again.
GeoWKTReader is a simple tokenizer implementation
for the purposes of parsing only WKT concepts that are supported
by Elasticsearch.
GeoShapeConverter now implements WriteJson because the
original format of IGeoShape now needs to be taken into account
when serializing.
Add tests for roundtrip serialization of WKT.
Closes #32561 parent 5bf648b commit d61431e
File tree
25 files changed
+1602
-207
lines changed- src
- Nest/QueryDsl/Geo
- BoundingBox
- Shape
- GeometryCollection
- WKT
- Tests
- QueryDsl/Geo
- Tests/QueryDsl/Geo
- BoundingBox
- Shape
- Circle
- Envelope
- GeometryCollection
- IndexedShape
- LineString
- MultiLineString
- MultiPoint
- MultiPolygon
- Point
- Polygon
25 files changed
+1602
-207
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
25 | 30 | | |
26 | | - | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | | - | |
| 37 | + | |
34 | 38 | | |
35 | | - | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
29 | 38 | | |
30 | 39 | | |
31 | | - | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | | - | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
139 | 151 | | |
140 | 152 | | |
141 | 153 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
148 | 167 | | |
149 | 168 | | |
150 | 169 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
27 | 49 | | |
28 | 50 | | |
| 51 | + | |
| 52 | + | |
29 | 53 | | |
30 | 54 | | |
31 | 55 | | |
| |||
38 | 62 | | |
39 | 63 | | |
40 | 64 | | |
41 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
42 | 72 | | |
43 | | - | |
44 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
45 | 135 | | |
46 | 136 | | |
47 | 137 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
53 | 148 | | |
54 | 149 | | |
55 | 150 | | |
56 | 151 | | |
57 | | - | |
58 | | - | |
| 152 | + | |
59 | 153 | | |
60 | 154 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
65 | 158 | | |
66 | | - | |
| 159 | + | |
67 | 160 | | |
68 | | - | |
| 161 | + | |
69 | 162 | | |
70 | | - | |
| 163 | + | |
71 | 164 | | |
72 | | - | |
| 165 | + | |
73 | 166 | | |
74 | | - | |
| 167 | + | |
75 | 168 | | |
76 | | - | |
| 169 | + | |
77 | 170 | | |
78 | | - | |
| 171 | + | |
79 | 172 | | |
80 | 173 | | |
81 | 174 | | |
82 | 175 | | |
83 | 176 | | |
84 | 177 | | |
85 | | - | |
86 | | - | |
| 178 | + | |
| 179 | + | |
87 | 180 | | |
88 | 181 | | |
89 | 182 | | |
| |||
128 | 221 | | |
129 | 222 | | |
130 | 223 | | |
131 | | - | |
| 224 | + | |
132 | 225 | | |
133 | 226 | | |
134 | 227 | | |
135 | | - | |
| 228 | + | |
136 | 229 | | |
137 | 230 | | |
138 | 231 | | |
| |||
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
107 | | - | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
114 | 115 | | |
115 | | - | |
| 116 | + | |
116 | 117 | | |
117 | | - | |
| 118 | + | |
118 | 119 | | |
119 | | - | |
| 120 | + | |
120 | 121 | | |
121 | | - | |
| 122 | + | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
124 | 125 | | |
125 | | - | |
| 126 | + | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
0 commit comments