Skip to content

Commit

Permalink
Merge pull request #692 from Universite-Gustave-Eiffel/fix_revert
Browse files Browse the repository at this point in the history
Revert "Update Create_Isosurface.groovy"
  • Loading branch information
nicolas-f authored Oct 11, 2024
2 parents b3dbbd5 + f79593a commit 402779a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Unzip production artifacts
run: cd wps_scripts && ./gradlew assembleDist && unzip build/distributions/scriptrunner.zip
- name: Archive production artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: NoiseModelling_without_gui.zip
path: wps_scripts/scriptrunner/
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.geotools.jdbc.JDBCDataStore
import org.h2gis.utilities.GeometryTableUtilities
import org.h2gis.utilities.TableLocation
import org.h2gis.utilities.wrapper.ConnectionWrapper
import org.noise_planet.noisemodelling.jdbc.utils.IsoSurface
import org.noise_planet.noisemodelling.jdbc.BezierContouring
import org.slf4j.Logger
import org.slf4j.LoggerFactory

Expand Down Expand Up @@ -100,7 +100,7 @@ def exec(Connection connection, input) {
logger.info("inputs {}", input) // log inputs of the run


List<Double> isoLevels = IsoSurface.NF31_133_ISO // default values
List<Double> isoLevels = BezierContouring.NF31_133_ISO // default values

if (input.containsKey("isoClass")) {
isoLevels = new ArrayList<>()
Expand All @@ -114,27 +114,27 @@ def exec(Connection connection, input) {

int srid = GeometryTableUtilities.getSRID(connection, TableLocation.parse(levelTable))

IsoSurface isoSurface = new IsoSurface(isoLevels, srid)
BezierContouring bezierContouring = new BezierContouring(isoLevels, srid)

isoSurface.setPointTable(levelTable)
bezierContouring.setPointTable(levelTable)

if (input.containsKey("smoothCoefficient")) {
double coefficient = input['smoothCoefficient'] as Double
if (coefficient < 0.01) {
isoSurface.setSmooth(false)
bezierContouring.setSmooth(false)
} else {
isoSurface.setSmooth(true)
isoSurface.setSmoothCoefficient(coefficient)
bezierContouring.setSmooth(true)
bezierContouring.setSmoothCoefficient(coefficient)
}
}
else {
isoSurface.setSmooth(true)
isoSurface.setSmoothCoefficient(0.5)
bezierContouring.setSmooth(true)
bezierContouring.setSmoothCoefficient(0.5)
}

isoSurface.createTable(connection)
bezierContouring.createTable(connection)

resultString = "Table " + isoSurface.getOutputTable() + " created"
resultString = "Table " + bezierContouring.getOutputTable() + " created"

logger.info('End : Compute Isosurfaces')
logger.info(resultString)
Expand All @@ -156,4 +156,4 @@ def run(input) {
Connection connection ->
return [result: exec(connection, input)]
}
}
}

0 comments on commit 402779a

Please sign in to comment.