geoloqi/Terraformer — pull request #64 by patrickarlt (2013-02-09 21:47:19+00:00)
Title: Add lots of convenience methods to primitives for various things.

This adds the following methods and tests...

* Primitive.envelope() - Returns the envelope for the primitive for use in RTree.
* Feature.contains() - throws error if `Feature.geometry` is not a Polygon or Multipolygon
* Circle.contains() - Since circles are just polygons it makes sense
* FeatureCollection.get(id) - Return a `Terraformer.Feature` of the feature with the matching id in the collection.
* GeometryCollection.get(index) - Return a `Terraformer.Primitive` of the geometry at position `index`.
* MultiPolygon.get(index) - Return a `Terraformer.Polygon` of the geometry at position
`index`.
* MultiLineString.get(index) - Return a `Terraformer.LineString` of the geometry at position `index`.
* MultiPoint.get(index) - Return a `Terraformer.Point` of the geometry at position `index`.