Updated Geospatial Coordinates

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@111920 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-02-11 17:56:41 +00:00
parent 75c9b00158
commit 13304049b0
3 changed files with 43 additions and 12 deletions

View File

@ -8,6 +8,7 @@ import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.O
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
import org.gcube.data.analysis.tabulardata.model.column.ColumnLocalId;
import org.gcube.data.analysis.tabulardata.model.column.ColumnReference;
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDNumeric;
import org.gcube.data.analysis.tabulardata.model.table.TableId;
import org.gcube.data.analysis.tabulardata.service.TabularDataService;
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
@ -101,6 +102,11 @@ public class OpExecution4GeospatialCreateCoordinates extends OpExecutionBuilder
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_USER,
aslSession.getUsername());
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_RESOLUTION,
new TDNumeric(geospatialCreateCoordinatesSession.getResolution()));
switch(geospatialCreateCoordinatesSession.getType()){
case C_SQUARE:
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_FEATURE,
@ -110,8 +116,22 @@ public class OpExecution4GeospatialCreateCoordinates extends OpExecutionBuilder
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_FEATURE,
geospatialCreateCoordinatesSession.getType().getId());
if(geospatialCreateCoordinatesSession.isHasQuadrant()){
ColumnData quadrantColumn = geospatialCreateCoordinatesSession
.getQuadrant();
logger.debug("Quadrant Column: " + quadrantColumn);
if (quadrantColumn == null) {
logger.error("Error Creating Geospatial Coordinates: Quadrant Column is null");
throw new TDGWTServiceException("No quadrant column set");
}
ColumnLocalId quadrantId = new ColumnLocalId(
quadrantColumn.getColumnId());
ColumnReference quadrantColumnReference = new ColumnReference(tId,
quadrantId);
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_QUADRANT,
geospatialCreateCoordinatesSession.getQuadrant());
quadrantColumnReference);
}
break;
default:

View File

@ -114,6 +114,7 @@ public class Constants {
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_LATITUDE = "latitude";
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_LONGITUDE = "longitude";
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_FEATURE = "feature";
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_RESOLUTION = "resolution";
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_USER = "user";
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_QUADRANT = "quadrant";

View File

@ -21,6 +21,7 @@ public class GeospatialCreateCoordinatesSession implements Serializable {
private GeospatialCoordinatesType type;
private boolean hasQuadrant;
private ColumnData quadrant;
private Double resolution;
public GeospatialCreateCoordinatesSession() {
}
@ -31,18 +32,24 @@ public class GeospatialCreateCoordinatesSession implements Serializable {
* @param latitude
* @param longitude
* @param type
* @param hasQuadrant TODO
* @param quadrant TODO
* @param hasQuadrant
* TODO
* @param quadrant
* TODO
* @param resolution
* TODO
*/
public GeospatialCreateCoordinatesSession(TRId trId, ColumnData latitude,
ColumnData longitude, GeospatialCoordinatesType type, boolean hasQuadrant, ColumnData quadrant) {
ColumnData longitude, GeospatialCoordinatesType type,
boolean hasQuadrant, ColumnData quadrant, Double resolution) {
super();
this.trId = trId;
this.latitude = latitude;
this.longitude = longitude;
this.type = type;
this.hasQuadrant=hasQuadrant;
this.quadrant=quadrant;
this.hasQuadrant = hasQuadrant;
this.quadrant = quadrant;
this.resolution = resolution;
}
public TRId getTrId() {
@ -93,17 +100,20 @@ public class GeospatialCreateCoordinatesSession implements Serializable {
this.quadrant = quadrant;
}
public Double getResolution() {
return resolution;
}
public void setResolution(Double resolution) {
this.resolution = resolution;
}
@Override
public String toString() {
return "GeospatialCreateCoordinatesSession [trId=" + trId
+ ", latitude=" + latitude + ", longitude=" + longitude
+ ", type=" + type + ", hasQuadrant=" + hasQuadrant
+ ", quadrant=" + quadrant + "]";
+ ", quadrant=" + quadrant + ", resolution=" + resolution + "]";
}
}