README.md in terraformer-0.1.0 vs README.md in terraformer-0.2.0

- old
+ new

@@ -23,12 +23,12 @@ require 'terraformer' ``` ##### Create a Terraformer primitive from GeoJSON -``` -> polygon = Terraformer.parse '{ +```ruby +polygon = Terraformer.parse '{ "type": "Polygon", "coordinates": [ [ [-122.66589403152467, 45.52290150862236], [-122.66926288604736, 45.52291654238294], @@ -39,27 +39,35 @@ [-122.66589403152467, 45.52290150862236 ] ] ] }' -> point = Terraformer.parse '{ +point = Terraformer.parse '{ "type": "Point", "coordinates": [-122.66947746276854, 45.51775972687403] }' ``` + Now that you have a point and a polygon primitive you can use the primitive helper methods. -``` +```ruby # add a new vertex to our polygon -> new_point = Terraformer::Point.new -122.6708507537842, 45.513188859735436 -> polygon.insert_vertex 2, new_point +new_point = Terraformer::Point.new -122.6708507537842, 45.513188859735436 +polygon.insert_vertex 2, new_point ``` + You can also have Terraformer perform many geometric operations like convex hulls and bounding boxes. -``` -> convex_hull = polygon.convex_hull -> point.within? convex_hull #returns true -> bounding_box = polygon.bbox #returns the bounding box for this object. + +```ruby +# returns convex hull +convex_hull = polygon.convex_hull + +point.within? convex_hull +=> true + +# returns the bounding box +bounding_box = polygon.bbox ``` ## Contributing After checking out the source, run the tests: