Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Click on the Extensions tab and click the Add... button
  2. In the New Extension wizard that opens, search for ncsa.analysis.newAnalyses, select it and click Finish.
  3. After adding the extension point, if Eclipse did not add blank new analysis element, right click on the extension point and select New > analysis
  4. The next step is to fill in the required parts for the new analysis. Enter the following information
    • id: ncsa.maeviz.building.example.analysis.buildingSoilAnalysis
    • name: Building Soil Analysis
    • tag: buildingSoilAnalysis
    • category: My-Buildings
  5. The final requirement is a descriptor. I recommend creating a new folder inside your plug-in called descriptions and adding a new file called BuildingSoilAnalysis.xml that we will fill in later. After creating this file, you will need to specify it in the descriptor field of your new analysis. You should now have a something similar to the image below:

Your BuildingSoilAnalysis.xml file should contain the following code:

Code Block
xml
xml

<analysis-description id ="ncsa.maeviz.building.example.analysis.buildingSoilAnalysis">
	<analysis-type type="simpleIteration">
		<property name="iteratingDatasetKey" value="buildings">
		</property>
	</analysis-type>
	<groups>
		<group-name>Required</group-name>
		<group-name>Advanced</group-name>
	</groups>
	
	<!-- Analysis Inputs -->
	
	<!-- the result name must be prefixed with the tag of the analysis, in this case toxicCloudAnalysis -->
	<parameter format="resultName" phylum="string" cardinality="single" key="buildingSoilAnalysis.resultName" friendly-name="Result Name"/>
	
	<parameter phylum="dataset" cardinality="single" key="buildings" friendly-name="Buildings">
		<types>
			<type>buildingv4</type>
			<type>buildingv5</type>
		</types>
	</parameter>
	
	<!-- Analysis Outputs -->
	<output friendly-name="Building Soil Results" key="buildingSoilAnalysis" phylum="dataset" format="shapefile" geom="buildings" guids="buildings">
		<property name="buildings" type="base-dataset-key" value="buildings"/>
		<property name="schema" type="schema" value="ncsa.maeviz.building.example.schemas.buildingSoilResults.v1.0"/>
	</output>
	
</analysis-description>

Analysis Task

The next step is to create a new analysis task. This is the Java code that will be executed by the new analysis to produce our building soil analysis output. To create a new task, do the following:

...

Code Block
titleBuildingSoilTask extends SimpleFeatureTask
@Override
protected void handleFeature( IProgressMonitor monitor ) throws ScriptExecutionException{
    resultMap.put( "soiltype", isSoftSoil() );
}

private int isSoftSoil() {
    Random rand = new Random();
    return rand.nextInt( 1 );
}

...