BusStop.java
2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package com.bsth.data.commonData.entity;
import com.bsth.entity.Station;
import com.bsth.util.GeoConverter;
import org.geolatte.geom.Point;
import org.geolatte.geom.codec.Wkt;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BusStop implements Cloneable{
//站点编码
private String station_cod;
//站点名称
private String station_name;
//所在道路编码
private String road_coding;
//站址
private String STOP_ADDRESS;
//是否撤销<1:撤销;0:不撤销>
private Integer destroy=0;
//版本
private Integer versions;
//描述
private String descriptions;
//中心点 数字格式
private String centerPointWkt;
public static Station convert(BusStop busStop){
Station station = new Station();
station.setId(Integer.parseInt(busStop.getStation_cod()));
station.setStationCode(busStop.getStation_cod());
station.setStationName(busStop.getStation_name());
station.setRoadCoding(busStop.getRoad_coding());
station.setAddress(busStop.getSTOP_ADDRESS());
station.setDestroy(busStop.getDestroy());
station.setVersions(busStop.getVersions());
station.setDescriptions(busStop.getDescriptions());
station.setCreateDate(new java.sql.Date(new Date().getTime()));
station.setUpdateDate(new java.sql.Date(new Date().getTime()));
if (!StringUtils.isEmpty(busStop.getCenterPointWkt())) {
Point baidu = (Point) Wkt.fromWkt(busStop.getCenterPointWkt());
Point wgs = GeoConverter.pointBd2wgs(busStop.getCenterPointWkt());
station.setCenterPoint(baidu);
station.setCenterPointWgs(wgs);
}
return station;
}
public static List<Station> convert(List<BusStop> busStops){
List<Station> list = new ArrayList<>();
for (BusStop busStop : busStops) {
list.add(convert(busStop));
}
return list;
}
public String getStation_cod() {
return station_cod;
}
public void setStation_cod(String station_cod) {
this.station_cod = station_cod;
}
public String getStation_name() {
return station_name;
}
public void setStation_name(String station_name) {
this.station_name = station_name;
}
public String getRoad_coding() {
return road_coding;
}
public void setRoad_coding(String road_coding) {
this.road_coding = road_coding;
}
public String getSTOP_ADDRESS() {
return STOP_ADDRESS;
}
public void setSTOP_ADDRESS(String STOP_ADDRESS) {
this.STOP_ADDRESS = STOP_ADDRESS;
}
public Integer getDestroy() {
return destroy;
}
public void setDestroy(Integer destroy) {
this.destroy = destroy;
}
public Integer getVersions() {
return versions;
}
public void setVersions(Integer versions) {
this.versions = versions;
}
public String getDescriptions() {
return descriptions;
}
public void setDescriptions(String descriptions) {
this.descriptions = descriptions;
}
public String getCenterPointWkt() {
return centerPointWkt;
}
public void setCenterPointWkt(String centerPointWkt) {
this.centerPointWkt = centerPointWkt;
}
}