Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/expire-tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ void expire_tiles_t::from_geometry(geom::multipolygon_t const &geom,
void expire_tiles_t::from_geometry(geom::geometry_t const &geom,
expire_config_t const &expire_config)
{
if (!enabled()) {
return;
}

geom.visit([&](auto const &g) { from_geometry(g, expire_config); });
}

Expand Down Expand Up @@ -224,10 +228,6 @@ void expire_tiles_t::from_line_segment(geom::point_t const &a,
int expire_tiles_t::from_bbox(geom::box_t const &box,
expire_config_t const &expire_config)
{
if (!enabled()) {
return 0;
}

double const width = box.width();
double const height = box.height();
if (width > tile_t::HALF_EARTH_CIRCUMFERENCE + 1) {
Expand Down
8 changes: 4 additions & 4 deletions tests/bdd/flex/expire.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Changes on way with expire on zoom 0
Feature: Changes on way with expire on zoom 1

Background:
Given the style file 'test_expire.lua'
Expand Down Expand Up @@ -71,7 +71,7 @@ Feature: Changes on way with expire on zoom 0
| 11 |
Then table osm2pgsql_test_expire contains exactly
| zoom | x | y |
| 0 | 0 | 0 |
Copy link
Collaborator

@lonvia lonvia Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you adapt the name of the feature in the first line of this file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

| 1 | 1 | 0 |


Scenario: change in t1
Expand All @@ -88,7 +88,7 @@ Feature: Changes on way with expire on zoom 0
| way_id |
Then table osm2pgsql_test_expire contains exactly
| zoom | x | y |
| 0 | 0 | 0 |
| 1 | 1 | 0 |


Scenario: remove from t1
Expand All @@ -105,4 +105,4 @@ Feature: Changes on way with expire on zoom 0
| way_id |
Then table osm2pgsql_test_expire contains exactly
| zoom | x | y |
| 0 | 0 | 0 |
| 1 | 1 | 0 |
2 changes: 1 addition & 1 deletion tests/data/test_expire.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

-- No maxzoom sets it to 0
local eo = osm2pgsql.define_expire_output({
table = 'osm2pgsql_test_expire',
maxzoom = 1,
})

local the_table = osm2pgsql.define_way_table('osm2pgsql_test_t1', {
Expand Down