Skip to content

Commit

Permalink
Fix #831
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Oct 3, 2023
1 parent 9f413fd commit c8e51b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,15 @@ String distributionCharacterization(JdbcDataSource datasource, String distribTab
def outputTableName = prefix prefixName, BASENAME

// Get all columns from the distribution table and remove the geometry column if exists
def allColumns = datasource."$distribTableName".columns
def allColumns = datasource.getColumnNames(distribTableName)
if (allColumns.contains(GEOMETRY_FIELD)) {
allColumns -= GEOMETRY_FIELD
}
// Get the distribution columns and the number of columns
def distribColumns = allColumns.minus(inputId.toUpperCase())
def nbDistCol = distribColumns.size()

if(distribColumns.size==0){
if(distribColumns.size()==0){
error("Any columns to compute the distribution from the table $distribTableName".toString())
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ String createTSU(JdbcDataSource datasource, String inputTableName, String inputz
datasource """
DROP TABLE IF EXISTS $outputTableName;
CREATE TABLE $outputTableName AS
SELECT EXPLOD_ID AS $COLUMN_ID_NAME, ST_SETSRID(st_buffer(a.the_geom, -0.01), $epsg) AS the_geom
SELECT EXPLOD_ID AS $COLUMN_ID_NAME, ST_SETSRID(a.the_geom, $epsg) AS the_geom
FROM ST_EXPLODE('(
SELECT ST_POLYGONIZE(ST_UNION(ST_NODE(ST_ACCUM(the_geom)))) AS the_geom
SELECT ST_BUFFER(ST_POLYGONIZE(ST_UNION(ST_NODE(ST_ACCUM(the_geom)))), -0.01) AS the_geom
FROM $inputTableName)') AS a,
$inputzone AS b
WHERE a.the_geom && b.the_geom
Expand All @@ -136,9 +136,9 @@ String createTSU(JdbcDataSource datasource, String inputTableName, String inputz
datasource """
DROP TABLE IF EXISTS $outputTableName;
CREATE TABLE $outputTableName AS
SELECT EXPLOD_ID AS $COLUMN_ID_NAME, ST_SETSRID(st_buffer(a.the_geom, -0.01), $epsg) AS the_geom
SELECT EXPLOD_ID AS $COLUMN_ID_NAME, ST_SETSRID(st_buffer(the_geom, -0.01), $epsg) AS the_geom
FROM ST_EXPLODE('(
SELECT ST_POLYGONIZE(ST_UNION(ST_NODE(ST_ACCUM(the_geom)))) AS the_geom
SELECT ST_BUFFER(ST_POLYGONIZE(ST_UNION(ST_NODE(ST_ACCUM(the_geom)))),-0.01) AS the_geom
FROM $inputTableName)') where st_area(the_geom) > $area""".toString()
}

Expand Down

0 comments on commit c8e51b4

Please sign in to comment.