-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
255 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<actions> | ||
<action> | ||
<actionName>build-with-dependencies</actionName> | ||
<basedir>.</basedir> | ||
<reactor>also-make</reactor> | ||
<goals> | ||
<goal>install</goal> | ||
</goals> | ||
</action> | ||
<action> | ||
<actionName>run</actionName> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.1.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.workingdir>/media/projects_/module_bruit/data_computed/2011_07_25</exec.workingdir> | ||
<exec.classpathScope>runtime</exec.classpathScope> | ||
<exec.args>-Xms1024m -classpath %classpath org.noisemap.run.trigrid -ib bati_in_fence.gdms -is expline_source.gdms -o trilvl.gdms</exec.args> | ||
<exec.executable>java</exec.executable> | ||
</properties> | ||
</action> | ||
<action> | ||
<actionName>debug</actionName> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:1.1.1:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.workingdir>/media/projects_/module_bruit/data_computed/2011_07_25</exec.workingdir> | ||
<exec.classpathScope>runtime</exec.classpathScope> | ||
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xms1024m -classpath %classpath org.noisemap.run.trigrid -ib bati_in_fence.gdms -is expline_source.gdms -o trilvl.gdms</exec.args> | ||
<jpda.listen>true</jpda.listen> | ||
<exec.executable>java</exec.executable> | ||
</properties> | ||
</action> | ||
</actions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/org/noisemap/plugin/NoiseMapDeclaration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package org.noisemap.plugin; | ||
|
||
|
||
|
||
import org.orbisgis.core.ui.pluginSystem.AbstractPlugIn; | ||
import org.orbisgis.core.ui.pluginSystem.PlugInContext; | ||
/** | ||
* | ||
* @author fortin | ||
*/ | ||
public class NoiseMapDeclaration extends AbstractPlugIn { | ||
NoiseMapExtension noiseExt; | ||
@Override | ||
public void initialize(PlugInContext context) throws Exception { | ||
noiseExt=new NoiseMapExtension(); | ||
} | ||
|
||
@Override | ||
public boolean execute(PlugInContext context) throws Exception { | ||
noiseExt.configure(context); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
|
||
/*********************************** | ||
* ANR EvalPDU | ||
* IFSTTAR 11_05_2011 | ||
* @author Nicolas FORTIN, Judicaël PICAUT | ||
***********************************/ | ||
|
||
|
||
package org.noisemap.run; | ||
|
||
import java.io.File; | ||
import org.gdms.driver.DriverException; | ||
import org.gdms.driver.ReadAccess; | ||
import org.gdms.driver.gdms.GdmsDriver; | ||
import java.util.Stack; | ||
import org.gdms.data.SQLDataSourceFactory; | ||
import org.gdms.data.values.Value; | ||
import org.gdms.data.values.ValueFactory; | ||
import org.gdms.sql.function.FunctionException; | ||
import org.noisemap.core.BR_TriGrid; | ||
|
||
/** | ||
* Independant run of BR_TriGrid plugin | ||
* Take two gdms file as input. The single output is another gdms file. | ||
*/ | ||
public class trigrid { | ||
|
||
private static void printUsage() { | ||
System.out.println("Usage :"); | ||
System.out.println("java trigrid.jar [options] -ib bpath -is spath -o outpath"); | ||
System.out.println("Options :"); | ||
System.out.println("-bfield the_geom : buildings column name (polygons)"); | ||
System.out.println("-sfield the_geom : sources column nale (points or lines)"); | ||
System.out.println("-splfield db_m : sound lvl field name(string)"); | ||
System.out.println("-maxdist 170 : maximum propagation distance (double meter)"); | ||
System.out.println("-splitdepth 3 : subdivision level 4^n cells (int) [0-n]"); | ||
System.out.println("-rwidth 0.8 : roads width (double meter)"); | ||
System.out.println("-dense 5 : densification of receivers near roads (meter double)"); | ||
System.out.println("-marea 250 : maximum area of triangle (square meter)"); | ||
System.out.println("-rdepth 2 : sound reflection order [0-n] (int)"); | ||
System.out.println("-ddepth 1 : sound diffraction order [0-n] (int)"); | ||
System.out.println("-awalls 0.2 : alpha of walls [0-1[ (double)"); | ||
System.out.println("-ib builds.gdms : file name of buildings gdms file"); | ||
System.out.println("-is sources.gdms : file name of noise sources gdms file"); | ||
System.out.println("-o trilvl.gdms : output filename of gdms file"); | ||
} | ||
/** | ||
* @param args the command line arguments | ||
*/ | ||
public static void main(String[] args) { | ||
// Parameters | ||
String buildingsFilename=""; | ||
String sourcesFilename=""; | ||
String outputFilename=""; | ||
//Optionnal parameters | ||
String bField="the_geom"; | ||
String sField="the_geom"; | ||
String splField="db_m"; | ||
double maxDist=170; | ||
int splitDepth=3; | ||
double roadsWidth=0.8; | ||
double densification=5.; | ||
double maxarea=250; | ||
int reflectionDepth=2; | ||
int diffractionDepth=1; | ||
double wallAlpha=.2; | ||
|
||
|
||
//Read parameters | ||
Stack<String> sargs=new Stack<String>(); | ||
for(String arg : args) { | ||
sargs.insertElementAt(arg, 0); | ||
} | ||
while(!sargs.empty()) { | ||
String argument=sargs.pop(); | ||
System.out.println(argument+sargs); | ||
if(argument.contentEquals("-bfield")) { | ||
bField=sargs.pop(); | ||
}else if(argument.contentEquals("-sfield")) { | ||
sField=sargs.pop(); | ||
}else if(argument.contentEquals("-splfield")) { | ||
splField=sargs.pop(); | ||
}else if(argument.contentEquals("-maxdist")) { | ||
maxDist=Double.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-splitdepth")) { | ||
splitDepth=Integer.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-rwidth")) { | ||
roadsWidth=Double.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-dense")) { | ||
densification=Double.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-marea")) { | ||
maxarea=Double.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-rdepth")) { | ||
reflectionDepth=Integer.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-ddepth")) { | ||
reflectionDepth=Integer.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-awalls")) { | ||
wallAlpha=Double.valueOf(sargs.pop()); | ||
}else if(argument.contentEquals("-ib")) { | ||
buildingsFilename=sargs.pop(); | ||
}else if(argument.contentEquals("-is")) { | ||
sourcesFilename=sargs.pop(); | ||
}else if(argument.contentEquals("-o")) { | ||
outputFilename=sargs.pop(); | ||
} | ||
} | ||
if(buildingsFilename.isEmpty() || sourcesFilename.isEmpty() || outputFilename.isEmpty()) { | ||
printUsage(); | ||
return; | ||
} | ||
//Load files | ||
SQLDataSourceFactory factory=new SQLDataSourceFactory(); | ||
GdmsDriver buildings=new GdmsDriver(); | ||
GdmsDriver sources=new GdmsDriver(); | ||
ReadAccess[] tables={null,null}; | ||
try { | ||
buildings.setFile(new File(buildingsFilename)); | ||
buildings.open(); | ||
tables[0]=buildings.getTable("main"); | ||
sources.setFile(new File(buildingsFilename)); | ||
sources.open(); | ||
tables[1]=sources.getTable("main"); | ||
} catch (DriverException ex) { | ||
System.err.println(ex.getMessage()); | ||
ex.printStackTrace(System.err); | ||
return; | ||
} | ||
//Run propagation | ||
|
||
BR_TriGrid propa=new BR_TriGrid(); | ||
Value[] propaArgs={ValueFactory.createValue(bField),ValueFactory.createValue(sField),ValueFactory.createValue(splField),ValueFactory.createValue(maxDist),ValueFactory.createValue(splitDepth),ValueFactory.createValue(roadsWidth),ValueFactory.createValue(densification),ValueFactory.createValue(maxarea),ValueFactory.createValue(reflectionDepth),ValueFactory.createValue(diffractionDepth),ValueFactory.createValue(wallAlpha)}; | ||
try { | ||
ReadAccess data = propa.evaluate(factory, tables, propaArgs, null); | ||
} catch (FunctionException ex) { | ||
System.err.println(ex.getMessage()); | ||
ex.printStackTrace(System.err); | ||
return; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters