Displaying differences for changeset
 
display as  

nbproject/build-impl.xml

@@ -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"/>

nbproject/genfiles.properties

@@ -16,8 +16,8 @@
 build.xml.stylesheet.CRC32=651128d4@1.65.1.1
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=2c73d12a
-nbproject/build-impl.xml.script.CRC32=bbc69bad
+nbproject/build-impl.xml.data.CRC32=3105c9f4
+nbproject/build-impl.xml.script.CRC32=0cd2cd2b
 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1
 nbproject/rest-build.xml.data.CRC32=bff4a8fe
 nbproject/rest-build.xml.script.CRC32=4734534b

nbproject/project.properties

@@ -141,11 +141,12 @@
 javac.classpath=\
     ${libs.PostgreSQLDriver.classpath}:\
     ${reference.csip-core-1.jar}:\
-    ${libs.csip-jersey-2.16.classpath}
+    ${libs.CSIP-Jersey-2.16.classpath}:\
+    ${libs.Microsoft_SQLServer_4.2_JDBC.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=
 javac.debug=true
-javac.deprecation=false
+javac.deprecation=true
 javac.processorpath=\
     ${javac.classpath}
 javac.source=1.7

nbproject/project.xml

@@ -21,7 +21,11 @@
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${libs.csip-jersey-2.16.classpath}</file>
+                    <file>${libs.CSIP-Jersey-2.16.classpath}</file>
+                    <path-in-war>WEB-INF/lib</path-in-war>
+                </library>
+                <library dirs="200">
+                    <file>${libs.Microsoft_SQLServer_4.2_JDBC.classpath}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
             </web-module-libraries>

src/java/m/wqm/wqmsoilattributes/V1_0.java

@@ -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> {