mapbox / geometry.hpp

C++ geometry types
ISC License
92 stars 37 forks source link

Add optional "bbox" member to feature and geometries #21

Open mourner opened 8 years ago

mourner commented 8 years ago

The GeoJSON spec defines an optional bbox property that can be present in any GeoJSON object (both geometries and feature).

This is sometimes very useful, e.g. geojson-vt internal representation calculates bboxes to speed up clipping. I think we should add it to geometry.hpp too.

cc @artemp @jfirebaugh

artemp commented 8 years ago

@mourner - Cool, I was planning to add this issue as well :) My angle not so much GeoJSON but more generally boiler-plate code sharing across projects. Pretty much every project concerned with some geometries has custom bounding_box implementation + operations.

Here is tested approach as a starting point : https://github.com/mapnik/mapnik/blob/master/include/mapnik/box2d.hpp /cc @jfirebaugh @springmeyer

jfirebaugh commented 8 years ago

Related: #25.