geoportal-data-viewer-app/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wfs/FeatureGeometry.java

73 lines
1.5 KiB
Java
Raw Normal View History

package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs;
2020-10-29 17:48:20 +01:00
import java.io.Serializable;
/**
* The Class FeatureGeometry.
2020-10-29 17:48:20 +01:00
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
2020-10-29 17:48:20 +01:00
*
* Sep 6, 2021
2020-10-29 17:48:20 +01:00
*/
2020-11-19 15:19:27 +01:00
public class FeatureGeometry implements WFSGeometry, Serializable {
2020-11-02 18:18:03 +01:00
/**
*
*/
private static final long serialVersionUID = 8134176011135233810L;
2020-11-02 18:18:03 +01:00
private String type;
private String coordinatesJSON;
private String toJSON;
2020-11-19 15:19:27 +01:00
/**
* Instantiates a new feature geometry.
*/
2020-10-29 17:48:20 +01:00
public FeatureGeometry() {
}
2020-11-19 15:19:27 +01:00
/**
* Instantiates a new feature geometry.
*
* @param type the type
* @param coordinatesJSON the coordinates JSON
*/
public FeatureGeometry(String type, String coordinatesJSON) {
2020-10-29 17:48:20 +01:00
super();
this.type = type;
this.coordinatesJSON = coordinatesJSON;
2020-10-29 17:48:20 +01:00
}
public String getType() {
return type;
}
public String getCoordinatesJSON() {
return coordinatesJSON;
}
2020-10-29 17:48:20 +01:00
public void setType(String type) {
this.type = type;
}
public void setCoordinatesJSON(String coordinatesJSON) {
this.coordinatesJSON = coordinatesJSON;
2020-10-29 17:48:20 +01:00
}
public String getToJSONObject() {
if(toJSON==null)
toJSON = "{\"type\":\""+type+"\",\"coordinates\":"+coordinatesJSON+"}";
return toJSON;
2020-10-29 17:48:20 +01:00
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("FeatureGeometry [type=");
builder.append(type);
builder.append(", coordinatesJSON=");
builder.append(coordinatesJSON);
2020-10-29 17:48:20 +01:00
builder.append("]");
return builder.toString();
}
}