Displaying differences for changeset
 
display as  

src/java/c/PostGIS.java

@@ -503,10 +503,15 @@
 //                lat + ")' ), geometry)) AS s WHERE m.musym = s.musym  LIMIT 1;");
     }
     
+   
+    //
+    // fix me
+    //
+    // added string matching to fix a problem which requires us to regenerate r2 soils
     public FileQryResult findSoilsByCokey(String cokey, double lon) throws SQLException {
         return find ("SELECT distinct m.musym, r2_path, r2_name FROM soil_geom AS g, map_soils AS m " +
                      "WHERE m.cokey='" + cokey + "' " +
-                     "AND g.mukey = m.mukey limit 1; ", lon);
+                     "AND g.mukey = m.mukey and m.r2_name like '%' || m.compname || '%' limit 1; ", lon);
     }
 
     // To calculate area in acres, we use the st_transform function to transform the intersection polygon into
@@ -549,6 +554,8 @@
             _polygon = polygon;
             poly_longitude = -90.111;
         }
+        // added a fix "and m.r2_name like '%' || m.compname || '%'" to the end of this query because
+        // soils have duplicate records presently, and need to be regenerated...
         return findPolygonsWithSand ("SELECT m.co_fips, m.musym, m.mukey, r2_path, r2_name, m.muname, " +
                              "m.compname, m.kffact, m.tfact, m.slope_r, m.cokey, m.sandtotal_r, " +
                              "st_area(st_intersection(" + _polygon +
@@ -562,7 +569,7 @@
                              "AND g.mukey = m.mukey " +
                              "and st_isvalid(geometry)='t' " +
                              "and st_isvalid(" + _polygon + 
-                             ")='t';", poly_longitude);
+                             ")='t' and m.r2_name like '%' || m.compname || '%';", poly_longitude);
     }
 
     
@@ -591,7 +598,7 @@
                              "AND g.mukey = m.mukey " +
                              "and st_isvalid(geometry)='t' " +
                              "and st_isvalid(" + _polygon + 
-                             ")='t';", poly_longitude);
+                             ")='t'", poly_longitude);
     }
     
     

src/java/d/rusle2/climateQuery.sh

@@ -1,3 +1,3 @@
-#curl -X POST -H "Content-Type: application/json" http://csip.engr.colostate.edu:8081/csip/d/rusle2/climate/1.0 -d @./climateReqEpa1.json
+curl -X POST -H "Content-Type: application/json" http://csip.engr.colostate.edu:8081/csip/d/rusle2/climate/1.0 -d @./climateReqEpa1.json
 #curl -X POST -H "Content-Type: application/json" http://csip.engr.colostate.edu:8090/csip-erosion/d/rusle2/climate/1.0 -d @./climateReqEpa1.json
-curl -X POST -H "Content-Type: application/json" http://csip.engr.colostate.edu:8090/csip-erosion/d/rusle2/climate/1.0 -d @./climateReqHawaii.json
+#curl -X POST -H "Content-Type: application/json" http://csip.engr.colostate.edu:8090/csip-erosion/d/rusle2/climate/1.0 -d @./climateReqHawaii.json