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

[Backport branch-7-4] Remove MakeValid() from MSSQL Driver #5859

Merged
merged 1 commit into from
Sep 9, 2019
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
6 changes: 3 additions & 3 deletions mapmssql2008.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ int msMSSQL2008LayerGetExtent(layerObj *layer, rectObj *extent)
query = msStringConcatenate(query, "WITH extent(extentcol) AS (SELECT geometry::EnvelopeAggregate(");
query = msStringConcatenate(query, layerinfo->geom_column);
}
query = msStringConcatenate(query, ".MakeValid()) AS extentcol FROM ");
query = msStringConcatenate(query, ") AS extentcol FROM ");
query = msStringConcatenate(query, layerinfo->geom_table);
query = msStringConcatenate(query, ") SELECT extentcol.STPointN(1).STX, extentcol.STPointN(1).STY, extentcol.STPointN(3).STX, extentcol.STPointN(3).STY FROM extent");
}
Expand All @@ -1197,7 +1197,7 @@ int msMSSQL2008LayerGetExtent(layerObj *layer, rectObj *extent)
query = msStringConcatenate(query, "WITH ENVELOPE as (SELECT ");
query = msStringConcatenate(query, layerinfo->geom_column);
}
query = msStringConcatenate(query, ".MakeValid().STEnvelope() as envelope from ");
query = msStringConcatenate(query, ".STEnvelope() as envelope from ");
query = msStringConcatenate(query, layerinfo->geom_table);
query = msStringConcatenate(query, "), CORNERS as (SELECT envelope.STPointN(1) as point from ENVELOPE UNION ALL select envelope.STPointN(3) from ENVELOPE) SELECT MIN(point.STX), MIN(point.STY), MAX(point.STX), MAX(point.STY) FROM CORNERS");
}
Expand Down Expand Up @@ -1502,7 +1502,7 @@ static int prepare_database(layerObj *layer, rectObj rect, char **query_string)
query = msStringConcatenate(query, " AND ");

query = msStringConcatenate(query, layerinfo->geom_column);
query = msStringConcatenate(query, ".MakeValid().STIntersects(");
query = msStringConcatenate(query, ".STIntersects(");
query = msStringConcatenate(query, box3d);
query = msStringConcatenate(query, ") = 1 ");

Expand Down