Refactor expire by geometry code#1809
Conversation
lonvia
left a comment
There was a problem hiding this comment.
There is one more call to from_geometry() here: https://github.com/openstreetmap/osm2pgsql/blob/bd8d41fcdf6814404132795f0e571c7357cd22ad/src/expire-tiles.cpp#L291 That could be non-3857, too, or am I reading that wrong?
| geom::box_t box; | ||
| for (auto const &sgeom : geom) { | ||
| box.extend(sgeom.outer()); | ||
| } |
There was a problem hiding this comment.
Isn't that the same as box = geom::envelope(geom)?
There was a problem hiding this comment.
Yes, I missed that one. Changed.
Split up code into functions for each geometry type. Adds support for geometry types that have been missing so far (multipoint, geometry collection). When using a target SRS other than Mercator (EPSG:3857) expire didn't work before, it is now explicitly disabled (with a warning) in this case. (This applies only to the pgsql output, the flex output sets the SRS per table. There is currently no warning in this case, but we are moving away from the expire configuration on the command line for the flex output anyway, so I'll leave it at that for the moment.)
3c12abb to
4bfa132
Compare
|
I have changed the code some more based on the comment above regarding the use of I added a check in the command line options parsing code to detect the case where expire is enabled but a projection other than Mercator used and disable the expire then. That makes checking for that condition easier later on and the user gets a nice warning. |
Split up code into functions for each geometry type. Adds support for geometry types that have been missing so far (multipoint, geometry collection).