Commit Graph

33 Commits

Author SHA1 Message Date
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
Tom Payne 953f9c2e7a Port ol.geom to new extents 2013-04-19 10:03:36 +02:00
Tobias Bieniek d5d8afc858 Converted "vector" branch unit tests to mocha, expect.js and sinon 2013-03-13 04:48:08 +01:00
Tim Schaub a968a5ca66 The shared vertices structure now works with integer arrays only
Previously, a lookup object containing start indexes was also used.  This allowed us to remove arrays of vertices and properly update the start indexes for remaining coordinate values.  In order to provide callers with stable identifiers and to work with arrays of integers alone, we cannot support a remove method.  I think this is worth revisiting.  Even if the array length cannot be changed in WebGL, we don't need to also impose the restriction outside.  Instead, the WebGL renderer could be notified when array sizes change and update itself accordingly.  I think there is more value in providing geometries with stable identifiers.

This common structure is used to store vertices for all geometry types.  A slight optimization could be made by creating yet another structure to store point vertices - since these don't need to have a counts array (always 1).  Creating a new structure would mean saving memory at the expense of more lib code to transport.  The coordinate value lookups are not negatively impacted by using the same structure for points and higher order geometries.  Since the first change above goes against my instincts, I'm not making this second change (to add another structure for shared point vertices).
2013-03-05 11:47:42 +01:00
Tim Schaub 1d6cd1bd1b Lint-free tests 2013-03-04 21:30:23 +01: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 8f578b88b1 Removing the typed arrays
Its not clear that we will be able to leverage the Float64Array.  It may also be that the overhead of constructing these small arrays negates any benefit of faster access.  And for all coordinate arrays, we'll need arrays that grow/shrink.
2013-02-20 01:15:39 -07:00
Tim Schaub 0015e466dc Allow instanceof checks for geometries 2013-02-19 23:21:05 -07:00
Tim Schaub 083404bd58 Provides for tests 2013-02-19 23:15:45 -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
Éric Lemoine baeddfac12 remove the old tests 2012-09-24 18:12:51 +02:00
Marc Jansen f477fd8ced Allow multi* geometries in Collections/collections. 2012-06-25 23:19:25 +02:00
Marc Jansen 6d84d4d3a1 Add geom/MultiLineString classes and tests. 2012-06-25 21:36:17 +02:00
Marc Jansen be9448457d Test & improve the getCentroid/centroid method of collections 2012-06-22 18:24:53 +02:00
Marc Jansen abb254a0fb Test the getCentroid/centroid Method of multipoints 2012-06-22 18:24:53 +02:00
Marc Jansen 4dd3e695a4 Test the getCentroid/centroid Method of linestrings 2012-06-22 17:25:39 +02:00
Marc Jansen e23b119059 Whitespace changes only. 2012-06-22 16:26:19 +02:00
Marc Jansen 09d7f15fb2 Give points a getCentroid/centroid method. 2012-06-22 16:26:19 +02:00
Marc Jansen 11aedf710b Test restructuring. No functional change. 2012-06-22 13:07:52 +02:00
Marc Jansen 8f90db58dc MultiPoints shall only contain points. 2012-06-21 18:23:37 +02:00
Marc Jansen 340caf2720 Collections cannot contain Collections.
By having both the constructor and the setComponents checking
a white- and a blacklist for allowed types, we ensure that no
Collections can be added through these methods to the list of
components.
2012-06-21 18:23:37 +02:00
Marc Jansen ce49bb8876 Add LineString/linestring.
The inhertance of this class might change in the future.
2012-06-21 16:00:08 +02:00
Marc Jansen 0374d1abc7 Add geom.Collection & geom.collection.
Also make MultiPoint and multipoint inherit from Collection/collection
respectively.
2012-06-21 16:00:08 +02:00
Marc Jansen f85d6402e9 Add MultiPoint and multipoint. 2012-06-21 12:19:42 +02:00
Marc Jansen d933404df8 Make Points transformable. 2012-06-20 14:58:37 +02:00
Marc Jansen 33c2e0aa30 Correct the tests for geom.Point and geom.point.
Add tests for the API version `ol.point()`; adjust the tests for the internal
`new ol.Point()`.
2012-06-20 13:36:07 +02:00
Tim Schaub 14b1a34f98 Splitting tests between api and internal. 2012-06-20 11:56:20 +02:00
Marc Jansen 85f0f43b7b Saving state prior to spec moving. 2012-06-20 11:30:06 +02:00
Marc Jansen aec8f953e5 Remove the mixin approach and give the Point class a projection. 2012-06-20 11:18:07 +02:00
Marc Jansen 450f8f7b74 First state of a geom package. 2012-06-19 18:21:21 +02:00