Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapcache_seed - make GEOS clipper work with recent GEOS versions GEOSPreparedIntersects #331

Merged
merged 1 commit into from
Apr 4, 2024
Merged
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
9 changes: 7 additions & 2 deletions util/mapcache_seed.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ int ogr_features_intersect_tile(mapcache_context *ctx, mapcache_tile *tile)
{
mapcache_metatile *mt = mapcache_tileset_metatile_get(ctx,tile);
GEOSCoordSequence *mtbboxls = GEOSCoordSeq_create(5,2);
GEOSGeometry *mtbbox = GEOSGeom_createLinearRing(mtbboxls);
GEOSGeometry *mtbboxg = GEOSGeom_createPolygon(mtbbox,NULL,0);
// linearring and polygon creation moved after coords - more recent GEOS seems to assume coordinates are set
GEOSGeometry *mtbbox = NULL;
GEOSGeometry *mtbboxg = NULL;
int i;
int intersects = 0;
GEOSCoordSeq_setX(mtbboxls,0,mt->map.extent.minx);
Expand All @@ -332,6 +333,10 @@ int ogr_features_intersect_tile(mapcache_context *ctx, mapcache_tile *tile)
GEOSCoordSeq_setY(mtbboxls,3,mt->map.extent.maxy);
GEOSCoordSeq_setX(mtbboxls,4,mt->map.extent.minx);
GEOSCoordSeq_setY(mtbboxls,4,mt->map.extent.miny);
// moved after coords - more recent GEOS seems to assume coordinates are set
mtbbox = GEOSGeom_createLinearRing(mtbboxls);
mtbboxg = GEOSGeom_createPolygon(mtbbox,NULL,0);

for(i=0; i<nClippers; i++) {
const GEOSPreparedGeometry *clipper = clippers[i];
if(GEOSPreparedIntersects(clipper,mtbboxg)) {
Expand Down
Loading