Displaying differences for changeset |
@@ -1035,6 +1035,7 @@ |
<copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
<copyfiles files="${reference.csip-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
<copyfiles files="${file.reference.postgresql-9.4-1201-jdbc41.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> |
+ <copyfiles files="${file.reference.sqljdbc4.jar}" 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> |
@@ -1042,6 +1043,7 @@ |
<copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> |
<copyfiles files="${reference.csip-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/> |
<copyfiles files="${file.reference.postgresql-9.4-1201-jdbc41.jar}" todir="${build.web.dir}/WEB-INF/lib"/> |
+ <copyfiles files="${file.reference.sqljdbc4.jar}" 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"/> |
@@ -3,8 +3,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=1f7a6d28 |
-nbproject/build-impl.xml.script.CRC32=3d75ab86 |
+nbproject/build-impl.xml.data.CRC32=3bb6f2b2 |
+nbproject/build-impl.xml.script.CRC32=172cc66e |
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.67.1.1 |
nbproject/rest-build.xml.data.CRC32=bff4a8fe |
nbproject/rest-build.xml.script.CRC32=4734534b |
@@ -34,6 +34,7 @@ |
${libs.javaee-endorsed-api-6.0.classpath} |
excludes= |
file.reference.postgresql-9.4-1201-jdbc41.jar=lib/postgresql-9.4-1201-jdbc41.jar |
+file.reference.sqljdbc4.jar=lib/sqljdbc4.jar |
includes=** |
j2ee.compile.on.save=false |
j2ee.copy.static.files.on.save=false |
@@ -45,7 +46,8 @@ |
javac.classpath=\ |
${libs.CSIP-Jersey-2.16.classpath}:\ |
${reference.csip-core.jar}:\ |
- ${file.reference.postgresql-9.4-1201-jdbc41.jar} |
+ ${file.reference.postgresql-9.4-1201-jdbc41.jar}:\ |
+ ${file.reference.sqljdbc4.jar} |
# Space-separated list of extra javac options |
javac.compilerargs= |
javac.debug=true |
@@ -24,6 +24,10 @@ |
<file>${file.reference.postgresql-9.4-1201-jdbc41.jar}</file> |
<path-in-war>WEB-INF/lib</path-in-war> |
</library> |
+ <library dirs="200"> |
+ <file>${file.reference.sqljdbc4.jar}</file> |
+ <path-in-war>WEB-INF/lib</path-in-war> |
+ </library> |
</web-module-libraries> |
<web-module-additional-libraries/> |
<source-roots> |
@@ -34,6 +34,7 @@ |
resources.add(csip.ArchiveService.class); |
resources.add(csip.CatalogService.class); |
resources.add(csip.ControlService.class); |
+ resources.add(csip.ModelDataService.class); |
resources.add(csip.QueryService.class); |
resources.add(csip.ReportService.class); |
resources.add(m.rse.cfactor.V1_0.class); |
@@ -142,7 +142,7 @@ |
+ " FROM [dbo].[c_factor]" |
+ " where (geometry::STGeomFromText('POINT(" + lon + " " + lat + ")', 4326).STIntersects([geometry])!= 0);"; |
- try (Connection c = PGTools.getConnection("cfactor", LOG)) { |
+ try (Connection c = PGTools.getConnection("legacy.cfactor", LOG)) { |
try (Statement s = c.createStatement()) { |
try (ResultSet r = s.executeQuery(intersect_polygons)) {; |
LOG.info("query sql=" + intersect_polygons); |
@@ -153,7 +153,7 @@ |
} |
// If no intersect find C-Factor using step 2 of algorithm |
if (!r.next()) { |
- try (Connection c2 = PGTools.getConnection("cfactor", LOG)) { |
+ try (Connection c2 = PGTools.getConnection("legacy.cfactor", LOG)) { |
try (Statement s2 = c2.createStatement()) { |
String dist_from_polylines = "SELECT [C_VALUE]" |
+ " ,(geometry::STGeomFromText('POINT(" + lon + " " + lat + ")', 4326).STDistance([geometry])) as distance" |
@@ -18,5 +18,8 @@ |
public static final String SERVICE_DESC = "Climatic erosivity reflecting wind speed and surface soil moisture; value 100 at Garden City, Kansas"; |
public static final double ALASKA_MIN_LATITUDE = 50.00; |
public static final double UNKNOWN_CFACTOR = -9999.99; |
+ |
+ public static final String RSE_DEPLOYMENT_WINDOWS = "windows"; |
+ public static final String RSE_DEPLOYMENT_LINUX = "linux"; |
} |
@@ -19,6 +19,7 @@ |
import java.util.logging.Logger; |
import javax.sql.DataSource; |
import java.util.ArrayList; |
+import static m.rse.cfactor.utils.Const.RSE_DEPLOYMENT_LINUX; |
import oms3.util.ProcessComponent; |
import org.apache.tomcat.jdbc.pool.DataSourceProxy; |
import org.apache.tomcat.jdbc.pool.PoolProperties; |
@@ -123,6 +124,7 @@ |
break; |
case "cfactor": |
+ case "legacy.cfactor": |
if (datasource == null || !confString.equals(connectionString)) { |
//Close previous datasource if it exists |
DataSourceProxy proxy = (DataSourceProxy) datasource; |
@@ -388,6 +390,8 @@ |
ProcessComponent pc = new ProcessComponent(); |
String dataDir = Config.getString("m.data.dir", "/tmp/csip-rse/data/"); |
+ String gdal = Config.getString("gdal.deployment",RSE_DEPLOYMENT_LINUX); |
+ String gdalwinpath = Config.getString("gdalwinpath","C:\\Program Files\\GDAL\\"); |
// linux based WEPS |
//pc.exe = |
@@ -395,8 +399,56 @@ |
String tifptr = Binaries.unpackResourceAbsolute("/us_cvalues_topo2ras_masked.tif", dataDir + "us_cvalues_topo2ras_masked.tif").toString(); |
Binaries.unpackResourceAbsolute("/us_cvalues_topo2ras_masked.tif.aux.xml", dataDir + "us_cvalues_topo2ras_masked.tif.aux.xml").toString(); |
logger.info("geotiff=" + tifptr); |
+ |
+ // Extract GDAL Library for Windows |
+ // |
+ if (gdal.equals(Const.RSE_DEPLOYMENT_WINDOWS)) |
+ { |
+ // GDAL required DLLs & EXE |
+ Binaries.unpackResourceAbsolute("/gdallocationinfo.exe", dataDir + "gdallocationinfo.exe").toString(); |
+ Binaries.unpackResourceAbsolute("/gdal111.dll", dataDir + "gdal111.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/geos.dll", dataDir + "geos.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/geos_c.dll", dataDir + "geos_c.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/iconv.dll", dataDir + "iconv.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/libcurl.dll", dataDir + "libcurl.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/libeay32.dll", dataDir + "libeay32.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/libexpat.dll", dataDir + "libexpat.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/libmysql.dll", dataDir + "libmysql.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/libpq.dll", dataDir + "libpq.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/openjp2.dll", dataDir + "openjp2.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/proj.dll", dataDir + "proj.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/spatialite.dll", dataDir + "spatialite.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/ssleay32.dll", dataDir + "ssleay32.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/xerces-c_2_8.dll", dataDir + "xerces-c_2_8.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/zlib1.dll", dataDir + "zlib1.dll").toString(); |
+ |
+ // Microsoft Visual C++ Redistributable Package 2010 - Service Pack 1 DLLs |
+ Binaries.unpackResourceAbsolute("/atl100.dll", dataDir + "atl100.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100chs.dll", dataDir + "mfc100chs.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100cht.dll", dataDir + "mfc100cht.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100deu.dll", dataDir + "mfc100deu.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100.dll", dataDir + "mfc100.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100enu.dll", dataDir + "mfc100enu.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100esn.dll", dataDir + "mfc100esn.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100fra.dll", dataDir + "mfc100fra.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100ita.dll", dataDir + "mfc100ita.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100jpn.dll", dataDir + "mfc100jpn.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100kor.dll", dataDir + "mfc100kor.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100rus.dll", dataDir + "mfc100rus.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfc100u.dll", dataDir + "mfc100u.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfcm100.dll", dataDir + "mfcm100.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/mfcm100u.dll", dataDir + "mfcm100u.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/msvcp100.dll", dataDir + "msvcp100.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/msvcr100.dll", dataDir + "msvcr100.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/propsys.dll", dataDir + "propsys.dll").toString(); |
+ Binaries.unpackResourceAbsolute("/vcomp100.dll", dataDir + "vcomp100.dll").toString(); |
+ } |
+ |
+ // to do |
+ // optionally we might bundle the GDAL files for Linux here as well |
- pc.exe = "gdallocationinfo"; |
+ //pc.exe = (gdal.equals(Const.RSE_DEPLOYMENT_WINDOWS) ? gdalwinpath : "") + "gdallocationinfo"; |
+ pc.exe = (gdal.equals(Const.RSE_DEPLOYMENT_WINDOWS) ? dataDir : "") + "gdallocationinfo"; |
pc.args = new String[]{tifptr, slon, slat, "-wgs84"}; |
File workDir = workspacedirectory; |
String sessionWorkDir = workDir.toString(); |
@@ -2,9 +2,11 @@ |
"csip.archive.enabled": false, |
"csip.logging.enabled": false, |
"csip.session.backend": "local", |
- "cfactor.db": "jdbc:sqlserver:\/\/129.82.20.241:1433;databaseName=ssurgo;user=sa;password=csurams#1", |
+ "gdal.deployment": "windows", |
"cfactor.db.driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver", |
"ssurgo.db":"jdbc:postgresql://csip.engr.colostate.edu:5435/ssurgo?user=postgres&password=admin", |
+ "cfactor.db": "jdbc:sqlserver:\/\/129.82.20.241:1433;databaseName=ssurgo;user=rset-r;password=cs1prs3t", |
+ "legacy.cfactor.db": "jdbc:sqlserver:\/\/129.82.20.244:1433;databaseName=csip_rse;user=sa;password=csurams#1", |
"ssrugo.db.driver":"org.postgresql.Driver", |
"lmod.version": "$version: 0.2.10 452c2816cec7 2015-05-20 $", |
"csip.session.ttl": "1000" |