@@ -1,8 +1,8 @@ |
/* |
- * To change this license header, choose License Headers in Project Properties. |
- * To change this template file, choose Tools | Templates |
- * and open the template in the editor. |
- */ |
+* To change this license header, choose License Headers in Project Properties. |
+* To change this template file, choose Tools | Templates |
+* and open the template in the editor. |
+*/ |
package m.gis; |
|
import m.utils.IGISDatabase; |
@@ -18,32 +18,32 @@ |
* @author ktraff |
*/ |
public class GISModelDataService extends ModelDataService{ |
- |
- protected JSONArray result; |
+ |
+ protected JSONArray result; |
protected GeoJSON layers; |
protected int outputSRID; |
- |
+ |
protected IGISDatabase db; |
- |
+ |
@Override |
protected void preProcess() throws Exception { |
db = (IGISDatabase) new DatabaseBuilder() |
.setAll(DatabaseBuilder.DB.POSTGRES_GIS) |
.create(); |
result = new JSONArray(); |
- JSONArray geojson = getJSONArrayParam("layer"); |
+ JSONArray geojson = getJSONArrayParam("layer"); |
layers = new GeoJSON(geojson, db); |
- |
+ |
try { |
outputSRID = getIntParam("outputSRID"); |
} catch (ServiceException ex) { |
- outputSRID = GeoJSONParser.getSRIDInt(db.getDefaultCRS()); |
+ outputSRID = GeoJSONParser.getSRIDInt(db.getDefaultCRS()); |
} |
} |
- |
+ |
@Override |
protected void postProcess() throws Exception { |
putResult("layer", result); |
} |
- |
+ |
} |
@@ -1,8 +1,8 @@ |
/* |
- * To change this license header, choose License Headers in Project Properties. |
- * To change this template file, choose Tools | Templates |
- * and open the template in the editor. |
- */ |
+* To change this license header, choose License Headers in Project Properties. |
+* To change this template file, choose Tools | Templates |
+* and open the template in the editor. |
+*/ |
package m.gis.buffer; |
|
import static csip.ModelDataService.EXEC_OK; |
@@ -22,15 +22,15 @@ |
@Description("CSIP Buffer Service") |
@Path("m/buffer/1.0") |
public class V1_0 extends GISModelDataService { |
- |
+ |
JSONObject distance; |
- |
+ |
@Override |
protected void preProcess() throws Exception { |
- super.preProcess(); |
+ super.preProcess(); |
distance = getJSONParam("distance"); |
} |
- |
+ |
@Override |
protected String process() throws Exception { |
if (layers.size() > 0) { |
@@ -42,10 +42,10 @@ |
} |
return EXEC_OK; |
} |
- |
+ |
@Override |
protected void postProcess() throws Exception { |
- super.postProcess(); |
+ super.postProcess(); |
} |
- |
+ |
} |