链路地理坐标索引适配 - smile0821/learngit GitHub Wiki
if (StringUtils.equals(linkPointGeoVO.getStartNeX() + "" + linkPointGeoVO.getStartNeY(), linkPointGeoVO.getEndNeX() + "" + linkPointGeoVO.getEndNeY())) { location.setType(GeoTypeEnum.POINT.getType()); location.setCoordinates(new ArrayList(Arrays.asList(transStartLng, transStartLat))); } else { location.setType(GeoTypeEnum.LINESTRING.getType()); location.setCoordinates(new ArrayList<List>(Arrays.asList( Arrays.asList(transStartLng, transStartLat), Arrays.asList(transEndLng, transEndLat)))); } public class PolygonGeoObject implements Serializable { private static final long serialVersionUID = 1L;
@JsonProperty("type")
private String type = null;
@JsonProperty("coordinates")
private List coordinates = null;
public PolygonGeoObject()
{
super();
}
/**
* 类型,可选值:[\"LineString\"]
**/
public String getType()
{
return type;
}
public void setType(String type_in)
{
this.type = type_in;
}
/**
* 坐标点
**/
public List getCoordinates()
{
return coordinates;
}
public void setCoordinates(List coordinates_in)
{
this.coordinates = coordinates_in;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PolygonGeoObject polygonGeoObject = (PolygonGeoObject) o;
return Objects.equals(type,
polygonGeoObject.type)
&& Objects.equals(coordinates,
polygonGeoObject.coordinates);
}
@Override
public int hashCode() {
return Objects.hash(type
, coordinates);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PolygonGeoObject {\n");
sb.append(" type: ").append(type).append("\n");
sb.append(" coordinates: ").append(coordinates).append("\n");
sb.append("}\n");
return sb.toString();
}
}