@@ -4,7 +4,7 @@ S2 is a library for spherical geometry that aims to have the same robustness,
4
4
flexibility, and performance as the best planar geometry libraries.
5
5
6
6
This is a library for manipulating geometric shapes. Unlike many geometry
7
- libraries, S2 is primarily designed to work with _ spherical geometry _ , i.e.,
7
+ libraries, S2 is primarily designed to work with * spherical geometry * , i.e.,
8
8
shapes drawn on a sphere rather than on a planar 2D map. (In fact, the name S2
9
9
is derived from the mathematical notation for the unit sphere * S²* .) This makes
10
10
it especially suitable for working with geographic data.
@@ -92,109 +92,150 @@ This library is principally a port of the
92
92
where it makes sense. We detail the progress of this port below relative to that
93
93
C++ library.
94
94
95
+ Legend:
96
+
97
+ * ✅ - Feature Complete
98
+ * 🟡 - Mostly Complete
99
+ * ❌ - Not available
100
+
95
101
## [ ℝ¹] ( https://godoc.org/github.com/golang/geo/r1 ) - One-dimensional Cartesian coordinates
96
102
97
- Full parity with C++.
103
+ C++ Type | Go
104
+ :--------- | ---
105
+ R1Interval | ✅
98
106
99
107
## [ ℝ²] ( https://godoc.org/github.com/golang/geo/r2 ) - Two-dimensional Cartesian coordinates
100
108
101
- Full parity with C++.
109
+ C++ Type | Go
110
+ :------- | ---
111
+ R2Point | ✅
112
+ R2Rect | ✅
102
113
103
114
## [ ℝ³] ( https://godoc.org/github.com/golang/geo/r3 ) - Three-dimensional Cartesian coordinates
104
115
105
- Full parity with C++.
116
+ C++ Type | Go
117
+ :------------ | ---
118
+ R3Vector | ✅
119
+ R3ExactVector | ✅
120
+ Matrix3x3 | ✅
106
121
107
122
## [ S¹] ( https://godoc.org/github.com/golang/geo/s1 ) - Circular Geometry
108
123
109
- Full parity with C++.
124
+ C++ Type | Go
125
+ :----------- | ---
126
+ S1Angle | ✅
127
+ S1ChordAngle | ✅
128
+ S1Interval | ✅
110
129
111
130
## [ S²] ( https://godoc.org/github.com/golang/geo/s2 ) - Spherical Geometry
112
131
113
- Approximately ~ 40% complete.
114
-
115
- ** Complete** These files have full parity with the C++ implementation.
116
-
117
- * Cap
118
- * Cell
119
- * CellID
120
- * CellUnion
121
- * ContainsVertexQuery
122
- * ConvexHullQuery
123
- * CrossingEdgeQuery
124
- * LatLng
125
- * matrix3x3
126
- * Metric
127
- * PaddedCell
128
- * Point
129
- * PointCompression
130
- * Region
131
- * RegionCoverer
132
- * RegionUnion
133
- * s2edge_clipping
134
- * s2edge_crosser
135
- * s2edge_crossings
136
- * s2edge_distances
137
- * edgeVectorShape
138
- * laxLoop
139
- * laxPolyline
140
- * s2projections - Helpers for projecting points between R2 and S2.
141
- * s2rect_bounder
142
- * s2stuv.go (s2coords.h in C++) - This file is a collection of helper and
143
- conversion methods to and from ST-space, UV-space, and XYZ-space.
144
- * s2wedge_relations
145
- * ShapeIndex
146
- * idSetLexicon,sequenceLexicon
147
-
148
- ** Mostly Complete** Files that have almost all of the features of the original
149
- C++ code, and are reasonably complete enough to use in live code. Up to date
150
- listing of the incomplete methods are documented at the end of each file.
151
-
152
- * EdgeQuery/Closest/Furthest - missing Project, GetEdge
153
- * ContainsPointQuery - missing visit edges
154
- * laxPolygon
155
- * Loop - Loop is mostly complete now. Missing Project, Distance, Union, etc.
156
- * Polyline - Missing InitTo... methods, NearlyCoversPolyline
157
- * Rect (AKA s2latlngrect in C++) - Missing Centroid, InteriorContains.
158
- * s2_test.go (AKA s2testing and s2textformat in C++) - Missing Fractal test
159
- shape generation. This file is a collection of testing helper methods.
160
- * s2edge_distances - Missing Intersection
161
-
162
- ** In Progress** Files that have some work done, but are probably not complete
163
- enough for general use in production code.
164
-
165
- * CellIndex - A queryable index of CellIDs.
166
- * Polygon - Polygons with multiple loops are supported. It fully implements
167
- Shape and Region, but it's missing most other methods. (Area, Centroid,
168
- Distance, Projection, Intersection, Union, Contains, Normalized, etc.)
169
- * PolylineSimplifier - Initial work has begun on this.
170
- * s2predicates.go - This file is a collection of helper methods used by other
171
- parts of the library.
172
- * s2shapeutil - Initial elements added. Missing VisitCrossings.
173
-
174
- ** Not Started Yet.** These files (and their associated unit tests) have
175
- dependencies on most of the In Progress files before they can begin to be
176
- started.
177
-
178
- * BooleanOperation - used when assembling polygons and loops.
179
- * Builder - This is a robust tool for creating the various Shape types from
180
- collection of simpler S2 types.
181
- * BuilderClosedSetNormalizer
182
- * BuilderFindPolygonDegneracies
183
- * BuilderGraph
184
- * BuilderLayers
185
- * BuilderSnapFunctions
186
- * BuilderTesting
187
- * Centroids
188
- * ClosestPointQuery
189
- * EdgeTesselator
190
- * LoopMeasures
191
- * PointIndex
192
- * PointRegion
193
- * PointUtil
194
- * PolygonMeasures
195
- * RegionIntersection
196
- * RegionTermIndexer
197
- * ShapeIndexRegion - Allows ShapeIndexes to be used as Regions for things like
132
+ ### Basic Types
133
+
134
+ C++ Type | Go
135
+ :------------------- | ---
136
+ S2Cap | ✅
137
+ S2Cell | ✅
138
+ S2CellId | ✅
139
+ S2CellIdVector | ❌
140
+ S2CellIndex | 🟡
141
+ S2CellUnion | ✅
142
+ S2Coords | ✅
143
+ S2DensityTree | ❌
144
+ S2DistanceTarget | ✅
145
+ S2EdgeVector | ✅
146
+ S2LatLng | ✅
147
+ S2LatLngRect | ✅
148
+ S2LaxLoop | 🟡
149
+ S2LaxPolygon | 🟡
150
+ S2LaxPolyline | 🟡
151
+ S2Loop | ✅
152
+ S2PaddedCell | ✅
153
+ S2Point | ✅
154
+ S2PointIndex | ❌
155
+ S2PointSpan | ❌
156
+ S2PointRegion | ❌
157
+ S2PointVector | ✅
158
+ S2Polygon | 🟡
159
+ S2Polyline | ✅
160
+ S2R2Rect | ❌
161
+ S2Region | ✅
162
+ S2RegionCoverer | ✅
163
+ S2RegionIntersection | ❌
164
+ S2RegionUnion | ✅
165
+ S2Shape | ✅
166
+ S2ShapeIndex | ✅
167
+ S2ShapeIndexRegion | ❌
168
+ EncodedLaxPolygon | ❌
169
+ EncodedLaxPolyline | ❌
170
+ EncodedShapeIndex | ❌
171
+ EncodedStringVector | ❌
172
+ EncodedUintVector | ❌
173
+ IdSetLexicon | ❌
174
+ ValueSetLexicon | ❌
175
+ SequenceLexicon | ❌
176
+ LaxClosedPolyline | ❌
177
+ VertexIDLaxLoop | ❌
178
+
179
+ ### Query Types
180
+
181
+ C++ Type | Go
182
+ :------------------- | ---
183
+ S2ChainInterpolation | ❌
184
+ S2ClosestCell | ❌
185
+ S2FurthestCell | ❌
186
+ S2ClosestEdge | ✅
187
+ S2FurthestEdge | ✅
188
+ S2ClosestPoint | ❌
189
+ S2FurthestPoint | ❌
190
+ S2ContainsPoint | ✅
191
+ S2ContainsVertex | ✅
192
+ S2ConvexHull | ✅
193
+ S2CrossingEdge | ✅
194
+ S2HausdorffDistance | ❌
195
+ S2ShapeNesting | ❌
196
+
197
+ ### Supporting Types
198
+
199
+ C++ Type | Go
200
+ :------------------------------- | ---
201
+ S2BooleanOperation | ❌
202
+ S2BufferOperation | ❌
203
+ S2Builder | ❌
204
+ S2BuilderClosedSetNormalizer | ❌
205
+ S2BuilderFindPolygonDegeneracies | ❌
206
+ S2BuilderGraph | ❌
207
+ S2BuilderLayers | ❌
208
+ S2BuilderSnapFunctions | ❌
209
+ S2BuilderTesting | ❌
210
+ S2Builderutil\* | ❌
211
+ S2Coder | ❌
212
+ S2EdgeClipping | ✅
213
+ S2EdgeCrosser | ✅
214
+ S2EdgeCrossings | ✅
215
+ S2EdgeDistances | ✅
216
+ S2EdgeTessellator | ✅
217
+ S2LoopMeasures | ❌
218
+ S2Measures | ✅
219
+ S2MemoryTracker | ❌
220
+ S2Metrics | ❌
221
+ S2PointUtil | 🟡
222
+ S2PolygonBuilder | ❌
223
+ S2PolylineAlignment | ❌
224
+ S2PolylineMeasures | ✅
225
+ S2PolylineSimplifier | ❌
226
+ S2Predicates | ✅
227
+ S2Projections | ❌
228
+ S2rectBounder | ❌
229
+ S2RegionTermIndexer | ❌
230
+ S2ShapeIndexMeasures | ❌
231
+ S2ShapeIndexUtil\* | 🟡
232
+ S2ShapeMeasures | ❌
233
+ S2ShapeUtil\* | 🟡
234
+ S2Stats | ❌
235
+ S2Testing | ✅
236
+ S2TextFormat | ✅
237
+ S2WedgeRelations | ✅
238
+ S2WindingOperation | ❌
198
239
199
240
### Encode/Decode
200
241
0 commit comments