Updated Geometry Type Support
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@100057 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
88f9961bc5
commit
9b44bbbba3
|
@ -5,6 +5,7 @@ import java.util.Date;
|
|||
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDBoolean;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDDate;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDGeometry;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDInteger;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDNumeric;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDText;
|
||||
|
@ -40,16 +41,16 @@ public class TDTypeValueMap {
|
|||
try{
|
||||
d=sdf.parse(value);
|
||||
}catch(Exception e){
|
||||
throw new TDGWTServiceException("Error in TDTypeValueMap: "
|
||||
+ e.getLocalizedMessage());
|
||||
throw new TDGWTServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
tdTypeValue=new TDDate(d);
|
||||
break;
|
||||
case "Geometry":
|
||||
if(value==null){
|
||||
value=new String();
|
||||
}
|
||||
tdTypeValue = new TDText(value);
|
||||
if(TDGeometry.validateGeometry(value)){
|
||||
tdTypeValue = new TDGeometry(value);
|
||||
} else {
|
||||
throw new TDGWTServiceException("The value "+ value+ " is not a valid geometry");
|
||||
}
|
||||
break;
|
||||
case "Integer":
|
||||
Integer in = new Integer(value);
|
||||
|
@ -93,13 +94,16 @@ public class TDTypeValueMap {
|
|||
try{
|
||||
d=sdf.parse(value);
|
||||
}catch(Exception e){
|
||||
throw new TDGWTServiceException("Error in TDTypeValueMap: "
|
||||
+ e.getLocalizedMessage());
|
||||
throw new TDGWTServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
tdTypeValue=new TDDate(d);
|
||||
break;
|
||||
case Geometry:
|
||||
tdTypeValue = new TDText(value);
|
||||
if(TDGeometry.validateGeometry(value)){
|
||||
tdTypeValue = new TDGeometry(value);
|
||||
} else {
|
||||
throw new TDGWTServiceException("The value "+ value+ " is not a valid geometry");
|
||||
}
|
||||
break;
|
||||
case Integer:
|
||||
Integer in = new Integer(value);
|
||||
|
|
|
@ -12,6 +12,7 @@ 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.TDBoolean;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDDate;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDGeometry;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDInteger;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDNumeric;
|
||||
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDText;
|
||||
|
@ -127,10 +128,13 @@ public class ValueMap {
|
|||
} else {
|
||||
if (col.getDataTypeName().compareTo(
|
||||
ColumnDataType.Geometry.toString()) == 0) {
|
||||
if(value==null){
|
||||
TDGeometry tdGeometry;
|
||||
if(TDGeometry.validateGeometry(value)){
|
||||
tdGeometry=new TDGeometry(value);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
TDText tdGeometry=new TDText(value);
|
||||
|
||||
}
|
||||
ColumnLocalId columnId=new ColumnLocalId(key);
|
||||
ColumnReference colRef=new ColumnReference(tableId, columnId);
|
||||
Map<String,Object> valueMap=new HashMap<String,Object>();
|
||||
|
|
Loading…
Reference in New Issue