src/java/m/example/gis_objects/V1_0.java
@@ -6,6 +6,8 @@ |
package m.example.gis_objects; |
|
import GISObjects.GISObject; |
+import GISObjects.GISObjectConsumerFactory; |
+import GISObjects.GISObjectFactory; |
import csip.ModelDataService; |
import csip.ServiceException; |
import csip.annotations.Resource; |
@@ -56,21 +58,20 @@ |
protected void doProcess() throws ServiceException { |
GISObject inputGIS; |
try (Connection connection = getResourceJDBC("mssql");) { |
- GISObjects.GISObjectFactory.setGISObjectFactory(new GISObjects.MSSQL_GISObjectConsumer(connection)); |
+ GISObjectFactory.setGISObjectEngine(GISObjectConsumerFactory.createGISEngine(connection)); |
inputGIS = GISObjects.GISObjectFactory.createGISObject(aoa_geometry); |
- |
+ |
finalArea = inputGIS.areaInAcres(); |
- |
- |
+ |
} catch (SQLException | JSONException | IOException ex) { |
LOG.log(Level.SEVERE, null, ex); |
throw new csip.ServiceException("Cannot process request: ", ex); |
} |
} |
- |
+ |
@Override |
- protected void postProcess() throws csip.ServiceException{ |
- putResult("area", finalArea,"Area of the aoa_geometry specified", "Acres" ); |
+ protected void postProcess() throws csip.ServiceException { |
+ putResult("area", finalArea, "Area of the aoa_geometry specified", "Acres"); |
} |
|
} |