@@ -5,6 +5,7 @@ |
*/ |
package c; |
|
+import csip.Config; |
import java.sql.Connection; |
import java.sql.SQLException; |
import org.apache.commons.lang.NotImplementedException; |
@@ -14,30 +15,23 @@ |
* @author scase |
*/ |
public class GIS_DB_Factory { |
- public static GIS_DB createGISEngine(Connection connection) throws csip.ServiceException, SQLException, NotImplementedException { |
+ |
+ public static GIS_DB createGISEngine() throws Exception { |
+ //TODO: This section reserved for future use when an GISObjectConsumer is created that does not use a database engine to conduct GIS operations. |
GIS_DB ret_val = null; |
+ |
+ // Return pg connection, unless mssql is specified in config param |
+ String db = Config.getString("conservation_resources.database", "pg"); |
+ if (db.contentEquals("mssql")) { |
+ ret_val = new MsSQLGIS(); |
+ } |
+ else { |
+ ret_val = PostGIS.singleton(); |
+ //throw new NotImplementedException("Unsupported DBMS type specified. " + connection.getMetaData().getDatabaseProductName() + " is not implemented."); |
+ } |
|
- //TODO: create the appropriate GISObjectConsumers here...Need one for PostgreSQL as well...Need an improved implementation of the old csip-gis-utils that has been decoupled and does not use temp tables, |
- if (connection.getMetaData().getDatabaseProductName().contains("Microsoft SQL")) { |
- ret_val = new MsSQLGIS( connection ); |
- } |
- else{ |
- throw new NotImplementedException("Unsupported DBMS type specified. " + connection.getMetaData().getDatabaseProductName() + " is not implemented."); |
- } |
return ret_val; |
} |
|
-// uncomment for PostgreSQL Server implementation |
- public static GIS_DB createGISEngine() throws Exception { |
- //TODO: This section reserved for future use when an GISObjectConsumer is created that does not use a database engine to conduct GIS operations. |
- return PostGIS.singleton(); |
- } |
- |
-// uncomment for MS SQL Server implementation |
-// public static GIS_DB createGISEngine() throws Exception { |
-// //TODO: This section reserved for future use when an GISObjectConsumer is created that does not use a database engine to conduct GIS operations. |
-// return new MsSQLGIS(); |
-// } |
- |
} |
|
\ No newline at end of file |
@@ -47,21 +47,19 @@ |
|
// weps, weps.version is in the csip-conf.file |
@Resource(type = EXECUTABLE, file = "/bin/${arch}/${weps.version}/weps.exe", id = WEPS_EXE) |
-//@Resource(type = EXECUTABLE, file = "/bin/${csip.arch}/weps", id = WEPS_EXE) |
-////@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/weps-1.3.9", id = WEPS_EXE) |
+ |
// cligen |
@Resource(type = EXECUTABLE, file = "/bin/${arch}/cligen.exe", id = CLIGEN) |
-//@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/cligen", id = CLIGEN) |
@Resource(type = FILE, file = "/data/upd_US_cligen_stations.par", id = STATION_PAR) |
+ |
// windgen |
@Resource(type = EXECUTABLE, file = "/bin/win-x86/wind_gen4.exe", wine = true, id = WINDGEN) |
@Resource(type = EXECUTABLE, file = "/bin/${arch}/interpolate.exe", id = INTERPOLATE) |
-////@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/interpolate", id = INTERPOLATE) |
@Resource(type = EXECUTABLE, file = "/bin/${arch}/interp_wdb.exe", id = INTERP_WDB) |
-////@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/interp_wdb", id = INTERP_WDB) |
@Resource(type = FILE, file = "/data/wind_gen_his_upper_US_NRCS.idx", id = WINDGEN_IDX) |
@Resource(type = FILE, file = "/data/wind_gen_his_upper_US.wdb", id = DEFAULT_WIND_STATION_DB) |
@Resource(type = FILE, file = "/data/interpolation_boundary.pol", id = BOUNDARY_POL) |
+ |
// report |
@Resource(type = FILE, file = "/data/weps_report.json", id = REPORT_JSON_ID) |
|