@@ -1034,14 +1034,16 @@ |
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> |
<copyfiles files="${libs.PostgreSQLDriver.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
<copyfiles files="${reference.csip-core-1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
- <copyfiles files="${libs.csip-jersey-2.16.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
+ <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
+ <copyfiles files="${libs.Microsoft_SQLServer_4.2_JDBC.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
<mkdir dir="${build.web.dir}/META-INF"/> |
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> |
</target> |
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"> |
<copyfiles files="${libs.PostgreSQLDriver.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> |
<copyfiles files="${reference.csip-core-1.jar}" todir="${build.web.dir}/WEB-INF/lib"/> |
- <copyfiles files="${libs.csip-jersey-2.16.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> |
+ <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> |
+ <copyfiles files="${libs.Microsoft_SQLServer_4.2_JDBC.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> |
</target> |
<target depends="init" if="dist.ear.dir" name="-clean-webinf-lib"> |
<delete dir="${build.web.dir}/WEB-INF/lib"/> |
@@ -68,19 +68,17 @@ |
this.aoaId = getStringParam("AoAId"); |
this.minimumPercentage = getDoubleParam("aoa_filter_pct", 0.0); |
//this.useMSSQL = getBooleanParam("use_mssql", false); |
- String confString = Config.getString("rse-db","ssurgo"); |
- if ( confString.contains( "rse-sql" ) ){ |
+ String confString = Config.getString("rse-db", "ssurgo"); |
+ if (confString.contains("rse-sql")) { |
this.useMSSQL = true; |
- LOG.info("Using MS SQL database."); |
+ LOG.info("Using MS SQL database."); |
+ } else { |
+ LOG.info("Using PostgreSQL database."); |
} |
- else |
- { |
- LOG.info("Using PostgreSQL database."); |
- } |
- |
+ |
JSONArray features = getJSONParam("aoa_geometry").optJSONArray("features"); |
if (this.buildPolygon(features)) { |
- this.conn = wqm.utils.WQMTools.getConnection(confString, LOG); |
+ this.conn = wqm.utils.WQMTools.getConnection(confString, LOG); |
this.statement = this.conn.createStatement(); |
} |
} else { |
@@ -160,7 +158,7 @@ |
} else { |
tComponent = this.componentMap.get(cokey); |
} |
- //For the rest of these operations, we need to use the temp component pointer.. |
+ //For the rest of these operations, we need to use the temp component pointer.. |
// Add chkeys to cokey object, some will be duplicates because they are unique by cokey:chkey:chfragkey |
double kwfact; |
Boolean kwfact_b; |
@@ -362,16 +360,18 @@ |
ret_val = new HashMap<>(); |
|
if (this.useMSSQL) { |
- query = "SELECT areasymbol, musym, mukey, muname, geography::STPolyFromText(" + WKTPolygon + ",4326).MakeValid().ReorientObject().STIntersection(soilpoly).STArea() / 4046.86 as sizeIntersectionAcres " |
- + "FROM " |
- + "(SELECT m.areasymbol, m.musym, m.mukey, ssurgo.mapunit.muname, geography::STPolyFromText(m.the_geom.STAsText(),4326).MakeValid().ReorientObject() as soilpoly " |
- + "FROM ssurgo.ssurgo.soilmu_a as m " |
- + "WITH (index(geom_sidx)) " |
- + "INNER JOIN ssurgo.mapunit ON m.mukey=ssurgo.mapunit.mukey " |
- + "WHERE m.the_geom.STIntersects(geometry::STPolyFromText(" + WKTPolygon + ",0)) = 1 " |
- + "AND m.the_geom.STIsValid()=1 " |
- + "AND (geometry::STPolyFromText(" + WKTPolygon + ",0).STIsValid())=1) " |
- + "as a;"; |
+ query = "SELECT areasymbol, musym, mukey, muname, geography::STGeomFromText( intersectPoly.STAsText(), 4326).MakeValid().STArea() / 4046.86 as sizeIntersectionAcres " |
+ //+ "geography::STPolyFromText(" + WKTPolygon + ",4326).MakeValid().ReorientObject().STIntersection(soilpoly).STArea() / 4046.86 as sizeIntersectionAcres " |
+ + " FROM " |
+ + " (SELECT m.areasymbol, m.musym, m.mukey, ssurgo.mapunit.muname, m.the_geom.STIntersection(geometry::STGeomFromText(" + WKTPolygon + ",0)).MakeValid() as intersectPoly" |
+ //+ " geography::STPolyFromText(m.the_geom.STAsText(),4326).MakeValid().ReorientObject() as soilpoly " |
+ + " FROM ssurgo.ssurgo.soilmu_a as m " |
+ + " WITH (index(geom_sidx)) " |
+ + " INNER JOIN ssurgo.mapunit ON m.mukey=ssurgo.mapunit.mukey " |
+ + " WHERE m.the_geom.STIntersects(geometry::STGeomFromText(" + WKTPolygon + ",0)) = 1 " |
+ + " AND m.the_geom.STIsValid()=1 " |
+ + " AND (geometry::STGeomFromText(" + WKTPolygon + ",0).STIsValid())=1) " |
+ + " as a;"; |
} else { |
query = "SELECT m.mukey, ssurgo.mapunit.muname, " |
+ "st_area(st_transform(st_intersection(ST_PolygonFromText(" + WKTPolygon + ", 4326), m.the_geom::geography::geometry ),3541))/43560 as sizeIntersectionAcres " |
@@ -699,7 +699,7 @@ |
haveHzDepth = true; |
} |
|
- if (this.taxorder.equals("Histosols") && !horizon.getKffact_b() && !horizon.getKwfact_b()) { |
+ if ((null != this.taxorder) && this.taxorder.equals("Histosols") && !horizon.getKffact_b() && !horizon.getKwfact_b()) { |
this.kfactor = 0.02; |
} else { |
if (!haveKFactor) { |
@@ -726,7 +726,9 @@ |
comp_product += horizonProduct; |
} |
|
- this.coarseFrag = comp_product / profile_thk; |
+ if ( profile_thk > 0 ){ |
+ this.coarseFrag = comp_product / profile_thk; |
+ } |
} |
|
class horizon implements Comparable<V1_0.Component.horizon> { |