ngageoint / hootenanny

Hootenanny conflates multiple maps into a single seamless map.
GNU General Public License v3.0
358 stars 74 forks source link

Optimize `MapCropper` #5701

Closed bmarchant closed 1 year ago

bmarchant commented 1 year ago

Certain output file formats will crop data on output so the MapCropper isn't necessary during the read operation, this used to just be OGR formats and now includes GeoJSON output files.

The MapCropper object deletes ways that fall outside of the bounds one-by-one using the RemoveWayByEid map visitor. When each way is deleted the OsmMap object rebuilds the _index member which is a costly operation. Instead of doing that, now the OsmMap::bulkRemoveWays method deletes a list of ways all at once and then rebuilds the index afterwards only one time.

Closes #5693