Commit Graph

78 Commits

Author SHA1 Message Date
Tom Payne
029d978949 Add ol.geom.Polygon#containsCoordinate 2013-11-20 11:42:07 +01:00
Tom Payne
07173c493e Refactor ol.geom.Polygon 2013-11-20 11:41:58 +01:00
Tom Payne
cfaad0eff1 Use raw geometry types 2013-11-20 11:41:57 +01:00
Tom Payne
e4623af4df Add ol.geom.Geometry#transform 2013-11-20 11:41:56 +01:00
Tom Payne
fb6a2867ff Add ol.geom.Polygon 2013-11-20 11:41:07 +01:00
Tom Payne
4e65fefc00 Move vector code out of the way 2013-11-20 11:39:21 +01:00
Paul Spencer
bada596b45 Add default stability level to docs of exported things. 2013-10-24 18:20:24 -04:00
Tim Schaub
b821619368 Change event for polygons 2013-10-03 12:28:35 -06:00
Tim Schaub
626a319222 Accessor for polygon rings 2013-10-03 12:28:34 -06:00
Tim Schaub
1aa83e133b Remove dimension property from geometries
This was only necessary when using the shared vertices structure.
2013-09-27 23:18:34 +01:00
Tim Schaub
33457c48de Add transform method to geometries
In the typical sequence of parse-transform-render the most efficient place to transform coordinate values is deep within the parser immediately after values have been read (this would avoid a second pass over whatever structure is used to back geometries).  To accomplish this transform during parsing, we could add back parser read options to pass the transform function around.

Until then, a transform method on geometries is straightforward to implement.  This means we do a second pass through coordinate structures to transform, but this is typically done only once immediately after parsing.
2013-09-27 23:18:34 +01:00
Tim Schaub
2850c761cf Remove use of shared vertices in geom package 2013-09-27 23:18:17 +01:00
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