Commit Graph

116 Commits

Author SHA1 Message Date
Tim Schaub
58fe110419 Rename ol.geom.VertexArray to ol.CoordinateArray 2013-08-30 13:30:53 -06:00
ahocevar
b2e25c8f6b Renaming method to getInteriorPoint
as suggested by @tschaub. Also giving credit to JTS.
2013-07-30 09:25:24 +02:00
ahocevar
11ef2cb7d1 Better label placement for polygons
Using the y-coordinate of the polygon's bounding box, this
simple algorithm intersects the polygon with the horizontal
center line of its bounding box. The x-coordinate of the label
point is the center of the longest segment of this intersection
that is inside the polygon.
2013-07-20 10:36:13 +02:00
Tim Schaub
99ba5a0da8 Store rings so exerior is clockwise and interior is counter-clockwise
KML and WKT don't specify a winding order, so we write those out in CW/CCW order (for exterior/interior).  GML references ISO 19107 that specifies CCW/CW, so we serialize in that winding order.

Having hand generated all this GML data the first time around, I reserve the right to modify it for the tests.
2013-06-24 17:46:36 -06:00
Tom Payne
b021bfd70f Remove unused variables in geom 2013-05-28 16:01:33 +02:00
ahocevar
019fc86ac5 Entertaining linter and compiler 2013-05-07 14:20:09 +02:00
ahocevar
666a010e3b Point-in-polygon improvements
As suggested by @tschaub in #674, geom.pointInPoly is not needed
if we have geom.LinearRing#containsCoordinate. This pull request
also adds tests and documentation on the limitations of the
containsCoordinate method.

I think for now it is ok to keep geometry/topology functions as
simple as possible in ol3. If we decide to not rely on third
party libraries like jsts for topology operations, we can always
refine what we have and e.g. port topology operations over from
ol2.
2013-05-07 10:49:51 +02:00
ahocevar
58c8b07ab5 Get hit candidates from RTree, then refine result
Now we get exact hits also for lines and polygons.
2013-04-30 13:34:12 +02:00
Tim Schaub
b52d283641 Allow geometries to use a shared vertex array
The ol.geom.SharedVertices structure represents a flattened array of vertex coordinates.  This is intended to support optimal WebGL rendering.
2013-03-02 18:39:24 +01:00
Tim Schaub
0015e466dc Allow instanceof checks for geometries 2013-02-19 23:21:05 -07:00
ahocevar
619803cdeb More goog.requires fixes 2013-02-06 16:36:42 +01:00
Tim Schaub
6ef2184c83 Geometry type enumeration 2013-01-21 17:46:41 -07:00
Tim Schaub
b4d44f815f Add getBounds to geometry 2013-01-21 12:59:04 -07:00
Tim Schaub
216d30ddc1 Getting the nanometer precision we deserve with web mercator 2013-01-21 10:52:17 -07:00
Tim Schaub
fd0a5f3622 Point, linestring, and linearring coordinates as Float32Array 2013-01-18 15:57:48 -07:00
Tim Schaub
997c7145ab Bare bones geom package 2013-01-07 01:34:33 -05:00