org.maptalks.geojson.Feature Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geojson4j Show documentation
Show all versions of geojson4j Show documentation
GeoJSON Serilization and mutual conversion with JSON .
The newest version!
package org.maptalks.geojson;
import java.util.Map;
public class Feature extends GeoJSON {
private Object id;
private Geometry geometry;
private Map properties;
public Feature(
Geometry geometry,
Map properties) {
this(null, geometry,properties);
}
public Feature(Object id,
Geometry geometry,
Map properties) {
super();
this.setId(id);
this.setGeometry(geometry);
this.setProperties(properties);
}
public Feature(
Geometry geometry) {
this(geometry,null);
}
public Feature() {
super();
}
public Geometry getGeometry() {
return geometry;
}
public void setGeometry(Geometry geometry) {
this.geometry = geometry;
}
public Map getProperties() {
return properties;
}
public void setProperties(Map properties) {
this.properties = properties;
}
public Object getId() {
return id;
}
public void setId(Object id) {
this.id = id;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Feature)) {
return false;
}
Feature o = ((Feature) obj);
if (this.geometry == null) {
if (o.geometry != null) {
return false;
}
} else if (!this.geometry.equals(o.getGeometry())) {
return false;
}
if (this.properties == null) {
if (o.properties != null) {
return false;
}
} else if (!this.properties.equals(o.getProperties())) {
return false;
}
if (this.id == null) {
if (o.id != null) {
return false;
}
}else if (!this.id.equals(o.id)) {
return false;
}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy