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:
parent
75c9b00158
commit
13304049b0
|
@ -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.commons.webservice.types.operations.OperationExecution;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.ColumnLocalId;
|
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.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.model.table.TableId;
|
||||||
import org.gcube.data.analysis.tabulardata.service.TabularDataService;
|
import org.gcube.data.analysis.tabulardata.service.TabularDataService;
|
||||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
|
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,
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_USER,
|
||||||
aslSession.getUsername());
|
aslSession.getUsername());
|
||||||
|
|
||||||
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_RESOLUTION,
|
||||||
|
new TDNumeric(geospatialCreateCoordinatesSession.getResolution()));
|
||||||
|
|
||||||
|
|
||||||
switch(geospatialCreateCoordinatesSession.getType()){
|
switch(geospatialCreateCoordinatesSession.getType()){
|
||||||
case C_SQUARE:
|
case C_SQUARE:
|
||||||
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_FEATURE,
|
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,
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_FEATURE,
|
||||||
geospatialCreateCoordinatesSession.getType().getId());
|
geospatialCreateCoordinatesSession.getType().getId());
|
||||||
if(geospatialCreateCoordinatesSession.isHasQuadrant()){
|
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,
|
map.put(Constants.PARAMETER_GEOSPATIAL_CREATE_COORDINATES_QUADRANT,
|
||||||
geospatialCreateCoordinatesSession.getQuadrant());
|
quadrantColumnReference);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -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_LATITUDE = "latitude";
|
||||||
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_LONGITUDE = "longitude";
|
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_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_USER = "user";
|
||||||
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_QUADRANT = "quadrant";
|
public static final String PARAMETER_GEOSPATIAL_CREATE_COORDINATES_QUADRANT = "quadrant";
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class GeospatialCreateCoordinatesSession implements Serializable {
|
||||||
private GeospatialCoordinatesType type;
|
private GeospatialCoordinatesType type;
|
||||||
private boolean hasQuadrant;
|
private boolean hasQuadrant;
|
||||||
private ColumnData quadrant;
|
private ColumnData quadrant;
|
||||||
|
private Double resolution;
|
||||||
|
|
||||||
public GeospatialCreateCoordinatesSession() {
|
public GeospatialCreateCoordinatesSession() {
|
||||||
}
|
}
|
||||||
|
@ -31,18 +32,24 @@ public class GeospatialCreateCoordinatesSession implements Serializable {
|
||||||
* @param latitude
|
* @param latitude
|
||||||
* @param longitude
|
* @param longitude
|
||||||
* @param type
|
* @param type
|
||||||
* @param hasQuadrant TODO
|
* @param hasQuadrant
|
||||||
* @param quadrant TODO
|
* TODO
|
||||||
|
* @param quadrant
|
||||||
|
* TODO
|
||||||
|
* @param resolution
|
||||||
|
* TODO
|
||||||
*/
|
*/
|
||||||
public GeospatialCreateCoordinatesSession(TRId trId, ColumnData latitude,
|
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();
|
super();
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.latitude = latitude;
|
this.latitude = latitude;
|
||||||
this.longitude = longitude;
|
this.longitude = longitude;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.hasQuadrant=hasQuadrant;
|
this.hasQuadrant = hasQuadrant;
|
||||||
this.quadrant=quadrant;
|
this.quadrant = quadrant;
|
||||||
|
this.resolution = resolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TRId getTrId() {
|
public TRId getTrId() {
|
||||||
|
@ -93,17 +100,20 @@ public class GeospatialCreateCoordinatesSession implements Serializable {
|
||||||
this.quadrant = quadrant;
|
this.quadrant = quadrant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Double getResolution() {
|
||||||
|
return resolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResolution(Double resolution) {
|
||||||
|
this.resolution = resolution;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "GeospatialCreateCoordinatesSession [trId=" + trId
|
return "GeospatialCreateCoordinatesSession [trId=" + trId
|
||||||
+ ", latitude=" + latitude + ", longitude=" + longitude
|
+ ", latitude=" + latitude + ", longitude=" + longitude
|
||||||
+ ", type=" + type + ", hasQuadrant=" + hasQuadrant
|
+ ", type=" + type + ", hasQuadrant=" + hasQuadrant
|
||||||
+ ", quadrant=" + quadrant + "]";
|
+ ", quadrant=" + quadrant + ", resolution=" + resolution + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue