BusStopLevel.java
9.58 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
package com.bsth.data.commonData.entity;
import com.bsth.entity.*;
import com.bsth.util.GeoConverter;
import org.geolatte.geom.Point;
import org.geolatte.geom.Polygon;
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 BusStopLevel implements Cloneable{
//线路基础信息编号
private String Line_base_id;
//站点id
private String station;
//站点名称
private String station_name;
//站点路由序号
private Integer station_route_code;
//线路编码
private String line_code;
//站点编码
private String station_code;
//站点类别<B:起点站;Z:中途站;E:终点站;T:停车场>
private String station_mark;
//站点路由出站序号
private Integer out_station_nmber;
//站点路由方向
private Integer directions;
//站点路由到站距离
private Double distances;
//站点路由到站时间
private Double to_time;
//首班时间
private String first_time;
//末班时间
private String end_time;
//描述
private String descriptions;
//是否撤销
private Integer destroy;
//版本
private Integer versions;
//创建人
private String create_by;
//创建日期
private Date create_date;
//修改人
private String update_by;
//修改日期
private Date update_date;
//行业编码
private String industry_code;
//与下一站距离(米)
private Double last_stop_distance;
//线路名称
private String line_name;
//缓冲区几何图形类型 d 多边形 r 圆形
private String shaped_type;
//缓冲区为圆形时的半径(米)
private Integer radius;
//多边形缓冲区坐标百度 POLYGON((lon lat, lon lat))
private String buffer_polygon_wkt;
//中心点 数字格式 百度
private String centerPointWkt;
public static StationRoute convert(BusStopLevel bsl){
StationRoute stationRoute = new StationRoute();
stationRoute.setStationRouteCode(bsl.getStation_route_code());
stationRoute.setStationCode(bsl.getStation_code());
Line line=new Line();
line.setId(Integer.parseInt(bsl.getLine_code()));
stationRoute.setLine(line);
Station station=new Station();
station.setId(Integer.parseInt(bsl.getStation_code()));
stationRoute.setStation(station);
stationRoute.setStationName(bsl.getStation_name());
stationRoute.setLineCode(bsl.getLine_code());
stationRoute.setStationMark(bsl.getStation_mark());
stationRoute.setDistances(bsl.getDistances());
stationRoute.setToTime(bsl.getTo_time());
stationRoute.setFirstTime(bsl.getFirst_time());
stationRoute.setEndTime(bsl.getEnd_time());
stationRoute.setDirections(bsl.getDirections());
stationRoute.setVersions(1);
stationRoute.setDestroy(bsl.getDestroy());
stationRoute.setDescriptions(bsl.getDescriptions());
stationRoute.setShapedType(bsl.getShaped_type());
stationRoute.setRadius(bsl.getRadius());
if (!StringUtils.isEmpty(bsl.getBuffer_polygon_wkt())) {
stationRoute.setBufferPolygon((Polygon) Wkt.fromWkt(bsl.getBuffer_polygon_wkt()));
stationRoute.setBufferPolygonWgs(GeoConverter.polygonBd2wgs(bsl.getBuffer_polygon_wkt()));
}
if (!StringUtils.isEmpty(bsl.getCenterPointWkt())) {
Point baidu = (Point) Wkt.fromWkt(bsl.getCenterPointWkt());
Point wgs = GeoConverter.pointBd2wgs(bsl.getCenterPointWkt());
stationRoute.setCenterPoint(baidu);
stationRoute.setCenterPointWgs(wgs);
}
stationRoute.setCreateDate(new java.sql.Date(new Date().getTime()));
stationRoute.setUpdateDate(new java.sql.Date(new Date().getTime()));
return stationRoute;
}
public static List<StationRoute> convert(List<BusStopLevel> busStopLevels){
List<StationRoute> list = new ArrayList<>();
for (BusStopLevel bsl : busStopLevels) {
list.add(convert(bsl));
}
return list;
}
public static LsStationRoute convertLS(BusStopLevel bsl){
LsStationRoute stationRoute = new LsStationRoute();
stationRoute.setStationRouteCode(bsl.getStation_route_code());
stationRoute.setStationCode(bsl.getStation_code());
Line line=new Line();
line.setId(Integer.parseInt(bsl.getLine_code()));
stationRoute.setLine(line);
Station station=new Station();
station.setId(Integer.parseInt(bsl.getStation_code()));
stationRoute.setStation(station);
stationRoute.setStationName(bsl.getStation_name());
stationRoute.setLineCode(bsl.getLine_code());
stationRoute.setStationMark(bsl.getStation_mark());
stationRoute.setDistances(bsl.getDistances());
stationRoute.setToTime(bsl.getTo_time());
stationRoute.setFirstTime(bsl.getFirst_time());
stationRoute.setEndTime(bsl.getEnd_time());
stationRoute.setDirections(bsl.getDirections());
stationRoute.setVersions(1);
stationRoute.setDestroy(bsl.getDestroy());
stationRoute.setDescriptions(bsl.getDescriptions());
stationRoute.setShapedType(bsl.getShaped_type());
stationRoute.setRadius(bsl.getRadius());
if (!StringUtils.isEmpty(bsl.getBuffer_polygon_wkt())) {
stationRoute.setBufferPolygon((Polygon) Wkt.fromWkt(bsl.getBuffer_polygon_wkt()));
stationRoute.setBufferPolygonWgs(GeoConverter.polygonBd2wgs(bsl.getBuffer_polygon_wkt()));
}
if (!StringUtils.isEmpty(bsl.getCenterPointWkt())) {
Point baidu = (Point) Wkt.fromWkt(bsl.getCenterPointWkt());
Point wgs = GeoConverter.pointBd2wgs(bsl.getCenterPointWkt());
stationRoute.setCenterPoint(baidu);
stationRoute.setCenterPointWgs(wgs);
}
stationRoute.setCreateDate(new java.sql.Date(new Date().getTime()));
stationRoute.setUpdateDate(new java.sql.Date(new Date().getTime()));
return stationRoute;
}
public static List<LsStationRoute> convertLS(List<BusStopLevel> busStopLevels){
List<LsStationRoute> list = new ArrayList<>();
for (BusStopLevel bsl : busStopLevels) {
list.add(convertLS(bsl));
}
return list;
}
public String getLine_base_id() {
return Line_base_id;
}
public void setLine_base_id(String line_base_id) {
Line_base_id = line_base_id;
}
public String getStation() {
return station;
}
public void setStation(String station) {
this.station = station;
}
public String getStation_name() {
return station_name;
}
public void setStation_name(String station_name) {
this.station_name = station_name;
}
public Integer getStation_route_code() {
return station_route_code;
}
public void setStation_route_code(Integer station_route_code) {
this.station_route_code = station_route_code;
}
public String getLine_code() {
return line_code;
}
public void setLine_code(String line_code) {
this.line_code = line_code;
}
public String getStation_code() {
return station_code;
}
public void setStation_code(String station_code) {
this.station_code = station_code;
}
public String getStation_mark() {
return station_mark;
}
public void setStation_mark(String station_mark) {
this.station_mark = station_mark;
}
public Integer getOut_station_nmber() {
return out_station_nmber;
}
public void setOut_station_nmber(Integer out_station_nmber) {
this.out_station_nmber = out_station_nmber;
}
public Integer getDirections() {
return directions;
}
public void setDirections(Integer directions) {
this.directions = directions;
}
public Double getDistances() {
return distances;
}
public void setDistances(Double distances) {
this.distances = distances;
}
public Double getTo_time() {
return to_time;
}
public void setTo_time(Double to_time) {
this.to_time = to_time;
}
public String getFirst_time() {
return first_time;
}
public void setFirst_time(String first_time) {
this.first_time = first_time;
}
public String getEnd_time() {
return end_time;
}
public void setEnd_time(String end_time) {
this.end_time = end_time;
}
public String getDescriptions() {
return descriptions;
}
public void setDescriptions(String descriptions) {
this.descriptions = descriptions;
}
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 getCreate_by() {
return create_by;
}
public void setCreate_by(String create_by) {
this.create_by = create_by;
}
public Date getCreate_date() {
return create_date;
}
public void setCreate_date(Date create_date) {
this.create_date = create_date;
}
public String getUpdate_by() {
return update_by;
}
public void setUpdate_by(String update_by) {
this.update_by = update_by;
}
public Date getUpdate_date() {
return update_date;
}
public void setUpdate_date(Date update_date) {
this.update_date = update_date;
}
public String getIndustry_code() {
return industry_code;
}
public void setIndustry_code(String industry_code) {
this.industry_code = industry_code;
}
public Double getLast_stop_distance() {
return last_stop_distance;
}
public void setLast_stop_distance(Double last_stop_distance) {
this.last_stop_distance = last_stop_distance;
}
public String getLine_name() {
return line_name;
}
public void setLine_name(String line_name) {
this.line_name = line_name;
}
public String getShaped_type() {
return shaped_type;
}
public void setShaped_type(String shaped_type) {
this.shaped_type = shaped_type;
}
public Integer getRadius() {
return radius;
}
public void setRadius(Integer radius) {
this.radius = radius;
}
public String getBuffer_polygon_wkt() {
return buffer_polygon_wkt;
}
public void setBuffer_polygon_wkt(String buffer_polygon_wkt) {
this.buffer_polygon_wkt = buffer_polygon_wkt;
}
public String getCenterPointWkt() {
return centerPointWkt;
}
public void setCenterPointWkt(String centerPointWkt) {
this.centerPointWkt = centerPointWkt;
}
}