RoadSection.java
5.13 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
package com.bsth.data.commonData.entity;
import com.bsth.entity.Section;
import com.bsth.util.GeoConverter;
import org.geolatte.geom.LineString;
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 RoadSection implements Cloneable{
//路段编码
private String section_code;
//路段名称
private String section_name;
//交叉路
private String croses_road;
//终止节点
private String end_node;
//起始节点
private String start_node;
//中间节点
private String middle_node;
//路段类型
private String section_type;
//路段矢量(空间坐标点集合)--城建坐标点
private String csection_vector;
//路段矢量(空间坐标点集合)--百度原始坐标坐标点
private String bsectionVectorWkt;
//路段矢量(空间坐标点集合)--GPS坐标点
private String gsectionVectorWkt;
//道路编码
private String road_coding;
//路段距离
private Double section_distance;
//路段时间
private Double section_time;
//经纬坐标类型
private String db_type;
//限速
private Double speed_limit;
//描述
private String descriptions;
//版本号
private Integer versions;
public static Section convert(RoadSection rs){
Section section = new Section();
section.setId(Integer.parseInt(rs.getSection_code()));
section.setSectionCode(rs.getSection_code());
section.setRoadCoding(rs.getRoad_coding());
section.setSectionName(rs.getSection_name());
section.setSectionDistance(rs.getSection_distance());
section.setSectionTime(rs.getSection_time());
section.setDbType(rs.getDb_type());
section.setSectionType(rs.getSection_type());
section.setCrosesRoad(rs.getCroses_road());
section.setStartNode(rs.getStart_node());
section.setMiddleNode(rs.getMiddle_node());
section.setEndNode(rs.getEnd_node());
section.setSpeedLimit(rs.getSpeed_limit());
section.setVersions(rs.getVersions());
section.setDescriptions(rs.getDescriptions());
if (!StringUtils.isEmpty(rs.getBsectionVectorWkt())) {
section.setBsectionVector((LineString) Wkt.fromWkt(rs.getBsectionVectorWkt()));
section.setGsectionVector(GeoConverter.lineStringBd2wgs(rs.getBsectionVectorWkt()));
}
section.setCreateDate(new java.sql.Date(new Date().getTime()));
section.setUpdateDate(new java.sql.Date(new Date().getTime()));
return section;
}
public static List<Section> convert(List<RoadSection> roadSections){
List<Section> list = new ArrayList<>();
for (RoadSection roadSection : roadSections) {
list.add(convert(roadSection));
}
return list;
}
public String getSection_code() {
return section_code;
}
public void setSection_code(String section_code) {
this.section_code = section_code;
}
public String getSection_name() {
return section_name;
}
public void setSection_name(String section_name) {
this.section_name = section_name;
}
public String getCroses_road() {
return croses_road;
}
public void setCroses_road(String croses_road) {
this.croses_road = croses_road;
}
public String getEnd_node() {
return end_node;
}
public void setEnd_node(String end_node) {
this.end_node = end_node;
}
public String getStart_node() {
return start_node;
}
public void setStart_node(String start_node) {
this.start_node = start_node;
}
public String getMiddle_node() {
return middle_node;
}
public void setMiddle_node(String middle_node) {
this.middle_node = middle_node;
}
public String getSection_type() {
return section_type;
}
public void setSection_type(String section_type) {
this.section_type = section_type;
}
public String getCsection_vector() {
return csection_vector;
}
public void setCsection_vector(String csection_vector) {
this.csection_vector = csection_vector;
}
public String getBsectionVectorWkt() {
return bsectionVectorWkt;
}
public void setBsectionVectorWkt(String bsectionVectorWkt) {
this.bsectionVectorWkt = bsectionVectorWkt;
}
public String getGsectionVectorWkt() {
return gsectionVectorWkt;
}
public void setGsectionVectorWkt(String gsectionVectorWkt) {
this.gsectionVectorWkt = gsectionVectorWkt;
}
public String getRoad_coding() {
return road_coding;
}
public void setRoad_coding(String road_coding) {
this.road_coding = road_coding;
}
public Double getSection_distance() {
return section_distance;
}
public void setSection_distance(Double section_distance) {
this.section_distance = section_distance;
}
public Double getSection_time() {
return section_time;
}
public void setSection_time(Double section_time) {
this.section_time = section_time;
}
public String getDb_type() {
return db_type;
}
public void setDb_type(String db_type) {
this.db_type = db_type;
}
public Double getSpeed_limit() {
return speed_limit;
}
public void setSpeed_limit(Double speed_limit) {
this.speed_limit = speed_limit;
}
public String getDescriptions() {
return descriptions;
}
public void setDescriptions(String descriptions) {
this.descriptions = descriptions;
}
public Integer getVersions() {
return versions;
}
public void setVersions(Integer versions) {
this.versions = versions;
}
}