Skip to content

Commit

Permalink
Merge pull request #956 from j3r3m1/smallestCommunAreaIssue
Browse files Browse the repository at this point in the history
Replace mitre buffer by the default round
  • Loading branch information
ebocher authored Apr 24, 2024
2 parents 6305ae2 + b8644a2 commit 7f5d7eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ String createTSU(JdbcDataSource datasource, String inputTableName, String inputz
}
if (inputzone) {
String polygons = postfix("polygons")
// todo: put 'mitre' instead of 'round' whenever JTS has been updated to version 1.20
datasource.execute("""DROP TABLE IF EXISTS $polygons;
CREATE TABLE $polygons as SELECT EXPLOD_ID AS $COLUMN_ID_NAME, ST_SETSRID(ST_BUFFER(ST_BUFFER(the_geom,-0.01, 'join=mitre'), 0.01, 'join=mitre'), $epsg) AS the_geom FROM
CREATE TABLE $polygons as SELECT EXPLOD_ID AS $COLUMN_ID_NAME, ST_SETSRID(ST_BUFFER(ST_BUFFER(the_geom,-0.01, 2), 0.01, 2), $epsg) AS the_geom FROM
ST_EXPLODE('(SELECT ST_POLYGONIZE(ST_UNION(ST_NODE(ST_ACCUM(the_geom)))) AS the_geom
FROM $inputTableName)')
""".toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,11 @@ class WorkflowGeoIndicatorsTest {

//Check building_fraction > 0
countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE BUILDING_FRACTION>0".toString())
assertEquals(70, countResult.count)
assertEquals(73, countResult.count)

//Check high_vegetation_fraction > 0
countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE high_vegetation_fraction>0".toString())
assertEquals(18, countResult.count)
assertEquals(22, countResult.count)

//Check high_vegetation_water_fraction > 0
countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE high_vegetation_water_fraction>0".toString())
Expand All @@ -592,7 +592,7 @@ class WorkflowGeoIndicatorsTest {

//Check high_vegetation_road_fraction > 0
countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE high_vegetation_road_fraction>0".toString())
assertEquals(20, countResult.count)
assertEquals(21, countResult.count)

//Check high_vegetation_impervious_fraction > 0
countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE high_vegetation_impervious_fraction>0".toString())
Expand All @@ -604,7 +604,7 @@ class WorkflowGeoIndicatorsTest {

//Check low_vegetation_fraction > 0
countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE low_vegetation_fraction>0".toString())
assertEquals(50, countResult.count)
assertEquals(55, countResult.count)

//Check low_vegetation_fraction > 0
countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE impervious_fraction>0".toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ class WorflowOSMTest extends WorkflowAbstractTest {
def nominatim = org.orbisgis.geoclimate.osmtools.OSMTools.Utilities.getNominatimData(location)
def grid_size = 100
location = nominatim.bbox
//location=[43.214935,5.336351,43.244890,5.383558]
location=[63.4, 12.8, 63.6, 13]
def osm_parmeters = [
"description" : "Example of configuration file to run the OSM workflow and store the result in a folder",
"geoclimatedb": [
Expand All @@ -677,7 +677,7 @@ class WorflowOSMTest extends WorkflowAbstractTest {

"indicatorUse": ["LCZ", "UTRF", "TEB"]

],"grid_indicators": [
]/*,"grid_indicators": [
"x_size": grid_size,
"y_size": grid_size,
//"rowCol": true,
Expand All @@ -694,7 +694,7 @@ class WorflowOSMTest extends WorkflowAbstractTest {
"SPRAWL_AREAS",
"SPRAWL_DISTANCES", "SPRAWL_COOL_DISTANCE"],
//"lcz_lod":2
]/*, "worldpop_indicators": true,
]*/ /*, "worldpop_indicators": true,
"road_traffic" : true,
"noise_indicators" : [
Expand Down

0 comments on commit 7f5d7eb

Please sign in to comment.