peterstace / simplefeatures

Simple Features is a pure Go Implementation of the OpenGIS Simple Feature Access Specification
MIT License
129 stars 19 forks source link

Make the `rtree` package internal #483

Closed peterstace closed 1 year ago

peterstace commented 1 year ago

The rtree package is exposed publically, making it part of the module interface contract. This reduces the amount of flexibility with changing the interface and implementation of that package. We can modify the package's interface without breaking users by first making it internal. This assumes that users aren't already using the rtree package, which I think is a reasonable assumption.

peterstace commented 1 year ago

Before we do this, I think it would be a good idea to expose GEOS's RTree implementation via the geos package so that users have something to migrate over to before the existing RTree implementation is cut off.

peterstace commented 1 year ago

I had a look at the GEOS RTree implementation, which is a bit bleh to work with.

The main complexity of the simplefeatures RTree is actually the insert/delete methods. They're also the parts that are stopping modifications to the RTree storage layout. Perhaps as a compromise, we could just remove those methods (they're not used internally). Hopefully they're not used by many users.

peterstace commented 1 year ago

Rather than making the whole package internal, I've instead opted to remove the Insert and Delete methods.