├── README.md ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── appleyk │ │ ├── IO │ │ └── StringTokenReader.java │ │ ├── ShpApplication.java │ │ ├── controller │ │ └── ShpController.java │ │ ├── exception │ │ └── GlobalExceptionHandler.java │ │ ├── geotools │ │ ├── GeometryCreator.java │ │ └── ShpTools.java │ │ ├── pojos │ │ ├── ShpDatas.java │ │ └── ShpInfo.java │ │ ├── result │ │ ├── ResponseMessage.java │ │ └── ResponseResult.java │ │ └── service │ │ └── ShpService.java └── resources │ ├── application-dev.properties │ ├── application-prod.properties │ ├── application-test.properties │ ├── application.properties │ ├── logback-boot.xml │ └── static │ ├── ReadMe │ ├── shpTest[LineString] │ ├── china_railways.cpg │ ├── china_railways.dbf │ ├── china_railways.prj │ ├── china_railways.qpj │ ├── china_railways.shp │ └── china_railways.shx │ ├── shpTest[Point] │ ├── dp_tl.dbf │ ├── dp_tl.prj │ ├── dp_tl.qix │ ├── dp_tl.sbn │ ├── dp_tl.sbx │ ├── dp_tl.shp │ ├── dp_tl.shp.xml │ └── dp_tl.shx │ └── shpTest[Polygon] │ ├── china_building_part.cpg │ ├── china_building_part.dbf │ ├── china_building_part.prj │ ├── china_building_part.qix │ ├── china_building_part.qpj │ ├── china_building_part.shp │ └── china_building_part.shx └── test └── java └── com └── appleyk └── SpringbootshaperApplicationTests.java /README.md: -------------------------------------------------------------------------------- 1 | # SpringBoot-ShpTools 2 | spring-boot集成geotools工具包,实现将几何对象写进Shapefile【文件】并读取和显示 3 | 4 | 5 | 我是谁:Appleyk 6 | 7 | 我的CSDN博客地址:https://blog.csdn.net/Appleyk 8 | 9 | 本项目对应的博客地址:https://blog.csdn.net/Appleyk/article/details/83376510 10 | 11 | 12 | 欢迎来骚扰................. 13 | 14 | 15 | ## 效果图 16 | 17 | ### 1、shp文件内容读取 18 | 19 | 图片地址:https://i.postimg.cc/L6gpv8Mg/shpreader.png 20 | 21 | ![shp文件内容读取](https://i.postimg.cc/L6gpv8Mg/shpreader.png) 22 | 23 | 24 | ### 2、shp文件渲染成图片格式并显示 25 | 26 | 图片地址:https://i.postimg.cc/nzDHr4G2/shpreader2.png 27 | 28 | ![shp文件内容读取](https://i.postimg.cc/nzDHr4G2/shpreader2.png) 29 | 30 | 31 | 图片地址:https://i.postimg.cc/D0GdxMdG/shpreader3.png 32 | 33 | ![shp文件内容读取](https://i.postimg.cc/D0GdxMdG/shpreader3.png) 34 | 35 | 36 | 图片地址:https://i.postimg.cc/d0KM6b22/shpreader5.png 37 | 38 | ![shp文件内容读取](https://i.postimg.cc/d0KM6b22/shpreader5.png) 39 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | com.appleyk 7 | springbootshaper 8 | 0.1.1-SNAPSHOT 9 | war 10 | 11 | springbootshaper 12 | spring-boot集成geotools工具包,实现将几何对象写进Shapefile【文件】并读取和显示 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.1.4.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 20.0 26 | 42.1.4 27 | 2.11.2 28 | 29 | 30 | 31 | 32 | osgeo 33 | OSGeo Release Repository 34 | https://repo.osgeo.org/repository/release/ 35 | 36 | false 37 | 38 | 39 | true 40 | 41 | 42 | 43 | osgeo-snapshot 44 | OSGeo Snapshot Repository 45 | https://repo.osgeo.org/repository/snapshot/ 46 | 47 | true 48 | 49 | 50 | false 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | org.springframework.boot 65 | spring-boot-starter-web 66 | 67 | 68 | 69 | org.springframework.boot 70 | spring-boot-starter-test 71 | test 72 | 73 | 74 | 75 | 76 | junit 77 | junit 78 | 79 | 80 | 81 | 82 | org.geotools 83 | gt-shapefile 84 | ${geotools.version} 85 | 86 | 87 | 88 | org.geotools 89 | gt-swing 90 | ${geotools.version} 91 | 92 | 93 | 94 | 95 | org.geotools 96 | gt-geojson 97 | ${geotools.version} 98 | 99 | 100 | 101 | 102 | com.fasterxml.jackson.core 103 | jackson-core 104 | ${jackson.version} 105 | 106 | 107 | com.fasterxml.jackson.core 108 | jackson-annotations 109 | ${jackson.version} 110 | 111 | 112 | com.fasterxml.jackson.core 113 | jackson-databind 114 | ${jackson.version} 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | src/main/resources 125 | 126 | 127 | src/main/resources 128 | 129 | **/*.properties 130 | **/*.xml 131 | 132 | false 133 | 134 | 135 | src/main/java 136 | 137 | **/*.properties 138 | **/*.xml 139 | 140 | false 141 | 142 | 143 | 144 | 145 | org.springframework.boot 146 | spring-boot-maven-plugin 147 | 148 | true 149 | 150 | 151 | 152 | 153 | 154 | org.springframework.boot 155 | spring-boot-maven-plugin 156 | 157 | 158 | org.apache.maven.plugins 159 | maven-surefire-plugin 160 | 161 | 162 | **/*Documentation.java 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/IO/StringTokenReader.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.IO; 2 | 3 | 4 | import org.locationtech.jts.geom.*; 5 | import org.locationtech.jts.io.ParseException; 6 | import org.locationtech.jts.util.Assert; 7 | 8 | import java.io.IOException; 9 | import java.io.Reader; 10 | import java.io.StreamTokenizer; 11 | import java.io.StringReader; 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | *

StringToken 特殊、自定义字符串解析Reader

17 | * @author Appleyk 18 | * @blob https://blog.csdn.net/appleyk 19 | * @date Created on 上午 2018年10月25日09:22:41 20 | */ 21 | public class StringTokenReader { 22 | 23 | private static final String EMPTY = "EMPTY"; 24 | private static final String COMMA = ","; 25 | private static final String L_PAREN = "("; 26 | private static final String R_PAREN = ")"; 27 | private static final String NAN_SYMBOL = "NaN"; 28 | private static final String Z = "Z"; 29 | private static final String M = "M"; 30 | private static final String ZM = "ZM"; 31 | private static final String POINT = "POINT"; 32 | private static final String LINESTRING = "LINESTRING"; 33 | private static final String LINEARRING = "LINEARRING"; 34 | private static final String POLYGON = "POLYGON"; 35 | private static final String MULTI_POINT = "MULTIPOINT"; 36 | private static final String MULTI_LINESTRING = "MULTILINESTRING"; 37 | private static final String MULTI_POLYGON = "MULTIPOLYGON"; 38 | 39 | private GeometryFactory geometryFactory; 40 | private PrecisionModel precisionModel; 41 | private StreamTokenizer tokenizer; 42 | 43 | /** 44 | * Not yet used (useful if we want to read Z, M and ZM WKT) 45 | */ 46 | private boolean z; 47 | private boolean m; 48 | 49 | /** 50 | * Creates a reader that creates objects using the default 51 | * {@link GeometryFactory}. 52 | */ 53 | public StringTokenReader() { 54 | this(new GeometryFactory()); 55 | } 56 | 57 | /** 58 | * Creates a reader that creates objects using the given 59 | * {@link GeometryFactory}. 60 | * 61 | * @param geometryFactory the factory used to create Geometrys. 62 | */ 63 | public StringTokenReader(GeometryFactory geometryFactory) { 64 | this.geometryFactory = geometryFactory; 65 | precisionModel = geometryFactory.getPrecisionModel(); 66 | } 67 | 68 | /** 69 | * Reads a Well-Known Text representation of a {@link Geometry} from a 70 | * {@link String}. 71 | * 72 | * @param wellKnownText one or more <Geometry Tagged Text> strings (see the 73 | * OpenGIS Simple Features Specification) separated by whitespace 74 | * @return a Geometry specified by wellKnownText 75 | * @throws ParseException if a parsing problem occurs 76 | */ 77 | public Geometry read(String wellKnownText) throws ParseException { 78 | StringReader reader = new StringReader(wellKnownText); 79 | try { 80 | return read(reader); 81 | } finally { 82 | reader.close(); 83 | } 84 | } 85 | 86 | /** 87 | * Reads a Well-Known Text representation of a {@link Geometry} from a 88 | * {@link Reader}. 89 | * 90 | * @param reader a Reader which will return a <Geometry Tagged Text> 91 | * string (see the OpenGIS Simple Features Specification) 92 | * @return a Geometry read from reader 93 | * @throws ParseException if a parsing problem occurs 94 | */ 95 | public Geometry read(Reader reader) throws ParseException { 96 | tokenizer = new StreamTokenizer(reader); 97 | // set tokenizer to NOT parse numbers 98 | tokenizer.resetSyntax(); 99 | tokenizer.wordChars('a', 'z'); 100 | tokenizer.wordChars('A', 'Z'); 101 | tokenizer.wordChars(128 + 32, 255); 102 | tokenizer.wordChars('0', '9'); 103 | tokenizer.wordChars('-', '-'); 104 | tokenizer.wordChars('+', '+'); 105 | tokenizer.wordChars('.', '.'); 106 | tokenizer.whitespaceChars(0, ' '); 107 | tokenizer.commentChar('#'); 108 | z = false; 109 | m = false; 110 | try { 111 | return readGeometryTaggedText(); 112 | } catch (IOException e) { 113 | throw new ParseException(e.toString()); 114 | } 115 | } 116 | 117 | /** 118 | * Returns the next array of Coordinates in the stream. 119 | *

120 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 121 | * next element returned by the stream should be L_PAREN (the beginning of 122 | * "(x1 y1, x2 y2, ..., xn yn)") or EMPTY. 123 | * 124 | * @return the next array of Coordinates in the stream, or an 125 | * empty array if EMPTY is the next element returned by the stream. 126 | * @throws IOException if an I/O error occurs 127 | * @throws ParseException if an unexpected token was encountered 128 | */ 129 | private Coordinate[] getCoordinates() throws IOException, ParseException { 130 | String nextToken = getNextEmptyOrOpener(); 131 | if (EMPTY.equals(nextToken)) { 132 | return new Coordinate[]{}; 133 | } 134 | List coordinates = new ArrayList<>(); 135 | coordinates.add(getPreciseCoordinate()); 136 | nextToken = getNextCloserOrComma(); 137 | while (COMMA.equals(nextToken)) { 138 | coordinates.add(getPreciseCoordinate()); 139 | nextToken = getNextCloserOrComma(); 140 | } 141 | Coordinate[] array = new Coordinate[coordinates.size()]; 142 | return coordinates.toArray(array); 143 | } 144 | 145 | private Coordinate[] getCoordinatesNoLeftParen() throws IOException, ParseException { 146 | List coordinates = new ArrayList<>(); 147 | coordinates.add(getPreciseCoordinate()); 148 | String nextToken = getNextCloserOrComma(); 149 | while (COMMA.equals(nextToken)) { 150 | coordinates.add(getPreciseCoordinate()); 151 | nextToken = getNextCloserOrComma(); 152 | } 153 | Coordinate[] array = new Coordinate[coordinates.size()]; 154 | return coordinates.toArray(array); 155 | } 156 | 157 | private Coordinate getPreciseCoordinate() throws IOException, ParseException { 158 | Coordinate coordinate = new Coordinate(); 159 | coordinate.setX(getNextNumber()); 160 | coordinate.setY(getNextNumber()); 161 | if (isNumberNext()) { 162 | coordinate.setZ(getNextNumber()); 163 | } 164 | if (isNumberNext()) { 165 | // ignore M value 166 | getNextNumber(); 167 | } 168 | precisionModel.makePrecise(coordinate); 169 | return coordinate; 170 | } 171 | 172 | private boolean isNumberNext() throws IOException { 173 | int type = tokenizer.nextToken(); 174 | tokenizer.pushBack(); 175 | return type == StreamTokenizer.TT_WORD; 176 | } 177 | 178 | /** 179 | * Parses the next number in the stream. Numbers with exponents are handled. 180 | * NaN values are handled correctly, and the case of the "NaN" 181 | * symbol is not significant. 182 | *

183 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 184 | * next token must be a number. 185 | * 186 | * @return the next number in the stream 187 | * @throws ParseException if the next token is not a valid number 188 | * @throws IOException if an I/O error occurs 189 | */ 190 | private double getNextNumber() throws IOException, ParseException { 191 | int type = tokenizer.nextToken(); 192 | switch (type) { 193 | case StreamTokenizer.TT_WORD: { 194 | if (tokenizer.sval.equalsIgnoreCase(NAN_SYMBOL)) { 195 | return Double.NaN; 196 | } else { 197 | try { 198 | return Double.parseDouble(tokenizer.sval); 199 | } catch (NumberFormatException ex) { 200 | parseErrorWithLine("Invalid number: " + tokenizer.sval); 201 | } 202 | } 203 | break; 204 | } 205 | default:{ 206 | 207 | } 208 | } 209 | parseErrorExpected("number"); 210 | return 0.0; 211 | } 212 | 213 | /** 214 | * Returns the next EMPTY or L_PAREN in the stream as uppercase text. 215 | *

216 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 217 | * next token must be EMPTY or L_PAREN. 218 | * 219 | * @return the next EMPTY or L_PAREN in the stream as uppercase text. 220 | * @throws ParseException if the next token is not EMPTY or L_PAREN 221 | * @throws IOException if an I/O error occurs 222 | */ 223 | private String getNextEmptyOrOpener() throws IOException, ParseException { 224 | String nextWord = getNextWord(); 225 | if (Z.equalsIgnoreCase(nextWord)) { 226 | z = true; 227 | nextWord = getNextWord(); 228 | } else if (M.equalsIgnoreCase(nextWord)) { 229 | m = true; 230 | nextWord = getNextWord(); 231 | } else if (ZM.equalsIgnoreCase(nextWord)) { 232 | z = true; 233 | m = true; 234 | nextWord = getNextWord(); 235 | } 236 | if (EMPTY.equals(nextWord) || L_PAREN.equals(nextWord)) { 237 | return nextWord; 238 | } 239 | parseErrorExpected(EMPTY + " or " + L_PAREN); 240 | return null; 241 | } 242 | 243 | /** 244 | * Returns the next R_PAREN or COMMA in the stream. 245 | *

246 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 247 | * next token must be R_PAREN or COMMA. 248 | * 249 | * @return the next R_PAREN or COMMA in the stream 250 | * @throws ParseException if the next token is not R_PAREN or COMMA 251 | * @throws IOException if an I/O error occurs 252 | */ 253 | private String getNextCloserOrComma() throws IOException, ParseException { 254 | String nextWord = getNextWord(); 255 | if (COMMA.equals(nextWord) || R_PAREN.equals(nextWord)) { 256 | return nextWord; 257 | } 258 | parseErrorExpected(COMMA + " or " + R_PAREN); 259 | return null; 260 | } 261 | 262 | /** 263 | * Returns the next R_PAREN in the stream. 264 | *

265 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 266 | * next token must be R_PAREN. 267 | * 268 | * @return the next R_PAREN in the stream 269 | * @throws ParseException if the next token is not R_PAREN 270 | * @throws IOException if an I/O error occurs 271 | */ 272 | private String getNextCloser() throws IOException, ParseException { 273 | String nextWord = getNextWord(); 274 | if (R_PAREN.equals(nextWord)) { 275 | return nextWord; 276 | } 277 | parseErrorExpected(R_PAREN); 278 | return null; 279 | } 280 | 281 | /** 282 | * Returns the next word in the stream. 283 | *

284 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 285 | * next token must be a word. 286 | * 287 | * @return the next word in the stream as uppercase text 288 | * @throws ParseException if the next token is not a word 289 | * @throws IOException if an I/O error occurs 290 | */ 291 | private String getNextWord() throws IOException, ParseException { 292 | int type = tokenizer.nextToken(); 293 | switch (type) { 294 | case StreamTokenizer.TT_WORD: 295 | 296 | String word = tokenizer.sval; 297 | if (word.equalsIgnoreCase(EMPTY)){ 298 | return EMPTY; 299 | } 300 | 301 | return word; 302 | 303 | case '(': 304 | return L_PAREN; 305 | case ')': 306 | return R_PAREN; 307 | case ',': 308 | return COMMA; 309 | default:{ 310 | 311 | } 312 | } 313 | parseErrorExpected("word"); 314 | return null; 315 | } 316 | 317 | /** 318 | * Returns the next word in the stream. 319 | *

320 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 321 | * next token must be a word. 322 | * 323 | * @return the next word in the stream as uppercase text 324 | * @throws ParseException if the next token is not a word 325 | * @throws IOException if an I/O error occurs 326 | */ 327 | private String lookaheadWord() throws IOException, ParseException { 328 | String nextWord = getNextWord(); 329 | tokenizer.pushBack(); 330 | return nextWord; 331 | } 332 | 333 | /** 334 | * Throws a formatted ParseException reporting that the current token was 335 | * unexpected. 336 | * 337 | * @param expected a description of what was expected 338 | * @throws ParseException AssertionFailedException if an invalid token is encountered 339 | */ 340 | private void parseErrorExpected(String expected) throws ParseException { 341 | // throws Asserts for tokens that should never be seen 342 | if (tokenizer.ttype == StreamTokenizer.TT_NUMBER){ 343 | Assert.shouldNeverReachHere("Unexpected NUMBER token"); 344 | } 345 | if (tokenizer.ttype == StreamTokenizer.TT_EOL){ 346 | Assert.shouldNeverReachHere("Unexpected EOL token"); 347 | } 348 | 349 | String tokenStr = tokenString(); 350 | parseErrorWithLine("Expected " + expected + " but found " + tokenStr); 351 | } 352 | 353 | private void parseErrorWithLine(String msg) throws ParseException { 354 | throw new ParseException(msg + " (line " + tokenizer.lineno() + ")"); 355 | } 356 | 357 | /** 358 | * Gets a description of the current token 359 | * 360 | * @return a description of the current token 361 | */ 362 | private String tokenString() { 363 | switch (tokenizer.ttype) { 364 | case StreamTokenizer.TT_NUMBER: 365 | return ""; 366 | case StreamTokenizer.TT_EOL: 367 | return "End-of-Line"; 368 | case StreamTokenizer.TT_EOF: 369 | return "End-of-Stream"; 370 | case StreamTokenizer.TT_WORD: 371 | return "'" + tokenizer.sval + "'"; 372 | default:{ 373 | 374 | } 375 | } 376 | return "'" + (char) tokenizer.ttype + "'"; 377 | } 378 | 379 | /** 380 | * Creates a Geometry using the next token in the stream. 381 | *

382 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 383 | * next tokens must form a <Geometry Tagged Text>. 384 | * 385 | * @return a Geometry specified by the next token in the stream 386 | * @throws ParseException if the coordinates used to create a Polygon 387 | * shell and holes do not form closed linestrings, or if an 388 | * unexpected token was encountered 389 | * @throws IOException if an I/O error occurs 390 | */ 391 | private Geometry readGeometryTaggedText() throws IOException, ParseException { 392 | 393 | String type; 394 | try { 395 | type = getNextWord(); 396 | if(type == null){ 397 | return null; 398 | } 399 | type= type.toUpperCase(); 400 | 401 | if (type.endsWith(Z)){ 402 | z = true; 403 | } 404 | if (type.endsWith(M)){ 405 | m = true; 406 | } 407 | } catch (IOException e) { 408 | return null; 409 | } 410 | 411 | if (type.startsWith(POINT)) { 412 | return readPointText(); 413 | } else if (type.startsWith(LINESTRING)) { 414 | return readLineStringText(); 415 | } else if (type.startsWith(LINEARRING)) { 416 | return readLinearRingText(); 417 | } else if (type.startsWith(POLYGON)) { 418 | return readPolygonText(); 419 | } else if (type.startsWith(MULTI_POINT)) { 420 | return readMultiPointText(); 421 | } else if (type.startsWith(MULTI_LINESTRING)) { 422 | return readMultiLineStringText(); 423 | } else if (type.startsWith(MULTI_POLYGON)) { 424 | return readMultiPolygonText(); 425 | } 426 | parseErrorWithLine("Unknown geometry type: " + type); 427 | return null; 428 | } 429 | 430 | /** 431 | * Creates a Point using the next token in the stream. 432 | *

433 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 434 | * next tokens must form a <Point Text>. 435 | * 436 | * @return a Point specified by the next token in the stream 437 | * @throws IOException if an I/O error occurs 438 | * @throws ParseException if an unexpected token was encountered 439 | */ 440 | private Point readPointText() throws IOException, ParseException { 441 | String nextToken = getNextEmptyOrOpener(); 442 | if (EMPTY.equals(nextToken)) { 443 | return geometryFactory 444 | .createPoint(geometryFactory.getCoordinateSequenceFactory().create(new Coordinate[]{})); 445 | } 446 | Point point = geometryFactory.createPoint(getPreciseCoordinate()); 447 | getNextCloser(); 448 | return point; 449 | } 450 | 451 | /** 452 | * Creates a LineString using the next token in the stream. 453 | *

454 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 455 | * next tokens must form a <LineString Text>. 456 | * 457 | * @return a LineString specified by the next token in the 458 | * stream 459 | * @throws IOException if an I/O error occurs 460 | * @throws ParseException if an unexpected token was encountered 461 | */ 462 | private LineString readLineStringText() throws IOException, ParseException { 463 | return geometryFactory.createLineString(getCoordinates()); 464 | } 465 | 466 | /** 467 | * Creates a LinearRing using the next token in the stream. 468 | *

469 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 470 | * next tokens must form a <LineString Text>. 471 | * 472 | * @return a LinearRing specified by the next token in the 473 | * stream 474 | * @throws IOException if an I/O error occurs 475 | * @throws ParseException if the coordinates used to create the LinearRing 476 | * do not form a closed linestring, or if an unexpected token 477 | * was encountered 478 | */ 479 | private LinearRing readLinearRingText() throws IOException, ParseException { 480 | return geometryFactory.createLinearRing(getCoordinates()); 481 | } 482 | 483 | /* 484 | * private MultiPoint OLDreadMultiPointText() throws IOException, 485 | * ParseException { return 486 | * geometryFactory.createMultiPoint(toPoints(getCoordinates())); } 487 | */ 488 | 489 | private static final boolean ALLOW_OLD_JTS_MULTIPOINT_SYNTAX = true; 490 | 491 | /** 492 | * Creates a MultiPoint using the next tokens in the stream. 493 | *

494 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 495 | * next tokens must form a <MultiPoint Text>. 496 | * 497 | * @return a MultiPoint specified by the next token in the 498 | * stream 499 | * @throws IOException if an I/O error occurs 500 | * @throws ParseException if an unexpected token was encountered 501 | */ 502 | private MultiPoint readMultiPointText() throws IOException, ParseException { 503 | String nextToken = getNextEmptyOrOpener(); 504 | if (EMPTY.equals(nextToken)) { 505 | return geometryFactory.createMultiPoint(new Point[0]); 506 | } 507 | 508 | // check for old-style JTS syntax and parse it if present 509 | // MD 2009-02-21 - this is only provided for backwards compatibility for 510 | // a few versions 511 | if (ALLOW_OLD_JTS_MULTIPOINT_SYNTAX) { 512 | String nextWord = lookaheadWord(); 513 | if (!nextWord.equals(L_PAREN)) { 514 | return geometryFactory.createMultiPoint(toPoints(getCoordinatesNoLeftParen())); 515 | } 516 | } 517 | 518 | List points = new ArrayList<>(); 519 | Point point = readPointText(); 520 | points.add(point); 521 | nextToken = getNextCloserOrComma(); 522 | while (COMMA.equals(nextToken)) { 523 | point = readPointText(); 524 | points.add(point); 525 | nextToken = getNextCloserOrComma(); 526 | } 527 | Point[] array = new Point[points.size()]; 528 | return geometryFactory.createMultiPoint( points.toArray(array)); 529 | } 530 | 531 | /** 532 | * Creates an array of Points having the given 533 | * Coordinate s. 534 | * 535 | * @param coordinates the Coordinates with which to create the 536 | * Points 537 | * @return Points created using this WKTReader s 538 | * GeometryFactory 539 | */ 540 | private Point[] toPoints(Coordinate[] coordinates) { 541 | List points = new ArrayList<>(); 542 | for (Coordinate coordinate : coordinates) { 543 | points.add(geometryFactory.createPoint(coordinate)); 544 | } 545 | return points.toArray(new Point[]{}); 546 | } 547 | 548 | /** 549 | * Creates a Polygon using the next token in the stream. 550 | *

551 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 552 | * next tokens must form a <Polygon Text>. 553 | * 554 | * @return a Polygon specified by the next token in the stream 555 | * @throws ParseException if the coordinates used to create the Polygon 556 | * shell and holes do not form closed linestrings, or if an 557 | * unexpected token was encountered. 558 | * @throws IOException if an I/O error occurs 559 | */ 560 | private Polygon readPolygonText() throws IOException, ParseException { 561 | String nextToken = getNextEmptyOrOpener(); 562 | if (EMPTY.equals(nextToken)) { 563 | return geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[]{}), 564 | new LinearRing[]{}); 565 | } 566 | List holes = new ArrayList<>(); 567 | LinearRing shell = readLinearRingText(); 568 | nextToken = getNextCloserOrComma(); 569 | while (COMMA.equals(nextToken)) { 570 | LinearRing hole = readLinearRingText(); 571 | holes.add(hole); 572 | nextToken = getNextCloserOrComma(); 573 | } 574 | LinearRing[] array = new LinearRing[holes.size()]; 575 | return geometryFactory.createPolygon(shell, holes.toArray(array)); 576 | } 577 | 578 | /** 579 | * Creates a MultiLineString using the next token in the 580 | * stream. 581 | *

582 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 583 | * next tokens must form a <MultiLineString Text>. 584 | * 585 | * @return a MultiLineString specified by the next token in the 586 | * stream 587 | * @throws IOException if an I/O error occurs 588 | * @throws ParseException if an unexpected token was encountered 589 | */ 590 | private MultiLineString readMultiLineStringText() throws IOException, ParseException { 591 | String nextToken = getNextEmptyOrOpener(); 592 | if (EMPTY.equals(nextToken)) { 593 | return geometryFactory.createMultiLineString(new LineString[]{}); 594 | } 595 | List lineStrings = new ArrayList<>(); 596 | LineString lineString = readLineStringText(); 597 | lineStrings.add(lineString); 598 | nextToken = getNextCloserOrComma(); 599 | while (COMMA.equals(nextToken)) { 600 | lineString = readLineStringText(); 601 | lineStrings.add(lineString); 602 | nextToken = getNextCloserOrComma(); 603 | } 604 | LineString[] array = new LineString[lineStrings.size()]; 605 | return geometryFactory.createMultiLineString(lineStrings.toArray(array)); 606 | } 607 | 608 | /** 609 | * Creates a MultiPolygon using the next token in the stream. 610 | *

611 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 612 | * next tokens must form a <MultiPolygon Text>. 613 | * 614 | * @return a MultiPolygon specified by the next token in the 615 | * stream, or if if the coordinates used to create the 616 | * Polygon shells and holes do not form closed 617 | * linestrings. 618 | * @throws IOException if an I/O error occurs 619 | * @throws ParseException if an unexpected token was encountered 620 | */ 621 | private MultiPolygon readMultiPolygonText() throws IOException, ParseException { 622 | String nextToken = getNextEmptyOrOpener(); 623 | if (EMPTY.equals(nextToken)) { 624 | return new MultiPolygon(null, geometryFactory); 625 | } 626 | List polygons = new ArrayList<>(); 627 | Polygon polygon = readPolygonText(); 628 | polygons.add(polygon); 629 | nextToken = getNextCloserOrComma(); 630 | while (COMMA.equals(nextToken)) { 631 | polygon = readPolygonText(); 632 | polygons.add(polygon); 633 | nextToken = getNextCloserOrComma(); 634 | } 635 | Polygon[] array = new Polygon[polygons.size()]; 636 | return geometryFactory.createMultiPolygon(polygons.toArray(array)); 637 | } 638 | 639 | /** 640 | * Creates a GeometryCollection using the next token in the 641 | * stream. 642 | *

643 | * tokenizer tokenizer over a stream of text in Well-known Text format. The 644 | * next tokens must form a <GeometryCollection Text>. 645 | * 646 | * @return a GeometryCollection specified by the next token in 647 | * the stream 648 | * @throws ParseException if the coordinates used to create a Polygon 649 | * shell and holes do not form closed linestrings, or if an 650 | * unexpected token was encountered 651 | * @throws IOException if an I/O error occurs 652 | */ 653 | private GeometryCollection readGeometryCollectionText() throws IOException, ParseException { 654 | String nextToken = getNextEmptyOrOpener(); 655 | if (EMPTY.equals(nextToken)) { 656 | return geometryFactory.createGeometryCollection(new Geometry[]{}); 657 | } 658 | List geometries = new ArrayList<>(); 659 | Geometry geometry = readGeometryTaggedText(); 660 | geometries.add(geometry); 661 | nextToken = getNextCloserOrComma(); 662 | while (COMMA.equals(nextToken)) { 663 | geometry = readGeometryTaggedText(); 664 | geometries.add(geometry); 665 | nextToken = getNextCloserOrComma(); 666 | } 667 | Geometry[] array = new Geometry[geometries.size()]; 668 | return geometryFactory.createGeometryCollection(geometries.toArray(array)); 669 | } 670 | 671 | 672 | } 673 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/ShpApplication.java: -------------------------------------------------------------------------------- 1 | package com.appleyk; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | import org.springframework.context.annotation.Bean; 9 | 10 | /** 11 | * 下面是一个典型的结构: 12 | * 13 | * com 14 | * +- example 15 | * +- myproject 16 | * +- Application.java -- 17 | * 18 | * 注意这个位置,习惯性的放在项目的一开始,也就是根包的第一层 | + - domain | +- Customer.java | +- 19 | * CustomerRepository.java | + - service | +- CustomerService.java | + - web +- 20 | * CustomerController.java 21 | * 文件将声明 main 方法, 还有基本的 @Configuration 22 | * 23 | *

SpringBoot启动类

24 | * @author Appleyk 25 | * @blob https://blog.csdn.net/appleyk 26 | * @date Created on 上午 11:54 2018-10-12 27 | */ 28 | @SpringBootApplication// same as @Configuration @EnableAutoConfiguration @ComponentScan 29 | public class ShpApplication extends SpringBootServletInitializer { 30 | 31 | /** 32 | * SpringApplication类提供了一种从main()方法启动Spring应用的便捷方式。 在很多情况下, 你只需委托给 33 | * SpringApplication.run这个静态方法: 34 | * @param args 输入参数 35 | */ 36 | public static void main(String[] args) { 37 | SpringApplication.run(ShpApplication.class, args); 38 | } 39 | 40 | @Override 41 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 42 | return application.sources(ShpApplication.class); 43 | } 44 | 45 | /** 46 | * Spring-Boot启动的时候,加载、创建、初始化数据 47 | * @return 初始化信息 48 | */ 49 | @Bean 50 | CommandLineRunner demo() { 51 | return args -> { 52 | System.out.println("<<<<<<<<< Hello,Spring Boot ! >>>>>>>>"); 53 | }; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/controller/ShpController.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.controller; 2 | 3 | import com.appleyk.pojos.ShpInfo; 4 | import com.appleyk.result.ResponseResult; 5 | import com.appleyk.service.ShpService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | /** 12 | *

shp接口请求处理器

13 | * @author Appleyk 14 | * @blob https://blog.csdn.net/appleyk 15 | * @date Created on 下午 2018-10-24 16:27:22 16 | */ 17 | @CrossOrigin 18 | @RequestMapping("/shper") 19 | @RestController 20 | public class ShpController { 21 | 22 | @Autowired 23 | private ShpService shpService; 24 | 25 | @GetMapping("/hello") 26 | public String sayHello(){ 27 | return "Hello Appleyk's Controller !"; 28 | } 29 | 30 | 31 | /** 32 | * 写一个shp文件 33 | * @param shpInfo 34 | * @return 35 | * @throws Exception 36 | */ 37 | @PostMapping("/write") 38 | public ResponseResult write(@RequestBody ShpInfo shpInfo) throws Exception{ 39 | return shpService.writeShp(shpInfo); 40 | } 41 | 42 | /** 43 | * 查询一个shp文件 44 | * @param shpFilePath 文件绝对路径 45 | * @param limit 指定显示多少条shp特征【features】 46 | * @return 47 | * @throws Exception 48 | */ 49 | @GetMapping("/query") 50 | public ResponseResult query(@RequestParam(value = "path",required = true) String shpFilePath, 51 | @RequestParam(value = "limit",required = false,defaultValue = "10") Integer limit ) throws Exception{ 52 | return shpService.getShpDatas(shpFilePath,limit); 53 | } 54 | 55 | /** 56 | * 将shp文件转换成png图片,图片或写入文件或通过response输出到界面【比如,客户端浏览器】 57 | * @param path shp文件路径 58 | * @param imagePath 如果imagePath不等于空,则shp文件转成图片文件存储进行存 59 | * @param color 渲染颜色 60 | */ 61 | @GetMapping("/show") 62 | public void show(@RequestParam(value = "path",required = true) String path, 63 | @RequestParam(value = "imagePath",required = false) String imagePath, 64 | @RequestParam(value = "color",required = false) String color, 65 | HttpServletResponse response) throws Exception{ 66 | 67 | // 设置响应消息的类型 68 | response.setContentType("image/png"); 69 | 70 | // 设置页面不缓存 71 | response.setHeader("Cache-Control", "no-cache"); 72 | response.setHeader("Pragma", "no-cache"); 73 | response.setDateHeader("Expires", 0); 74 | shpService.showShp(path, imagePath,color ,response); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.exception; 2 | 3 | 4 | import com.appleyk.result.ResponseResult; 5 | import org.springframework.web.bind.annotation.CrossOrigin; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.RestControllerAdvice; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | 13 | /** 14 | *

全局异常捕获处理类

15 | * @author Appleyk 16 | * @blob https://blog.csdn.net/appleyk 17 | * @date Created on 上午 2018年10月25日09:57:57 18 | */ 19 | @CrossOrigin 20 | @RestControllerAdvice 21 | public class GlobalExceptionHandler { 22 | 23 | @ExceptionHandler 24 | public ResponseResult processException(Exception ex, HttpServletRequest request, HttpServletResponse response) 25 | throws Exception { 26 | 27 | return new ResponseResult(400, ex); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/geotools/GeometryCreator.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.geotools; 2 | 3 | import org.geotools.geojson.geom.GeometryJSON; 4 | import org.locationtech.jts.geom.*; 5 | import org.locationtech.jts.io.ParseException; 6 | import org.locationtech.jts.io.WKTReader; 7 | 8 | import java.io.StringReader; 9 | import java.io.StringWriter; 10 | import java.util.List; 11 | 12 | /** 13 | *

自定义几何对象构造器

14 | * @author Appleyk 15 | * @blob https://blog.csdn.net/appleyk 16 | * @date Created on 上午 11:54 2018-10-12 17 | */ 18 | public class GeometryCreator { 19 | 20 | 21 | private static GeometryCreator geometryCreator = null; 22 | private static GeometryFactory geometryFactory = new GeometryFactory(); 23 | 24 | /** 25 | * 设置保留6位小数,否则GeometryJSON默认保留4位小数 26 | */ 27 | private static GeometryJSON geometryJson = new GeometryJSON(6); 28 | 29 | 30 | private GeometryCreator() { 31 | } 32 | 33 | /** 34 | * 返回本类的唯一实例 35 | * @return 36 | */ 37 | public static GeometryCreator getInstance() { 38 | if (geometryCreator == null) { 39 | return new GeometryCreator(); 40 | } 41 | return geometryCreator; 42 | } 43 | 44 | 45 | /** 46 | * 1.1根据X,Y坐标构建一个几何对象: 点 【Point】 47 | * @param x 48 | * @param y 49 | * @return 50 | */ 51 | public Point createPoint(double x,double y){ 52 | Coordinate coord = new Coordinate(x, y); 53 | return geometryFactory.createPoint(coord); 54 | } 55 | 56 | /** 57 | * 1.2根据几何对象的WKT描述【String】创建几何对象: 点 【Point】 58 | * @return 59 | * @throws ParseException 60 | */ 61 | public Point createPointByWKT(String PointWKT) throws ParseException { 62 | WKTReader reader = new WKTReader(geometryFactory); 63 | return (Point) reader.read(PointWKT); 64 | } 65 | 66 | /** 67 | * 1.3根据几何对象的WKT描述【String】创建几何对象:多点 【MultiPoint】 68 | * @return 69 | * @throws ParseException 70 | */ 71 | public MultiPoint createMulPointByWKT(String MPointWKT)throws ParseException{ 72 | WKTReader reader = new WKTReader( geometryFactory ); 73 | return (MultiPoint) reader.read(MPointWKT); 74 | } 75 | 76 | /** 77 | * 2.1根据两点 创建几何对象:线 【LineString】 78 | * @param ax 第一个点的x坐标 79 | * @param ay 第一个点的y坐标 80 | * @param bx 第二个点的x坐标 81 | * @param by 第二个点的y坐标 82 | * @return 83 | */ 84 | public LineString createLine(double ax,double ay,double bx,double by){ 85 | Coordinate[] coords = new Coordinate[] {new Coordinate(ax, ay), new Coordinate(bx, by)}; 86 | return geometryFactory.createLineString(coords); 87 | } 88 | 89 | /** 90 | * 2.2根据线的WKT描述创建几何对象:线 【LineString】 91 | * @param LineStringWKT 92 | * @return 93 | * @throws ParseException 94 | */ 95 | public LineString createLineByWKT(String LineStringWKT) throws ParseException{ 96 | WKTReader reader = new WKTReader( geometryFactory ); 97 | return (LineString) reader.read(LineStringWKT); 98 | } 99 | 100 | /** 101 | * 2.3根据点组合的线数组,创建几何对象:多线 【MultiLineString】 102 | * @param list 103 | * @return 104 | */ 105 | public MultiLineString createMLine(List list){ 106 | 107 | if(list == null){ 108 | return null; 109 | } 110 | 111 | LineString[] lineStrings = new LineString[list.size()]; 112 | int i = 0; 113 | for (Coordinate[] coordinates : list) { 114 | lineStrings[i] = geometryFactory.createLineString(coordinates); 115 | } 116 | 117 | return geometryFactory.createMultiLineString(lineStrings); 118 | } 119 | 120 | 121 | /** 122 | * 2.4根据几何对象的WKT描述【String】创建几何对象 : 多线【MultiLineString】 123 | * @param MLineStringWKT 124 | * @return 125 | * @throws ParseException 126 | */ 127 | public MultiLineString createMLineByWKT(String MLineStringWKT)throws ParseException{ 128 | WKTReader reader = new WKTReader( geometryFactory ); 129 | return (MultiLineString) reader.read(MLineStringWKT); 130 | } 131 | 132 | 133 | /** 134 | * 3.1 根据几何对象的WKT描述【String】创建几何对象:多边形 【Polygon】 135 | * @param PolygonWKT 136 | * @return 137 | * @throws ParseException 138 | */ 139 | public Polygon createPolygonByWKT(String PolygonWKT) throws ParseException{ 140 | WKTReader reader = new WKTReader( geometryFactory ); 141 | return (Polygon) reader.read(PolygonWKT); 142 | } 143 | 144 | /** 145 | * 3.2 根据几何对象的WKT描述【String】创建几何对象: 多多边形 【MultiPolygon】 146 | * @param MPolygonWKT 147 | * @return 148 | * @throws ParseException 149 | */ 150 | public MultiPolygon createMulPolygonByWKT(String MPolygonWKT) throws ParseException{ 151 | WKTReader reader = new WKTReader( geometryFactory ); 152 | return (MultiPolygon) reader.read(MPolygonWKT); 153 | } 154 | 155 | /** 156 | * 根据多边形数组 进行多多边形的创建 157 | * @param polygons 158 | * @return 159 | * @throws ParseException 160 | */ 161 | public MultiPolygon createMulPolygonByPolygon(Polygon[] polygons) throws ParseException{ 162 | return geometryFactory.createMultiPolygon(polygons); 163 | } 164 | 165 | /** 166 | * 4.1 根据几何对象数组,创建几何对象集合:【GeometryCollection】 167 | * @return 168 | * @throws ParseException 169 | */ 170 | public GeometryCollection createGeoCollect(Geometry[] geoArray) throws ParseException{ 171 | return geometryFactory.createGeometryCollection(geoArray); 172 | } 173 | 174 | /** 175 | * 5.1 根据圆点以及半径创建几何对象:特殊的多边形--圆 【Polygon】 176 | * @param x 圆点x坐标 177 | * @param y 圆点y坐标 178 | * @param radius 半径 179 | * @return 180 | */ 181 | public Polygon createCircle(double x, double y, final double radius){ 182 | 183 | //圆上面的点个数 184 | final int sides = 32; 185 | Coordinate[] coords = new Coordinate[sides+1]; 186 | for( int i = 0; i < sides; i++){ 187 | double angle = ((double) i / (double) sides) * Math.PI * 2.0; 188 | double dx = Math.cos( angle ) * radius; 189 | double dy = Math.sin( angle ) * radius; 190 | coords[i] = new Coordinate( (double) x + dx, (double) y + dy ); 191 | } 192 | coords[sides] = coords[0]; 193 | //线性环 194 | LinearRing ring = geometryFactory.createLinearRing(coords); 195 | return geometryFactory.createPolygon(ring, null); 196 | } 197 | 198 | 199 | /** 200 | * 6.1 根据WKT创建环 201 | * @param ringWKT 202 | * @return 203 | * @throws ParseException 204 | */ 205 | public LinearRing createLinearRingByWKT(String ringWKT) throws ParseException{ 206 | WKTReader reader = new WKTReader( geometryFactory ); 207 | return (LinearRing) reader.read(ringWKT); 208 | } 209 | 210 | /** 211 | * 几何对象转GeoJson对象 212 | * @param geometry 213 | * @return 214 | * @throws Exception 215 | */ 216 | public static String geometryToGeoJson(Geometry geometry) throws Exception { 217 | if (geometry == null) { 218 | return null; 219 | } 220 | StringWriter writer = new StringWriter(); 221 | geometryJson.write(geometry, writer); 222 | String geojson = writer.toString(); 223 | writer.close(); 224 | return geojson; 225 | } 226 | 227 | /** 228 | * GeoJson转几何对象 229 | * @param geojson 230 | * @return 231 | * @throws Exception 232 | */ 233 | public static Geometry geoJsonToGeometry(String geojson) throws Exception { 234 | return geometryJson.read(new StringReader(geojson)); 235 | } 236 | 237 | } 238 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/geotools/ShpTools.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.geotools; 2 | 3 | import com.appleyk.IO.StringTokenReader; 4 | import com.appleyk.pojos.ShpDatas; 5 | import com.appleyk.pojos.ShpInfo; 6 | import com.appleyk.result.ResponseMessage; 7 | import com.appleyk.result.ResponseResult; 8 | import org.apache.commons.lang3.StringUtils; 9 | import org.geotools.data.*; 10 | import org.geotools.data.shapefile.ShapefileDataStore; 11 | import org.geotools.data.shapefile.ShapefileDataStoreFactory; 12 | import org.geotools.data.simple.SimpleFeatureSource; 13 | import org.geotools.feature.FeatureCollection; 14 | import org.geotools.feature.FeatureIterator; 15 | import org.geotools.feature.simple.SimpleFeatureTypeBuilder; 16 | import org.geotools.geometry.jts.ReferencedEnvelope; 17 | import org.geotools.map.FeatureLayer; 18 | import org.geotools.map.Layer; 19 | import org.geotools.map.MapContent; 20 | import org.geotools.referencing.crs.DefaultGeographicCRS; 21 | import org.geotools.renderer.lite.StreamingRenderer; 22 | import org.geotools.styling.SLD; 23 | import org.geotools.styling.Style; 24 | import org.geotools.swing.JMapFrame; 25 | import org.geotools.swing.data.JFileDataStoreChooser; 26 | import org.locationtech.jts.geom.*; 27 | import org.locationtech.jts.geom.Point; 28 | import org.locationtech.jts.geom.Polygon; 29 | import org.opengis.feature.Property; 30 | import org.opengis.feature.simple.SimpleFeature; 31 | import org.opengis.feature.simple.SimpleFeatureType; 32 | import org.springframework.util.ResourceUtils; 33 | 34 | import javax.imageio.ImageIO; 35 | import javax.servlet.http.HttpServletResponse; 36 | import java.awt.*; 37 | import java.awt.image.BufferedImage; 38 | import java.io.File; 39 | import java.io.IOException; 40 | import java.io.Serializable; 41 | import java.nio.charset.Charset; 42 | import java.nio.charset.StandardCharsets; 43 | import java.text.SimpleDateFormat; 44 | import java.util.Collection; 45 | import java.util.HashMap; 46 | import java.util.Map; 47 | 48 | /** 49 | *

ShapeFile文件读写工具类

50 | * @author Appleyk 51 | * @blob https://blog.csdn.net/appleyk 52 | * @date Created on 上午 11:54 2018-10-12 53 | */ 54 | public class ShpTools { 55 | 56 | /**几何对象构造器【自定义的】*/ 57 | private static GeometryCreator gCreator = GeometryCreator.getInstance(); 58 | 59 | /**边界*/ 60 | private static ReferencedEnvelope bounds; 61 | 62 | /**画布的宽度*/ 63 | private static final int IMAGE_WIDTH = 1280; 64 | 65 | /**画布的高度*/ 66 | private static final int IMAGE_HEIGHT = 1200; 67 | 68 | /** 69 | * 通过shp文件路径,读取shp内容 70 | * @param filePath 文件路径 71 | */ 72 | public static ShpDatas readShpByPath(String filePath,Integer limit) throws Exception { 73 | 74 | // 一个数据存储实现,允许从Shapefiles读取和写入 75 | ShapefileDataStore shpDataStore = new ShapefileDataStore(new File(filePath).toURI().toURL()); 76 | // 设置编码【防止中文乱码】 77 | shpDataStore.setCharset(StandardCharsets.UTF_8); 78 | 79 | // getTypeNames:获取所有地理图层,这里我只取第一个【如果是数据表,取出的就是表名】 80 | String typeName = shpDataStore.getTypeNames()[0]; 81 | System.out.println("shp【图层】名称:"+typeName); 82 | FeatureCollection result = getFeatures(shpDataStore, typeName); 83 | 84 | // 迭代特征集合 85 | FeatureIterator iterator = result.features(); 86 | 87 | ShpDatas shpDatas = new ShpDatas(); 88 | shpDatas.setName(typeName); 89 | shpDatas.setShpPath(filePath); 90 | buildShpDatas(limit, iterator, shpDatas); 91 | iterator.close(); 92 | return shpDatas; 93 | } 94 | 95 | 96 | /** 97 | * 根据数据源及图层名称拿到特征集合 98 | * @param shpDataStore shp数据存储对象 99 | * @param typeName 图层名称 100 | * @return FeatureCollection 101 | */ 102 | private static FeatureCollection getFeatures(ShapefileDataStore shpDataStore, String typeName) throws IOException { 103 | 104 | // 通过此接口可以引用单个shapefile、数据库表等。与数据存储进行比较和约束 105 | FeatureSource featureSource = shpDataStore.getFeatureSource(typeName); 106 | // 一个用于处理FeatureCollection的实用工具类。提供一个获取FeatureCollection实例的机制 107 | FeatureCollection result = featureSource.getFeatures(); 108 | System.out.println("地理要素【记录】:"+result.size()+"个"); 109 | System.out.println("=================================="); 110 | return result; 111 | } 112 | 113 | /** 114 | * 构建shpDatas对象 115 | * @param limit 要素查询限制数 116 | * @param iterator 迭代器 117 | * @param shpDatas shp封装的数据集 118 | */ 119 | private static void buildShpDatas(Integer limit, FeatureIterator iterator, ShpDatas shpDatas) { 120 | // 这里我们只迭代前limit个 121 | int stop = 0; 122 | while (iterator.hasNext()) { 123 | if (stop > limit) { 124 | break; 125 | } 126 | // 拿到一个特征 127 | SimpleFeature feature = iterator.next(); 128 | // 取出特征里面的属性集合 129 | Collection p = feature.getProperties(); 130 | 131 | // 遍历属性集合 132 | Map prop = new HashMap<>(); 133 | for (Property pro : p) { 134 | String key = pro.getName().toString(); 135 | String val; 136 | if ("java.util.Date".equals(pro.getType().getBinding().getName())){ 137 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); 138 | val = pro.getValue() ==null ? "" : dateFormat.format(pro.getValue()); 139 | }else{ 140 | val = pro.getValue()==null ?"":pro.getValue().toString(); 141 | } 142 | prop.put(key, val); 143 | System.out.println("key【字段】:"+key+"\t||value【值】:"+val); 144 | } 145 | System.out.println("\n============================ 序号:"+stop+"\n"); 146 | shpDatas.addProp(prop); 147 | stop++; 148 | } // end 最外层 while 149 | } 150 | 151 | /** 152 | * 将一个几何对象写进shapefile 153 | * @param filePath 文件路径 154 | * @param geometry 几何对象 155 | */ 156 | public static void writeShpByGeom(String filePath, Geometry geometry) throws Exception{ 157 | 158 | ShapefileDataStore ds = getshpDS(filePath, geometry); 159 | 160 | FeatureWriter writer = ds.getFeatureWriter(ds.getTypeNames()[0], 161 | Transaction.AUTO_COMMIT); 162 | 163 | // Interface SimpleFeature:一个由固定列表值以已知顺序组成的SimpleFeatureType实例。 164 | SimpleFeature feature = writer.next(); 165 | feature.setAttribute("name", "XXXX名称"); 166 | feature.setAttribute("path", "c:/test"); 167 | feature.setAttribute("the_geom", geometry); 168 | feature.setAttribute("id", 1010L); 169 | feature.setAttribute("des", "XXXX描述"); 170 | 171 | System.out.println("========= 写入【"+geometry.getGeometryType()+"】成功 !========="); 172 | 173 | // 写入 174 | writer.write(); 175 | // 关闭 176 | writer.close(); 177 | // 释放资源 178 | ds.dispose(); 179 | } 180 | 181 | 182 | /** 183 | * 将一个几何对象写进shapefile 184 | * @param shpInfo shp信息 185 | */ 186 | public static ResponseResult writeShpByGeom(ShpInfo shpInfo) throws Exception{ 187 | 188 | // 特殊字符串解析器 189 | StringTokenReader reader = new StringTokenReader(); 190 | // 根据几何对象的wkt字符串,反解【解析】成Geometry对象 191 | Geometry geometry = reader.read(shpInfo.getGeom()); 192 | // 拿到shp对象所在的目录【文件夹】 193 | String path = shpInfo.getPath(); 194 | File file = new File(path); 195 | if(!file.exists()){ 196 | file.mkdir(); 197 | } 198 | 199 | if(!file.isDirectory()){ 200 | return new ResponseResult(ResponseMessage.BAD_REQUEST,"path不是有效的文件夹" ); 201 | } 202 | 203 | String filePath = shpInfo.getPath()+"/"+shpInfo.getName()+".shp"; 204 | ShapefileDataStore ds = getshpDS(filePath, geometry); 205 | String typeName = ds.getTypeNames()[0]; 206 | FeatureWriter writer ; 207 | if(shpInfo.isAppendWrite()){ 208 | // 追加写几何对象 209 | writer = ds.getFeatureWriterAppend(typeName, Transaction.AUTO_COMMIT); 210 | }else{ 211 | // 覆盖写几何对象 212 | writer = ds.getFeatureWriter(typeName, Transaction.AUTO_COMMIT); 213 | } 214 | 215 | // Interface SimpleFeature:一个由固定列表值以已知顺序组成的SimpleFeatureType实例。 216 | SimpleFeature feature = writer.next(); 217 | feature.setAttribute("name", shpInfo.getName()); 218 | feature.setAttribute("path", shpInfo.getPath()); 219 | feature.setAttribute("the_geom", geometry); 220 | feature.setAttribute("id", shpInfo.getId()); 221 | feature.setAttribute("des", shpInfo.getDes()); 222 | 223 | System.out.println("========= 写入【"+geometry.getGeometryType()+"】成功 !========="); 224 | 225 | // 写入 226 | writer.write(); 227 | // 关闭 228 | writer.close(); 229 | // 释放资源 230 | ds.dispose(); 231 | // 返回创建成功后的shp文件路径 232 | return new ResponseResult(ResponseMessage.OK,filePath); 233 | 234 | } 235 | 236 | /** 237 | * 拿到配置好的DataStore 238 | * @param filePath 文件路径 239 | * @param geometry 几何对象 240 | * @return ShapefileDataStore 241 | */ 242 | private static ShapefileDataStore getshpDS(String filePath, Geometry geometry) throws IOException { 243 | // 1.创建shape文件对象 244 | File file = new File(filePath); 245 | 246 | Map params = new HashMap<>(); 247 | 248 | // 2、用于捕获参数需求的数据类 URLP:url to the .shp file. 249 | params.put(ShapefileDataStoreFactory.URLP.key, file.toURI().toURL()); 250 | 251 | // 3、创建一个新的数据存储【如果存在,则不创建】 252 | ShapefileDataStore ds = (ShapefileDataStore) new ShapefileDataStoreFactory().createNewDataStore(params); 253 | 254 | // 4、定义图形信息和属性信息 -- SimpleFeatureTypeBuilder 构造简单特性类型的构造器 255 | SimpleFeatureTypeBuilder tBuilder = new SimpleFeatureTypeBuilder(); 256 | 257 | // 5、设置 -- WGS84:一个二维地理坐标参考系统,使用WGS84数据 258 | tBuilder.setCRS(DefaultGeographicCRS.WGS84); 259 | tBuilder.setName("shapefile"); 260 | 261 | // 添加名称 262 | tBuilder.add("name", String.class); 263 | // 添加shp所在目录名称 264 | tBuilder.add("path", String.class); 265 | // 添加 一个几何对象 266 | tBuilder.add("the_geom", geometry.getClass()); 267 | // 添加一个id 268 | tBuilder.add("id", Long.class); 269 | // 添加描述 270 | tBuilder.add("des", String.class); 271 | 272 | // 设置此数据存储的特征类型 273 | ds.createSchema(tBuilder.buildFeatureType()); 274 | // 设置编码 275 | ds.setCharset(StandardCharsets.UTF_8); 276 | return ds; 277 | } 278 | 279 | /** 280 | * 打开shp文件,获取地图内容 281 | * @param filePath 文件路径 282 | * @param isOpenByChoose 是否自定义打开shp文件 283 | * @throws Exception 284 | */ 285 | public static MapContent getMapContentByPath(String filePath,boolean isOpenByChoose,String color) throws Exception{ 286 | 287 | File file; 288 | if(isOpenByChoose){ 289 | // 1.1、 数据源选择 shp扩展类型的 290 | file = JFileDataStoreChooser.showOpenFile("shp", null); 291 | }else{ 292 | // 1.2、根据路径拿到文件对象 293 | file = new File(filePath); 294 | } 295 | 296 | if(file==null){ 297 | return null; 298 | } 299 | // 2、得到打开的文件的数据源 300 | FileDataStore store = FileDataStoreFinder.getDataStore(file); 301 | 302 | // 3、设置数据源的编码,防止中文乱码 303 | ((ShapefileDataStore)store).setCharset(Charset.forName("UTF-8")); 304 | 305 | /** 306 | * 使用FeatureSource管理要素数据 307 | * 使用Style(SLD)管理样式 308 | * 使用Layer管理显示 309 | * 使用MapContent管理所有地图相关信息 310 | */ 311 | 312 | // 4、以java对象的方式访问地理信息 -- 简单地理要素 313 | SimpleFeatureSource featureSource = store.getFeatureSource(); 314 | 315 | bounds = featureSource.getBounds(); 316 | 317 | // 5、创建映射内容,并将我们的shapfile添加进去 318 | MapContent mapContent = new MapContent(); 319 | 320 | // 6、设置容器的标题 321 | mapContent.setTitle("Appleyk's GeoTools"); 322 | Color color1; 323 | if(color == null || "".equals(color.toLowerCase())){ 324 | color1 = Color.BLACK; 325 | }else if("red".equals(color.toLowerCase())){ 326 | color1 = Color.RED; 327 | }else if("green".equals(color.toLowerCase())){ 328 | color1 = Color.GREEN; 329 | }else if("blue".equals(color.toLowerCase())){ 330 | color1 = Color.BLUE; 331 | }else{ 332 | color1 = Color.getColor(color); 333 | } 334 | 335 | // 7、创建简单样式 【颜色填充】 336 | Style style = SLD.createSimpleStyle(featureSource.getSchema(),color1); 337 | 338 | // 8、显示【shapfile地理信息+样式】 339 | Layer layer = new FeatureLayer(featureSource, style); 340 | 341 | // 9、将显示添加进map容器 342 | mapContent.addLayer(layer); 343 | 344 | return mapContent; 345 | } 346 | 347 | public static void showMap(MapContent mapContent){ 348 | JMapFrame.showMap(mapContent); 349 | } 350 | 351 | /** 352 | * shp文件转Image【格式定png】 353 | * @param shpFilePath shp目标文件 354 | * @param destImagePath 转成图片的文件 == 如果没有,转成的图片写进response输出流里 355 | * @param response 响应流 356 | * @throws Exception 357 | */ 358 | public static void shp2Image(String shpFilePath,String destImagePath,String color, HttpServletResponse response) throws Exception{ 359 | 360 | // 流渲染器 361 | StreamingRenderer renderer = new StreamingRenderer(); 362 | MapContent mapContent = getMapContentByPath(shpFilePath,false,color ); 363 | renderer.setMapContent(mapContent); 364 | Rectangle imageBounds = new Rectangle(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT); 365 | BufferedImage dumpImage = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB); 366 | Graphics2D g2d = dumpImage.createGraphics(); 367 | g2d.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT); 368 | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 369 | renderer.paint(g2d, imageBounds, bounds); 370 | g2d.dispose(); 371 | if(destImagePath == null || "".equals(destImagePath)){ 372 | ImageIO.write(dumpImage, "png", response.getOutputStream()); 373 | }else{ 374 | ImageIO.write(dumpImage, "png", new File(destImagePath)); 375 | } 376 | } 377 | 378 | public static void main(String[] args) throws Exception{ 379 | 380 | File file = ResourceUtils.getFile("classpath:static/shpTest[Point]/dp_tl.shp"); 381 | // 从shp文件里面读取属性信息 382 | readShpByPath(file.getAbsolutePath(),10); 383 | System.out.println("=================下面开始往shp文件里面写几何对象==================="); 384 | 385 | // 先创建文件夹test 386 | String filePath = "C:/test/test.shp"; 387 | 388 | String pointWkt="POINT (120.76164848270959 31.22001141278534)"; 389 | Point point = gCreator.createPointByWKT(pointWkt); 390 | 391 | // Polygon【面】 392 | String polygonWkt="POLYGON ((103.859188 34.695908, 103.85661 34.693788, 103.862027 34.69259, 103.863709 34.695078, 103.859188 34.695908))"; 393 | Polygon polygon = gCreator.createPolygonByWKT(polygonWkt); 394 | 395 | // LineString【线】 396 | String linestringWkt="LINESTRING(113.511315990174 41.7274734296674,113.51492087909 41.7284983348307,113.516079593384 41.727649586406,113.515907932007 41.7262243043929,113.514019656861 41.7247989907606,113.512131381714 41.7250872589898,113.51138036319 41.7256637915682,113.511315990174 41.7274734296674)"; 397 | LineString lineString = gCreator.createLineByWKT(linestringWkt); 398 | 399 | // MultiPolygon【多面】 400 | String multiPolyWkt = "MULTIPOLYGON(((101.870371 25.19228,101.873633 25.188183,101.880564 25.184416,101.886808 25.186028,101.892043 25.189969,101.896592 25.190163,101.903716 25.190785,101.905454 25.193464,101.899897 25.196202,101.894146 25.197911,101.891657 25.19826,101.886078 25.197658,101.884211145538 25.2007060137013,101.88172564506 25.1949712942389,101.87874 25.199619,101.874641 25.200998,101.868547 25.202415,101.863741 25.202415,101.85887 25.202842,101.854557 25.202182,101.852604 25.199736,101.852282 25.19628,101.854492 25.194183,101.855608 25.192668,101.863698 25.192105,101.870371 25.19228)))"; 401 | MultiPolygon multiPolygon = gCreator.createMulPolygonByWKT(multiPolyWkt); 402 | 403 | // 几何对象的范围【矩形边界】 404 | Envelope envelope = polygon.getEnvelopeInternal(); 405 | System.out.println(envelope); 406 | 407 | // 往shp文件里面写几何对象 408 | writeShpByGeom(filePath,point); 409 | } 410 | 411 | } 412 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/pojos/ShpDatas.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.pojos; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | *

shp数据模型对象 -- 针对读

9 | * @author Appleyk 10 | * @blob https://blog.csdn.net/appleyk 11 | * @date Created on 下午 2018年10月24日16:31:30 12 | */ 13 | public class ShpDatas { 14 | 15 | private String name; 16 | 17 | /** 属性【字段】集合*/ 18 | private List> props; 19 | 20 | /** shp文件路径地址*/ 21 | private String shpPath; 22 | 23 | public ShpDatas(){ 24 | props = new ArrayList<>(); 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | public List> getProps() { 36 | return props; 37 | } 38 | 39 | public void setProps(List> props) { 40 | this.props = props; 41 | } 42 | 43 | public void addProp(Map prop){ 44 | this.props.add(prop); 45 | } 46 | 47 | public String getShpPath() { 48 | return shpPath; 49 | } 50 | 51 | public void setShpPath(String shpPath) { 52 | this.shpPath = shpPath; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/pojos/ShpInfo.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.pojos; 2 | 3 | /** 4 | *

shp业务模型对象 -- 针对写

5 | * @author Appleyk 6 | * @blob https://blog.csdn.net/appleyk 7 | * @date Created on 上午 2018年10月25日09:17:44 8 | */ 9 | public class ShpInfo { 10 | 11 | 12 | /** 13 | * 图层名称 14 | */ 15 | private String name; 16 | 17 | /** 18 | * 往哪个路径下写shp 19 | */ 20 | private String path; 21 | 22 | /** 23 | * 几何对象WKT 24 | */ 25 | private String geom; 26 | 27 | /** 28 | * 标识 29 | */ 30 | private String id; 31 | 32 | /** 33 | * 描述 34 | */ 35 | private String des; 36 | 37 | /** 38 | * 是否追加写 39 | */ 40 | private boolean appendWrite = false; 41 | 42 | public ShpInfo(){ 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public void setName(String name) { 50 | this.name = name; 51 | } 52 | 53 | public String getPath() { 54 | return path; 55 | } 56 | 57 | public void setPath(String path) { 58 | this.path = path; 59 | } 60 | 61 | public String getGeom() { 62 | return geom; 63 | } 64 | 65 | public void setGeom(String geom) { 66 | this.geom = geom; 67 | } 68 | 69 | public String getId() { 70 | return id; 71 | } 72 | 73 | public void setId(String id) { 74 | this.id = id; 75 | } 76 | 77 | public String getDes() { 78 | return des; 79 | } 80 | 81 | public void setDes(String des) { 82 | this.des = des; 83 | } 84 | 85 | public boolean isAppendWrite() { 86 | return appendWrite; 87 | } 88 | 89 | public void setAppendWrite(boolean appendWrite) { 90 | this.appendWrite = appendWrite; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/result/ResponseMessage.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.result; 2 | 3 | public enum ResponseMessage { 4 | 5 | /** 6 | * 成功 7 | */ 8 | OK(200,"成功"), 9 | 10 | /** 11 | * 失败 12 | */ 13 | BAD_REQUEST(400,"错误的请求"); 14 | 15 | 16 | private final int status; 17 | private final String message; 18 | 19 | ResponseMessage(int status, String message){ 20 | this.status = status; 21 | this.message = message; 22 | } 23 | 24 | public int getStatus() { 25 | return status; 26 | } 27 | public String getMessage() { 28 | return message; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/result/ResponseResult.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.result; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | public class ResponseResult implements Serializable { 13 | 14 | private static final long serialVersionUID = 2719931935414658118L; 15 | 16 | private final Integer status; 17 | 18 | private final String message; 19 | 20 | @JsonInclude(value = Include.NON_NULL) 21 | private final Object data; 22 | 23 | @JsonInclude(value = Include.NON_EMPTY) 24 | private final String[] exceptions; 25 | 26 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 27 | private final Date timestamp; 28 | 29 | public ResponseResult(Integer status, String message) { 30 | 31 | super(); 32 | this.status = status; 33 | this.message = message; 34 | this.data = null; 35 | this.timestamp = new Date(); 36 | this.exceptions = null; 37 | } 38 | 39 | public ResponseResult() { 40 | 41 | super(); 42 | this.status = null; 43 | this.message = null; 44 | this.data = null; 45 | this.timestamp = new Date(); 46 | this.exceptions = null; 47 | 48 | } 49 | 50 | public ResponseResult(ResponseMessage rm){ 51 | 52 | super(); 53 | this.status = rm.getStatus(); 54 | this.message = rm.getMessage(); 55 | this.data = null; 56 | this.timestamp = new Date(); 57 | this.exceptions = null; 58 | } 59 | 60 | public ResponseResult(ResponseMessage rm, Object data){ 61 | super(); 62 | this.status = rm.getStatus(); 63 | this.message = rm.getMessage(); 64 | this.data = data; 65 | this.timestamp = new Date(); 66 | this.exceptions = null; 67 | } 68 | 69 | public ResponseResult(ResponseMessage rm, Long data){ 70 | super(); 71 | this.status = rm.getStatus(); 72 | this.message = rm.getMessage(); 73 | HashMap result = new HashMap<>(); 74 | result.put("id", data); 75 | this.data = result; 76 | this.timestamp = new Date(); 77 | this.exceptions = null; 78 | } 79 | 80 | 81 | public ResponseResult(Integer status, String message, Object data) { 82 | super(); 83 | this.status = status; 84 | this.message = message; 85 | this.data = data; 86 | this.timestamp = new Date(); 87 | this.exceptions = null; 88 | } 89 | 90 | public ResponseResult(Integer status, String message, String key, Object value) { 91 | super(); 92 | this.status = status; 93 | this.message = message; 94 | Map map = new HashMap(); 95 | 96 | if (key == null || ("").equals(key)) { 97 | map.put("key", value); 98 | } else { 99 | map.put(key, value); 100 | } 101 | this.data = map; 102 | this.timestamp = new Date(); 103 | this.exceptions = null; 104 | 105 | } 106 | 107 | public ResponseResult(Integer status, Throwable ex) { 108 | super(); 109 | this.status = status; 110 | this.message = ex.getMessage(); 111 | this.data = null; 112 | StackTraceElement[] stackTeanceElement = ex.getStackTrace(); 113 | this.exceptions = new String[stackTeanceElement.length]; 114 | for (int i = 0; i < stackTeanceElement.length; i++) { 115 | this.exceptions[i] = stackTeanceElement[i].toString(); 116 | } 117 | this.timestamp = new Date(); 118 | } 119 | 120 | public ResponseResult(Integer status, String message, Throwable ex) { 121 | 122 | super(); 123 | this.status = status; 124 | this.message = message; 125 | this.data = null; 126 | StackTraceElement[] stackTeanceElement = ex.getStackTrace(); 127 | this.exceptions = new String[stackTeanceElement.length]; 128 | for (int i = 0; i < stackTeanceElement.length; i++) { 129 | this.exceptions[i] = stackTeanceElement[i].toString(); 130 | } 131 | this.timestamp = new Date(); 132 | 133 | } 134 | public Integer getStatus() { 135 | return status; 136 | } 137 | 138 | public String getMessage() { 139 | return message; 140 | } 141 | 142 | public Object getData() { 143 | return data; 144 | } 145 | 146 | public String[] getExceptions() { 147 | return exceptions; 148 | } 149 | 150 | public Date getTimestamp() { 151 | return timestamp; 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /src/main/java/com/appleyk/service/ShpService.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.service; 2 | 3 | import com.appleyk.geotools.ShpTools; 4 | import com.appleyk.pojos.ShpDatas; 5 | import com.appleyk.pojos.ShpInfo; 6 | import com.appleyk.result.ResponseMessage; 7 | import com.appleyk.result.ResponseResult; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | /** 13 | *

Shp业务逻辑类

14 | * @author Appleyk 15 | * @blob https://blog.csdn.net/appleyk 16 | * @date Created on 下午 2018年10月24日17:17:46 17 | */ 18 | @Service 19 | public class ShpService { 20 | 21 | public ResponseResult getShpDatas(String shpPath,Integer limit) throws Exception{ 22 | ShpDatas shpDatas = ShpTools.readShpByPath(shpPath, limit); 23 | return new ResponseResult(ResponseMessage.OK,shpDatas); 24 | } 25 | 26 | public void showShp(String shpPath,String imagePath,String color, HttpServletResponse response) throws Exception{ 27 | ShpTools.shp2Image(shpPath, imagePath ,color,response); 28 | } 29 | 30 | public ResponseResult writeShp(ShpInfo shpInfo) throws Exception{ 31 | return ShpTools.writeShpByGeom(shpInfo); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 2 | server.servlet.session.timeout=10 3 | server.tomcat.uri-encoding=utf8 4 | -------------------------------------------------------------------------------- /src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | server.port=8082 2 | server.servlet.session.timeout=10 3 | server.tomcat.uri-encoding=utf8 4 | -------------------------------------------------------------------------------- /src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | server.port=8083 2 | server.servlet.session.timeout=10 3 | server.tomcat.uri-encoding=utf8 4 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #SpringApplication\u5C06\u4ECE\u4EE5\u4E0B\u4F4D\u7F6E\u52A0\u8F7Dapplication.properties\u6587\u4EF6\uFF0C \u5E76\u628A\u5B83\u4EEC\u6DFB\u52A0\u5230Spring Environment\u4E2D\uFF1A 2 | #1. \u5F53\u524D\u76EE\u5F55\u4E0B\u7684\u4E00\u4E2A/config\u5B50\u76EE\u5F55 3 | #2. \u5F53\u524D\u76EE\u5F55 4 | #3. \u4E00\u4E2Aclasspath\u4E0B\u7684/config\u5305 5 | #4. classpath\u6839\u8DEF\u5F84\uFF08root\uFF09 6 | #\u8FD9\u4E2A\u5217\u8868\u662F\u6309\u4F18\u5148\u7EA7\u6392\u5E8F\u7684\uFF08\u5217\u8868\u4E2D\u4F4D\u7F6E\u9AD8\u7684\u5C06\u8986\u76D6\u4F4D\u7F6E\u4F4E\u7684\uFF09 \u3002 7 | #\u6CE8\uFF1A\u4F60\u53EF\u4EE5\u4F7F\u7528YAML\uFF08'.yml'\uFF09 \u6587\u4EF6\u66FF\u4EE3'.properties' 8 | 9 | #Spring-Boot\u591A\u73AF\u5883\u914D\u7F6E -- dev\uFF1A \u672C\u5730\u5F00\u53D1\u73AF\u5883\u3010\u7AEF\u53E3\uFF1A8081\u3011 10 | #Spring-Boot\u591A\u73AF\u5883\u914D\u7F6E -- prod\uFF1A\u7EBF\u4E0A\u751F\u4EA7\u73AF\u5883\u3010\u7AEF\u53E3\uFF1A8082\u3011 11 | #Spring-Boot\u591A\u73AF\u5883\u914D\u7F6E -- test\uFF1A\u7EBF\u4E0A\u6D4B\u8BD5\u73AF\u5883\u3010\u7AEF\u53E3\uFF1A8083\u3011 12 | 13 | #\u5F00\u542F\u591A\u6587\u4EF6\u4E0A\u4F20 14 | spring.servlet.multipart.enabled=true 15 | 16 | spring.profiles.active = dev 17 | 18 | #\u5728application.properties\u6587\u4EF6\u4E2D\u5F15\u5165\u65E5\u5FD7\u914D\u7F6E\u6587\u4EF6 19 | #===================================== log ============================= 20 | logging.config=classpath:logback-boot.xml 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/logback-boot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d %p (%file:%line\)- %m%n 8 | 9 | UTF-8 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | opt/spring-boot-web/logs/sys.log 19 | 20 | 21 | 22 | 23 | 24 | log/sys.%d.%i.log 25 | 26 | 30 27 | 28 | 29 | 10MB 30 | 31 | 32 | 33 | 34 | 35 | %d %p (%file:%line\)- %m%n 36 | 37 | 38 | UTF-8 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/static/ReadMe: -------------------------------------------------------------------------------- 1 | 本项目的测试shp均在shpTest文件夹下 2 | 3 | ============== 一个shp只支持一种几何类型 4 | 5 | Point类型 : 某地方的大棚数据 6 | LineString类型: 中国铁路网【部分】 7 | Polygon类型 : 中国建筑物【部分 -- 北京故宫】 8 | 9 | ============== 10 | 11 | E:\Spring-boot\Spring-Boot-Shaper\src\main\resources\static\shpTest[Point]\dp_tl.shp 12 | E:\Spring-boot\Spring-Boot-Shaper\src\main\resources\static\shpTest[Polygon]\china_building_part.shp -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[LineString]/china_railways.cpg: -------------------------------------------------------------------------------- 1 | UTF-8 -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[LineString]/china_railways.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[LineString]/china_railways.dbf -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[LineString]/china_railways.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[LineString]/china_railways.qpj: -------------------------------------------------------------------------------- 1 | GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] 2 | -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[LineString]/china_railways.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[LineString]/china_railways.shp -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[LineString]/china_railways.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[LineString]/china_railways.shx -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.dbf: -------------------------------------------------------------------------------- 1 | v a MIdNzN 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39 0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47 0 48 0 49 0 50 0 51 0 52 0 53 0 54 0 55 0 56 0 57 0 58 0 59 0 60 0 61 0 62 0 63 0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71 0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79 0 80 0 81 0 82 0 83 0 84 0 85 0 86 0 87 0 88 0 89 0 90 0 91 0 92 0 93 0 94 0 95 0 96 0 97 0 98 0 99 0 100 0 101 0 102 0 103 0 104 0 105 0 106 0 107 0 108 0 109 0 110 0 111 0 112 0 113 0 114 0 115 0 116 0 117 0 118 0 119 0 120 0 121 0 122 0 123 0 124 0 125 0 126 0 127 0 128 0 129 0 130 0 131 0 132 0 133 0 134 0 135 0 136 0 137 0 138 0 139 0 140 0 141 0 142 0 143 0 144 0 145 0 146 0 147 0 148 0 149 0 150 0 151 0 152 0 153 0 154 0 155 0 156 0 157 0 158 0 159 0 160 0 161 0 162 0 163 0 164 0 165 0 166 0 167 0 168 0 169 0 170 0 171 0 172 0 173 0 174 0 175 0 176 0 177 0 178 0 179 0 180 0 181 0 182 0 183 0 184 0 185 0 186 0 187 0 188 0 189 0 190 0 191 0 192 0 193 0 194 0 195 0 196 0 197 0 198 0 199 0 200 0 201 0 202 0 203 0 204 0 205 0 206 0 207 0 208 0 209 0 210 0 211 0 212 0 213 0 214 0 215 0 216 0 217 0 218 0 219 0 220 0 221 0 222 0 223 0 224 0 225 0 226 0 227 0 228 0 229 0 230 0 231 0 232 0 233 0 234 0 235 0 236 0 237 0 238 0 239 0 240 0 241 0 242 0 243 0 244 0 245 0 246 0 247 0 248 0 249 0 250 0 251 0 252 0 253 0 254 0 255 0 256 0 257 0 258 0 259 0 260 0 261 0 262 0 263 0 264 0 265 0 266 0 267 0 268 0 269 0 270 0 271 0 272 0 273 0 274 0 275 0 276 0 277 0 278 0 279 0 280 0 281 0 282 0 283 0 284 0 285 0 286 0 287 0 288 0 289 0 290 0 291 0 292 0 293 0 294 0 295 0 296 0 297 0 298 0 299 0 300 0 301 0 302 0 303 0 304 0 305 0 306 0 307 0 308 0 309 0 310 0 311 0 312 0 313 0 314 0 315 0 316 0 317 0 318 0 319 0 320 0 321 0 322 0 323 0 324 0 325 0 326 0 327 0 328 0 329 0 330 0 331 0 332 0 333 0 334 0 335 0 336 0 337 0 338 0 339 0 340 0 341 0 342 0 343 0 344 0 345 0 346 0 347 0 348 0 349 0 350 0 351 0 352 0 353 0 354 0 355 0 356 0 357 0 358 0 359 0 360 0 361 0 362 0 363 0 364 0 365 0 366 0 367 0 368 0 369 0 370 0 371 0 372 0 373 0 374 0 375 0 376 0 377 0 378 0 379 0 380 0 381 0 382 0 383 0 384 0 385 0 386 0 387 0 388 0 389 0 390 0 391 0 392 0 393 0 394 0 395 0 396 0 397 0 398 0 399 0 400 0 401 0 402 0 403 0 404 0 405 0 406 0 407 0 408 0 409 0 410 0 411 0 412 0 413 0 414 0 415 0 416 0 417 0 418 0 419 0 420 0 421 0 422 0 423 0 424 0 425 0 426 0 427 0 428 0 429 0 430 0 431 0 432 0 433 0 434 0 435 0 436 0 437 0 438 0 439 0 440 0 441 0 442 0 443 0 444 0 445 0 446 0 447 0 448 0 449 0 450 0 451 0 452 0 453 0 454 0 455 0 456 0 457 0 458 0 459 0 460 0 461 0 462 0 463 0 464 0 465 0 466 0 467 0 468 0 469 0 470 0 471 0 472 0 473 0 474 0 475 0 476 0 477 0 478 0 479 0 480 0 481 0 482 0 483 0 484 0 485 0 486 0 487 0 488 0 489 0 490 0 491 0 492 0 493 0 494 0 495 0 496 0 497 0 498 0 499 0 500 0 501 0 502 0 503 0 504 0 505 0 506 0 507 0 508 0 509 0 510 0 511 0 512 0 513 0 514 0 515 0 516 0 517 0 518 0 519 0 520 0 521 0 522 0 523 0 524 0 525 0 526 0 527 0 528 0 529 0 530 0 531 0 532 0 533 0 534 0 535 0 536 0 537 0 538 0 539 0 540 0 541 0 542 0 543 0 544 0 545 0 546 0 547 0 548 0 549 0 550 0 551 0 552 0 553 0 554 0 555 0 556 0 557 0 558 0 559 0 560 0 561 0 562 0 563 0 564 0 565 0 566 0 567 0 568 0 569 0 570 0 571 0 572 0 573 0 574 0 575 0 576 0 577 0 578 0 579 0 580 0 581 0 582 0 583 0 584 0 585 0 586 0 587 0 588 0 589 0 590 0 591 0 592 0 593 0 594 0 595 0 596 0 597 0 598 0 599 0 600 0 601 0 602 0 603 0 604 0 605 0 606 0 607 0 608 0 609 0 610 0 611 0 612 0 613 0 614 0 615 0 616 0 617 0 618 0 619 0 620 0 621 0 622 0 623 0 624 0 625 0 626 0 627 0 628 0 629 0 630 0 631 0 632 0 633 0 634 0 635 0 636 0 637 0 638 0 639 0 640 0 641 0 642 0 643 0 644 0 645 0 646 0 647 0 648 0 649 0 650 0 651 0 652 0 653 0 654 0 655 0 656 0 657 0 658 0 659 0 660 0 661 0 662 0 663 0 664 0 665 0 666 0 667 0 668 0 669 0 670 0 671 0 672 0 673 0 674 0 675 0 676 0 677 0 678 0 679 0 680 0 681 0 682 0 683 0 684 0 685 0 686 0 687 0 688 0 689 0 690 0 691 0 692 0 693 0 694 0 695 0 696 0 697 0 698 0 699 0 700 0 701 0 702 0 703 0 704 0 705 0 706 0 707 0 708 0 709 0 710 0 711 0 712 0 713 0 714 0 715 0 716 0 717 0 718 0 719 0 720 0 721 0 722 0 723 0 724 0 725 0 726 0 727 0 728 0 729 0 730 0 731 0 732 0 733 0 734 0 735 0 736 0 737 0 738 0 739 0 740 0 741 0 742 0 743 0 744 0 745 0 746 0 747 0 748 0 749 0 750 0 751 0 752 0 753 0 754 0 755 0 756 0 757 0 758 0 759 0 760 0 761 0 762 0 763 0 764 0 765 0 766 0 767 0 768 0 769 0 770 0 771 0 772 0 773 0 774 0 775 0 776 0 777 0 778 0 779 0 780 0 781 0 782 0 783 0 784 0 785 0 786 0 787 0 788 0 789 0 790 0 791 0 792 0 793 0 794 0 795 0 796 0 797 0 798 0 799 0 800 0 801 0 802 0 803 0 804 0 805 0 806 0 807 0 808 0 809 0 810 0 811 0 812 0 813 0 814 0 815 0 816 0 817 0 818 0 819 0 820 0 821 0 822 0 823 0 824 0 825 0 826 0 827 0 828 0 829 0 830 0 831 0 832 0 833 0 834 0 835 0 836 0 837 0 838 0 839 0 840 0 841 0 842 0 843 0 844 0 845 0 846 0 847 0 848 0 849 0 850 0 851 0 852 0 853 0 854 0 855 0 856 0 857 0 858 0 859 0 860 0 861 0 862 0 863 0 864 0 865 0 866 0 867 0 868 0 869 0 870 0 871 0 872 0 873 0 874 0 875 0 876 0 877 0 878 0 879 0 880 0 881 0 882 0 883 0 884 0 885 0 886 0 887 0 888 0 889 0 890 0 891 0 892 0 893 0 894 0 895 0 896 0 897 0 898 0 899 0 900 0 901 0 902 0 903 0 904 0 905 0 906 0 907 0 908 0 909 0 910 0 911 0 912 0 913 0 914 0 915 0 916 0 917 0 918 0 919 0 920 0 921 0 922 0 923 0 924 0 925 0 926 0 927 0 928 0 929 0 930 0 931 0 932 0 933 0 934 0 935 0 936 0 937 0 938 0 939 0 940 0 941 0 942 0 943 0 944 0 945 0 946 0 947 0 948 0 949 0 950 0 951 0 952 0 953 0 954 0 955 0 956 0 957 0 958 0 959 0 960 0 961 0 962 0 963 0 964 0 965 0 966 0 967 0 968 0 969 0 970 0 971 0 972 0 973 0 974 0 975 0 976 0 977 0 978 0 979 0 980 0 981 0 982 0 983 0 984 0 985 0 986 0 987 0 988 0 989 0 990 0 991 0 992 0 993 0 994 0 995 0 996 0 997 0 998 0 999 01000 01001 01002 01003 01004 01005 01006 01007 01008 01009 01010 01011 01012 01013 01014 01015 01016 01017 01018 01019 01020 01021 01022 01023 01024 01025 01026 01027 01028 01029 01030 01031 01032 01033 01034 01035 01036 01037 01038 01039 01040 01041 01042 01043 01044 01045 01046 01047 01048 01049 01050 01051 01052 01053 01054 01055 01056 01057 01058 01059 01060 01061 01062 01063 01064 01065 01066 01067 01068 01069 01070 01071 01072 01073 01074 01075 01076 01077 01078 01079 01080 01081 01082 01083 01084 01085 01086 01087 01088 01089 01090 01091 01092 01093 01094 01095 01096 01097 01098 01099 01100 01101 01102 01103 01104 01105 01106 01107 01108 01109 01110 01111 01112 01113 01114 01115 01116 01117 01118 01119 01120 01121 01122 01123 01124 01125 01126 01127 01128 01129 01130 01131 01132 01133 01134 01135 01136 01137 01138 01139 01140 01141 01142 01143 01144 01145 01146 01147 01148 01149 01150 01151 01152 01153 01154 01155 01156 01157 01158 01159 01160 01161 01162 01163 01164 01165 01166 01167 01168 01169 01170 01171 01172 01173 01174 01175 01176 01177 01178 01179 01180 01181 01182 01183 01184 01185 01186 01187 01188 01189 01190 01191 01192 01193 01194 01195 01196 01197 01198 01199 01200 01201 01202 01203 01204 01205 01206 01207 01208 01209 01210 01211 01212 01213 01214 01215 01216 01217 01218 01219 01220 01221 01222 01223 01224 01225 01226 01227 01228 01229 01230 01231 01232 01233 01234 01235 01236 01237 01238 01239 01240 01241 01242 01243 01244 01245 01246 01247 01248 01249 01250 01251 01252 01253 01254 01255 01256 01257 01258 01259 01260 01261 01262 01263 01264 01265 01266 01267 01268 01269 01270 01271 01272 01273 01274 01275 01276 01277 01278 01279 01280 01281 01282 01283 01284 01285 01286 01287 01288 01289 01290 01291 01292 01293 01294 01295 01296 01297 01298 01299 01300 01301 01302 01303 01304 01305 01306 01307 01308 01309 01310 01311 01312 01313 01314 01315 01316 01317 01318 01319 01320 01321 01322 01323 01324 01325 01326 01327 01328 01329 01330 01331 01332 01333 01334 01335 01336 01337 01338 01339 01340 01341 01342 01343 01344 01345 01346 01347 01348 01349 01350 01351 01352 01353 01354 01355 01356 01357 01358 01359 01360 01361 01362 01363 01364 01365 01366 01367 01368 01369 01370 01371 01372 01373 01374 01375 01376 01377 01378 01379 01380 01381 01382 01383 01384 01385 01386 01387 01388 01389 01390 01391 01392 01393 01394 01395 01396 01397 01398 01399 01400 01401 01402 01403 01404 01405 01406 01407 01408 01409 01410 01411 01412 01413 01414 01415 01416 01417 01418 01419 01420 01421 01422 01423 01424 01425 01426 01427 01428 01429 01430 01431 01432 01433 01434 01435 01436 01437 01438 01439 01440 01441 01442 01443 01444 01445 01446 01447 01448 01449 01450 01451 01452 01453 01454 01455 01456 01457 01458 01459 01460 01461 01462 01463 01464 01465 01466 01467 01468 01469 01470 01471 01472 01473 01474 01475 01476 01477 01478 01479 01480 01481 01482 01483 01484 01485 01486 01487 01488 01489 01490 01491 01492 01493 01494 01495 01496 01497 01498 01499 01500 01501 01502 01503 01504 01505 01506 01507 01508 01509 01510 01511 01512 01513 01514 01515 01516 01517 01518 01519 01520 01521 01522 01523 01524 01525 01526 01527 01528 01529 01530 01531 01532 01533 01534 01535 01536 01537 01538 01539 01540 01541 01542 01543 01544 01545 01546 01547 01548 01549 01550 01551 01552 01553 01554 01555 01556 01557 01558 01559 01560 01561 01562 01563 01564 01565 01566 01567 01568 01569 01570 01571 01572 01573 01574 01575 01576 01577 01578 01579 01580 01581 01582 01583 01584 01585 01586 01587 01588 01589 01590 01591 01592 01593 01594 01595 01596 01597 01598 01599 01600 01601 01602 01603 01604 01605 01606 01607 01608 01609 01610 01611 01612 01613 01614 01615 01616 01617 01618 01619 01620 01621 01622 01623 01624 01625 01626 01627 01628 01629 01630 01631 01632 01633 01634 01635 01636 01637 01638 01639 01640 01641 01642 01643 01644 01645 01646 01647 01648 01649 01650 01651 01652 01653 01654 01655 01656 01657 01658 01659 01660 01661 01662 01663 01664 01665 01666 01667 01668 01669 01670 01671 01672 01673 01674 01675 01676 01677 01678 01679 01680 01681 01682 01683 01684 01685 01686 01687 01688 01689 01690 01691 01692 01693 01694 01695 01696 01697 01698 01699 01700 01701 01702 01703 01704 01705 01706 01707 01708 01709 01710 01711 01712 01713 01714 01715 01716 01717 01718 01719 01720 01721 01722 01723 01724 01725 01726 01727 01728 01729 01730 01731 01732 01733 01734 01735 01736 01737 01738 01739 01740 01741 01742 01743 01744 01745 01746 01747 01748 01749 01750 01751 01752 01753 01754 01755 01756 01757 01758 01759 01760 01761 01762 01763 01764 01765 01766 01767 01768 01769 01770 01771 01772 01773 01774 01775 01776 01777 01778 01779 01780 01781 01782 01783 01784 01785 01786 01787 01788 01789 01790 01791 01792 01793 01794 01795 01796 01797 01798 01799 01800 01801 01802 01803 01804 01805 01806 01807 01808 01809 01810 01811 01812 01813 01814 01815 01816 01817 01818 01819 01820 01821 01822 01823 01824 01825 01826 01827 01828 01829 01830 01831 01832 01833 01834 01835 01836 01837 01838 01839 01840 01841 01842 01843 01844 01845 01846 01847 01848 01849 01850 01851 01852 01853 01854 01855 01856 01857 01858 01859 01860 01861 01862 01863 01864 01865 01866 01867 01868 01869 01870 01871 01872 01873 01874 01875 01876 01877 01878 01879 01880 01881 01882 01883 01884 01885 01886 01887 01888 01889 01890 01891 01892 01893 01894 01895 01896 01897 01898 01899 01900 01901 01902 01903 01904 01905 01906 01907 01908 01909 01910 01911 01912 01913 01914 01915 01916 01917 01918 01919 01920 01921 01922 01923 01924 01925 01926 01927 01928 01929 01930 01931 01932 01933 01934 01935 01936 01937 01938 01939 01940 01941 01942 01943 01944 01945 01946 01947 01948 01949 01950 01951 01952 01953 01954 01955 01956 01957 01958 01959 01960 01961 01962 01963 01964 01965 01966 01967 01968 01969 01970 01971 01972 01973 01974 01975 01976 01977 01978 01979 01980 01981 01982 01983 01984 01985 01986 01987 01988 01989 01990 01991 01992 01993 01994 01995 01996 01997 01998 01999 02000 02001 02002 02003 02004 02005 02006 02007 02008 02009 02010 02011 02012 02013 02014 02015 02016 02017 02018 02019 02020 02021 02022 02023 02024 02025 02026 02027 02028 02029 02030 02031 02032 02033 02034 02035 02036 02037 02038 02039 02040 02041 02042 02043 02044 02045 02046 02047 02048 02049 02050 02051 02052 02053 02054 02055 02056 02057 02058 02059 02060 02061 02062 02063 02064 02065 02066 02067 02068 02069 02070 02071 02072 02073 02074 02075 02076 02077 02078 02079 02080 02081 02082 02083 02084 02085 02086 02087 02088 02089 02090 02091 02092 02093 02094 02095 02096 02097 02098 02099 02100 02101 02102 02103 02104 02105 02106 02107 02108 02109 02110 02111 02112 02113 02114 02115 02116 02117 02118 02119 02120 02121 02122 02123 02124 02125 02126 02127 02128 02129 02130 02131 02132 02133 02134 02135 02136 02137 02138 02139 02140 02141 02142 02143 02144 02145 02146 02147 02148 02149 02150 02151 02152 02153 02154 02155 02156 02157 02158 02159 02160 02161 02162 02163 02164 02165 02166 02167 02168 02169 02170 02171 02172 02173 02174 02175 02176 02177 02178 02179 02180 02181 02182 02183 02184 02185 02186 02187 02188 02189 02190 02191 02192 02193 02194 02195 02196 02197 02198 02199 02200 02201 02202 02203 02204 02205 02206 02207 02208 02209 02210 02211 02212 02213 02214 02215 02216 02217 02218 02219 02220 02221 02222 02223 02224 02225 02226 02227 02228 02229 02230 02231 02232 02233 02234 02235 02236 02237 02238 02239 02240 02241 02242 02243 02244 02245 02246 02247 02248 02249 02250 02251 02252 02253 02254 02255 02256 02257 02258 02259 02260 02261 02262 02263 02264 02265 02266 02267 02268 02269 02270 02271 02272 02273 02274 02275 02276 02277 02278 02279 02280 02281 02282 02283 02284 02285 02286 02287 02288 02289 02290 02291 02292 02293 02294 02295 02296 02297 02298 02299 02300 02301 02302 02303 02304 02305 02306 02307 02308 02309 02310 02311 02312 02313 02314 02315 02316 02317 02318 02319 02320 02321 02322 02323 02324 02325 02326 02327 02328 02329 02330 02331 02332 02333 02334 02335 02336 02337 02338 02339 02340 02341 02342 02343 02344 02345 02346 02347 02348 02349 02350 02351 02352 02353 02354 02355 02356 02357 02358 02359 02360 02361 02362 02363 02364 02365 02366 02367 02368 02369 02370 02371 02372 02373 02374 02375 02376 02377 02378 02379 02380 02381 02382 02383 02384 02385 02386 02387 02388 02389 02390 02391 02392 02393 02394 02395 02396 02397 02398 02399 02400 02401 02402 02403 02404 02405 02406 02407 02408 02409 02410 02411 02412 02413 02414 02415 02416 02417 02418 02419 02420 02421 02422 02423 02424 02425 02426 02427 02428 02429 02430 02431 02432 02433 02434 02435 02436 02437 02438 02439 02440 02441 02442 02443 02444 02445 02446 02447 02448 02449 02450 02451 02452 02453 02454 02455 02456 02457 02458 02459 02460 02461 02462 02463 02464 02465 02466 02467 02468 02469 02470 02471 02472 02473 02474 02475 02476 02477 02478 02479 02480 02481 02482 02483 02484 02485 02486 02487 02488 02489 02490 02491 02492 02493 02494 02495 02496 02497 02498 02499 02500 02501 02502 02503 02504 02505 02506 02507 02508 02509 02510 02511 02512 02513 02514 02515 02516 02517 02518 02519 02520 02521 02522 02523 02524 02525 02526 02527 02528 02529 02530 02531 02532 02533 02534 02535 02536 02537 02538 02539 02540 02541 02542 02543 02544 02545 02546 02547 02548 02549 02550 02551 02552 02553 02554 02555 02556 02557 02558 02559 02560 02561 02562 02563 02564 02565 02566 02567 02568 02569 02570 02571 02572 02573 02574 02575 02576 02577 02578 02579 02580 02581 02582 02583 02584 02585 02586 02587 02588 02589 02590 02591 02592 02593 02594 02595 02596 02597 02598 02599 02600 02601 02602 02603 02604 02605 02606 02607 02608 02609 02610 02611 02612 02613 02614 02615 02616 02617 02618 02619 02620 02621 02622 02623 02624 02625 02626 02627 02628 02629 02630 02631 02632 02633 02634 02635 02636 02637 02638 02639 02640 02641 02642 02643 02644 02645 02646 02647 02648 02649 02650 02651 02652 02653 02654 02655 02656 02657 02658 02659 02660 02661 02662 02663 02664 02665 02666 02667 02668 02669 02670 02671 02672 02673 02674 02675 02676 02677 02678 02679 02680 02681 02682 02683 02684 02685 02686 02687 02688 02689 02690 02691 02692 02693 02694 02695 02696 02697 02698 02699 02700 02701 02702 02703 02704 02705 02706 02707 02708 02709 02710 02711 02712 02713 02714 02715 02716 02717 02718 02719 02720 02721 02722 02723 02724 02725 02726 02727 02728 02729 02730 02731 02732 02733 02734 02735 02736 02737 02738 02739 02740 02741 02742 02743 02744 02745 02746 02747 02748 02749 02750 02751 02752 02753 02754 02755 02756 02757 02758 02759 02760 02761 02762 02763 02764 02765 02766 02767 02768 02769 02770 02771 02772 02773 02774 02775 02776 02777 02778 02779 02780 02781 02782 02783 02784 02785 02786 02787 02788 02789 02790 02791 02792 02793 02794 02795 02796 02797 02798 02799 02800 02801 02802 02803 02804 02805 02806 02807 02808 02809 02810 02811 02812 02813 02814 02815 02816 02817 02818 02819 02820 02821 02822 02823 02824 02825 02826 02827 02828 02829 02830 02831 02832 02833 02834 02835 02836 02837 02838 02839 02840 02841 02842 02843 02844 02845 02846 02847 02848 02849 02850 02851 02852 02853 02854 02855 02856 02857 02858 02859 02860 02861 02862 02863 02864 02865 02866 02867 02868 02869 02870 02871 02872 02873 02874 02875 02876 02877 02878 02879 02880 02881 02882 02883 02884 02885 02886 02887 02888 02889 02890 02891 02892 02893 02894 02895 02896 02897 02898 02899 02900 02901 02902 02903 02904 02905 02906 02907 02908 02909 02910 02911 02912 02913 02914 02915 02916 02917 02918 02919 02920 02921 02922 02923 02924 02925 02926 02927 02928 02929 02930 02931 02932 02933 02934 02935 02936 02937 02938 02939 02940 02941 02942 02943 02944 02945 02946 02947 02948 02949 02950 02951 02952 02953 02954 02955 02956 02957 02958 02959 02960 02961 02962 02963 02964 02965 02966 02967 02968 02969 02970 02971 02972 02973 02974 02975 02976 02977 02978 02979 02980 02981 02982 02983 02984 02985 02986 02987 02988 02989 02990 02991 02992 02993 02994 02995 02996 02997 02998 02999 03000 03001 03002 03003 03004 03005 03006 03007 03008 03009 03010 03011 03012 03013 03014 03015 03016 03017 03018 03019 03020 03021 03022 03023 03024 03025 03026 03027 03028 03029 03030 03031 03032 03033 03034 03035 03036 03037 03038 03039 03040 03041 03042 03043 03044 03045 03046 03047 03048 03049 03050 03051 03052 03053 03054 03055 03056 03057 03058 03059 03060 03061 03062 03063 03064 03065 03066 03067 03068 03069 03070 03071 03072 03073 03074 03075 03076 03077 03078 03079 03080 03081 03082 03083 03084 03085 03086 03087 03088 03089 03090 03091 03092 03093 03094 03095 03096 03097 03098 03099 03100 03101 03102 03103 03104 03105 03106 03107 03108 03109 03110 03111 03112 03113 03114 03115 03116 03117 03118 03119 03120 03121 03122 03123 03124 03125 03126 03127 03128 03129 03130 03131 03132 03133 03134 03135 03136 03137 03138 03139 03140 03141 03142 03143 03144 03145 03146 03147 03148 03149 03150 03151 03152 03153 03154 03155 03156 03157 03158 03159 03160 03161 03162 03163 03164 03165 03166 03167 03168 03169 03170 03171 03172 03173 03174 03175 03176 03177 03178 03179 03180 03181 03182 03183 03184 03185 03186 03187 03188 03189 03190 03191 03192 03193 03194 03195 03196 03197 03198 03199 03200 03201 03202 03203 03204 03205 03206 03207 03208 03209 03210 03211 03212 03213 03214 03215 03216 03217 03218 03219 03220 03221 03222 03223 03224 03225 03226 03227 03228 03229 03230 03231 03232 03233 03234 03235 03236 03237 03238 03239 03240 03241 03242 03243 03244 03245 03246 03247 03248 03249 03250 03251 03252 03253 03254 03255 03256 03257 03258 03259 03260 03261 03262 03263 03264 03265 03266 03267 03268 03269 03270 03271 03272 03273 03274 03275 03276 03277 03278 03279 03280 03281 03282 03283 03284 03285 03286 03287 03288 03289 03290 03291 03292 03293 03294 03295 03296 03297 03298 03299 03300 03301 03302 03303 03304 03305 03306 03307 03308 03309 03310 03311 03312 03313 03314 03315 03316 03317 03318 03319 03320 03321 03322 03323 03324 03325 03326 03327 03328 03329 03330 03331 03332 03333 03334 03335 03336 03337 03338 03339 03340 03341 03342 03343 03344 03345 03346 03347 03348 03349 03350 03351 03352 03353 03354 03355 03356 03357 03358 03359 03360 03361 03362 03363 03364 03365 03366 03367 03368 03369 03370 03371 03372 03373 03374 03375 03376 03377 03378 03379 03380 03381 03382 03383 03384 03385 03386 03387 03388 03389 03390 03391 03392 03393 03394 03395 03396 03397 03398 03399 03400 03401 03402 03403 03404 03405 03406 03407 03408 03409 03410 03411 03412 03413 03414 03415 03416 03417 03418 03419 03420 03421 03422 03423 03424 03425 03426 03427 03428 03429 03430 03431 03432 03433 03434 03435 03436 03437 03438 03439 03440 03441 03442 03443 03444 03445 03446 03447 03448 03449 03450 03451 03452 03453 03454 03455 03456 03457 03458 03459 03460 03461 03462 03463 03464 03465 03466 03467 03468 03469 03470 03471 03472 03473 03474 03475 03476 03477 03478 03479 03480 03481 03482 03483 03484 03485 03486 03487 03488 03489 03490 03491 03492 03493 03494 03495 03496 03497 03498 03499 03500 03501 03502 03503 03504 03505 03506 03507 03508 03509 03510 03511 03512 03513 03514 03515 03516 03517 03518 03519 03520 03521 03522 03523 03524 03525 03526 03527 03528 03529 03530 03531 03532 03533 03534 03535 03536 03537 03538 03539 03540 03541 03542 03543 03544 03545 03546 03547 03548 03549 03550 03551 03552 03553 03554 03555 03556 03557 03558 03559 03560 03561 03562 03563 03564 03565 03566 03567 03568 03569 03570 03571 03572 03573 03574 03575 03576 03577 03578 03579 03580 03581 03582 03583 03584 03585 03586 03587 03588 03589 03590 03591 03592 03593 03594 03595 03596 03597 03598 03599 03600 03601 03602 03603 03604 03605 03606 03607 03608 03609 03610 03611 03612 03613 03614 03615 03616 03617 03618 03619 03620 03621 03622 03623 03624 03625 03626 03627 03628 03629 03630 03631 03632 03633 03634 03635 03636 03637 03638 03639 03640 03641 03642 03643 03644 03645 03646 03647 03648 03649 03650 03651 03652 03653 03654 03655 03656 03657 03658 03659 03660 03661 03662 03663 03664 03665 03666 03667 03668 03669 03670 03671 03672 03673 03674 03675 03676 03677 03678 03679 03680 03681 03682 03683 03684 03685 03686 03687 03688 03689 03690 03691 03692 03693 03694 03695 03696 03697 03698 03699 03700 03701 03702 03703 03704 03705 03706 03707 03708 03709 03710 03711 03712 03713 03714 03715 03716 03717 03718 03719 03720 03721 03722 03723 03724 03725 03726 03727 03728 03729 03730 03731 03732 03733 03734 03735 03736 03737 03738 03739 03740 03741 03742 03743 03744 03745 03746 03747 03748 03749 03750 03751 03752 03753 03754 03755 03756 03757 03758 03759 03760 03761 03762 03763 03764 03765 03766 03767 03768 03769 03770 03771 03772 03773 03774 03775 03776 03777 03778 03779 03780 03781 03782 03783 03784 03785 03786 03787 03788 03789 03790 03791 03792 03793 03794 03795 03796 03797 03798 03799 03800 03801 03802 03803 03804 03805 03806 03807 03808 03809 03810 03811 03812 03813 03814 03815 03816 03817 03818 03819 03820 03821 03822 03823 03824 03825 03826 03827 03828 03829 03830 03831 03832 03833 03834 03835 03836 03837 03838 03839 03840 03841 03842 03843 03844 03845 03846 03847 03848 03849 03850 03851 03852 03853 03854 03855 03856 03857 03858 03859 03860 03861 03862 03863 03864 03865 03866 03867 03868 03869 03870 03871 03872 03873 03874 03875 03876 03877 03878 03879 03880 03881 03882 03883 03884 03885 03886 03887 03888 03889 03890 03891 03892 03893 03894 03895 03896 03897 03898 03899 03900 03901 03902 03903 03904 03905 03906 03907 03908 03909 03910 03911 03912 03913 03914 03915 03916 03917 03918 03919 03920 03921 03922 03923 03924 03925 03926 03927 03928 03929 03930 03931 03932 03933 03934 03935 03936 03937 03938 03939 03940 03941 03942 03943 03944 03945 03946 03947 03948 03949 03950 03951 03952 03953 03954 03955 03956 03957 03958 03959 03960 03961 03962 03963 03964 03965 03966 03967 03968 03969 03970 03971 03972 03973 03974 03975 03976 03977 03978 03979 03980 03981 03982 03983 03984 03985 03986 03987 03988 03989 03990 03991 03992 03993 03994 03995 03996 03997 03998 03999 04000 04001 04002 04003 04004 04005 04006 04007 04008 04009 04010 04011 04012 04013 04014 04015 04016 04017 04018 04019 04020 04021 04022 04023 04024 04025 04026 04027 04028 04029 04030 04031 04032 04033 04034 04035 04036 04037 04038 04039 04040 04041 04042 04043 04044 04045 04046 04047 04048 04049 04050 04051 04052 04053 04054 04055 04056 04057 04058 04059 04060 04061 04062 04063 04064 04065 04066 04067 04068 04069 04070 04071 04072 04073 04074 04075 04076 04077 04078 04079 04080 04081 04082 04083 04084 04085 04086 04087 04088 04089 04090 04091 04092 04093 04094 04095 04096 04097 04098 04099 04100 04101 04102 04103 04104 04105 04106 04107 04108 04109 04110 04111 04112 04113 04114 04115 04116 04117 04118 04119 04120 04121 04122 04123 04124 04125 04126 04127 04128 04129 04130 04131 04132 04133 04134 04135 04136 04137 04138 04139 04140 04141 04142 04143 04144 04145 04146 04147 04148 04149 04150 04151 04152 04153 04154 04155 04156 04157 04158 04159 04160 04161 04162 04163 04164 04165 04166 04167 04168 04169 04170 04171 04172 04173 04174 04175 04176 04177 04178 04179 04180 04181 04182 04183 04184 04185 04186 04187 04188 04189 04190 04191 04192 04193 04194 04195 04196 04197 04198 04199 04200 04201 04202 04203 04204 04205 04206 04207 04208 04209 04210 04211 04212 04213 04214 04215 04216 04217 04218 04219 04220 04221 04222 04223 04224 04225 04226 04227 04228 04229 04230 04231 04232 04233 04234 04235 04236 04237 04238 04239 04240 04241 04242 04243 04244 04245 04246 04247 04248 04249 04250 04251 04252 04253 04254 04255 04256 04257 04258 04259 04260 04261 04262 04263 04264 04265 04266 04267 04268 04269 04270 04271 04272 04273 04274 04275 04276 04277 04278 04279 04280 04281 04282 04283 04284 04285 04286 04287 04288 04289 04290 04291 04292 04293 04294 04295 04296 04297 04298 04299 04300 04301 04302 04303 04304 04305 04306 04307 04308 04309 04310 04311 04312 04313 04314 04315 04316 04317 04318 04319 04320 04321 04322 04323 04324 04325 04326 04327 04328 04329 04330 04331 04332 04333 04334 04335 04336 04337 04338 04339 04340 04341 04342 04343 04344 04345 04346 04347 04348 04349 04350 04351 04352 04353 04354 04355 04356 04357 04358 04359 04360 04361 04362 04363 04364 04365 04366 04367 04368 04369 04370 04371 04372 04373 04374 04375 04376 04377 04378 04379 04380 04381 04382 04383 04384 04385 04386 04387 04388 04389 04390 04391 04392 04393 04394 04395 04396 04397 04398 04399 04400 04401 04402 04403 04404 04405 04406 04407 04408 04409 04410 04411 04412 04413 04414 04415 04416 04417 04418 04419 04420 04421 04422 04423 04424 04425 04426 04427 04428 04429 04430 04431 04432 04433 04434 04435 04436 04437 04438 04439 04440 04441 04442 04443 04444 04445 04446 04447 04448 04449 04450 04451 04452 04453 04454 04455 04456 04457 04458 04459 04460 04461 04462 04463 04464 04465 04466 04467 04468 04469 04470 04471 04472 04473 04474 04475 04476 04477 04478 04479 04480 04481 04482 04483 04484 04485 04486 04487 04488 04489 04490 04491 04492 04493 04494 04495 04496 04497 04498 04499 04500 04501 04502 04503 04504 04505 04506 04507 04508 04509 04510 04511 04512 04513 04514 04515 04516 04517 04518 04519 04520 04521 04522 04523 04524 04525 04526 04527 04528 04529 04530 04531 04532 04533 04534 04535 04536 04537 04538 04539 04540 04541 04542 04543 04544 04545 04546 04547 04548 04549 04550 04551 04552 04553 04554 04555 04556 04557 04558 04559 04560 04561 04562 04563 04564 04565 04566 04567 04568 04569 04570 04571 04572 04573 04574 04575 04576 04577 04578 04579 04580 04581 04582 04583 04584 04585 04586 04587 04588 04589 04590 04591 04592 04593 04594 04595 04596 04597 04598 04599 04600 04601 04602 04603 04604 04605 04606 04607 04608 04609 04610 04611 04612 04613 04614 04615 04616 04617 04618 04619 04620 04621 04622 04623 04624 04625 04626 04627 04628 04629 04630 04631 04632 04633 04634 04635 04636 04637 04638 04639 04640 04641 04642 04643 04644 04645 04646 04647 04648 04649 04650 04651 04652 04653 04654 04655 04656 04657 04658 04659 04660 04661 04662 04663 04664 04665 04666 04667 04668 04669 04670 04671 04672 04673 04674 04675 04676 04677 04678 04679 04680 04681 04682 04683 04684 04685 04686 04687 04688 04689 04690 04691 04692 04693 04694 04695 04696 04697 04698 04699 04700 04701 04702 04703 04704 04705 04706 04707 04708 04709 04710 04711 04712 04713 04714 04715 04716 04717 04718 04719 04720 04721 04722 04723 04724 04725 04726 04727 04728 04729 04730 04731 04732 04733 04734 04735 04736 04737 04738 04739 04740 04741 04742 04743 04744 04745 04746 04747 04748 04749 04750 04751 04752 04753 04754 04755 04756 04757 04758 04759 04760 04761 04762 04763 04764 04765 04766 04767 04768 04769 04770 04771 04772 04773 04774 04775 04776 04777 04778 04779 04780 04781 04782 04783 04784 04785 04786 04787 04788 04789 04790 04791 04792 04793 04794 04795 04796 04797 04798 04799 04800 04801 04802 04803 04804 04805 04806 04807 04808 04809 04810 04811 04812 04813 04814 04815 04816 04817 04818 04819 04820 04821 04822 04823 04824 04825 04826 04827 04828 04829 04830 04831 04832 04833 04834 04835 04836 04837 04838 04839 04840 04841 04842 04843 04844 04845 04846 04847 04848 04849 04850 04851 04852 04853 04854 04855 04856 04857 04858 04859 04860 04861 04862 04863 04864 04865 04866 04867 04868 04869 04870 04871 04872 04873 04874 04875 04876 04877 04878 04879 04880 04881 04882 04883 04884 04885 04886 04887 04888 04889 04890 04891 04892 04893 04894 04895 04896 04897 04898 04899 04900 04901 04902 04903 04904 04905 04906 04907 04908 04909 04910 04911 04912 04913 04914 04915 04916 04917 04918 04919 04920 04921 04922 04923 04924 04925 04926 04927 04928 04929 04930 04931 04932 04933 04934 04935 04936 04937 04938 04939 04940 04941 04942 04943 04944 04945 04946 04947 04948 04949 04950 04951 04952 04953 04954 04955 04956 04957 04958 04959 04960 04961 04962 04963 04964 04965 04966 04967 04968 04969 04970 04971 04972 04973 04974 04975 04976 04977 04978 04979 04980 04981 04982 04983 04984 04985 04986 04987 04988 04989 04990 04991 04992 04993 04994 04995 04996 04997 04998 04999 05000 05001 05002 05003 05004 05005 05006 05007 05008 05009 05010 05011 05012 05013 05014 05015 05016 05017 05018 05019 05020 05021 05022 05023 05024 05025 05026 05027 05028 05029 05030 05031 05032 05033 05034 05035 05036 05037 05038 05039 05040 05041 05042 05043 05044 05045 05046 05047 05048 05049 05050 05051 05052 05053 05054 05055 05056 05057 05058 05059 05060 05061 05062 05063 05064 05065 05066 05067 05068 05069 05070 05071 05072 05073 05074 05075 05076 05077 05078 05079 05080 05081 05082 05083 05084 05085 05086 05087 05088 05089 05090 05091 05092 05093 05094 05095 05096 05097 05098 05099 05100 05101 05102 05103 05104 05105 05106 05107 05108 05109 05110 05111 05112 05113 05114 05115 05116 05117 05118 05119 05120 05121 05122 05123 05124 05125 05126 05127 05128 05129 05130 05131 05132 05133 05134 05135 05136 05137 05138 05139 05140 05141 05142 05143 05144 05145 05146 05147 05148 05149 05150 05151 05152 05153 05154 05155 05156 05157 05158 05159 05160 05161 05162 05163 05164 05165 05166 05167 05168 05169 05170 05171 05172 05173 05174 05175 05176 05177 05178 05179 05180 05181 05182 05183 05184 05185 05186 05187 05188 05189 05190 05191 05192 05193 05194 05195 05196 05197 05198 05199 05200 05201 05202 05203 05204 05205 05206 05207 05208 05209 05210 05211 05212 05213 05214 05215 05216 05217 05218 05219 05220 05221 05222 05223 05224 05225 05226 05227 05228 05229 05230 05231 05232 05233 05234 05235 05236 05237 05238 05239 05240 05241 05242 05243 05244 05245 05246 05247 05248 05249 05250 05251 05252 05253 05254 05255 05256 05257 05258 05259 05260 05261 05262 05263 05264 05265 05266 05267 05268 05269 05270 05271 05272 05273 05274 05275 05276 05277 05278 05279 05280 05281 05282 05283 05284 05285 05286 05287 05288 05289 05290 05291 05292 05293 05294 05295 05296 05297 05298 05299 05300 05301 05302 05303 05304 05305 05306 05307 05308 05309 05310 05311 05312 05313 05314 05315 05316 05317 05318 05319 05320 05321 05322 05323 05324 05325 05326 05327 05328 05329 05330 05331 05332 05333 05334 05335 05336 05337 05338 05339 05340 05341 05342 05343 05344 05345 05346 05347 05348 05349 05350 05351 05352 05353 05354 05355 05356 05357 05358 05359 05360 05361 05362 05363 05364 05365 05366 05367 05368 05369 05370 05371 05372 05373 05374 05375 05376 05377 05378 05379 05380 05381 05382 05383 05384 05385 05386 05387 05388 05389 05390 05391 05392 05393 05394 05395 05396 05397 05398 05399 05400 05401 05402 05403 05404 05405 05406 05407 05408 05409 05410 05411 05412 05413 05414 05415 05416 05417 05418 05419 05420 05421 05422 05423 05424 05425 05426 05427 05428 05429 05430 05431 05432 05433 05434 05435 05436 05437 05438 05439 05440 05441 05442 05443 05444 05445 05446 05447 05448 05449 05450 05451 05452 05453 05454 05455 05456 05457 05458 05459 05460 05461 05462 05463 05464 05465 05466 05467 05468 05469 05470 05471 05472 05473 05474 05475 05476 05477 05478 05479 05480 05481 05482 05483 05484 05485 05486 05487 05488 05489 05490 05491 05492 05493 05494 05495 05496 05497 05498 05499 05500 05501 05502 05503 05504 05505 05506 05507 05508 05509 05510 05511 05512 05513 05514 05515 05516 05517 05518 05519 05520 05521 05522 05523 05524 05525 05526 05527 05528 05529 05530 05531 05532 05533 05534 05535 05536 05537 05538 05539 05540 05541 05542 05543 05544 05545 05546 05547 05548 05549 05550 05551 05552 05553 05554 05555 05556 05557 05558 05559 05560 05561 05562 05563 05564 05565 05566 05567 05568 05569 05570 05571 05572 05573 05574 05575 05576 05577 05578 05579 05580 05581 05582 05583 05584 05585 05586 05587 05588 05589 05590 05591 05592 05593 05594 05595 05596 05597 05598 05599 05600 05601 05602 05603 05604 05605 05606 05607 05608 05609 05610 05611 05612 05613 05614 05615 05616 05617 05618 05619 05620 05621 05622 05623 05624 05625 05626 05627 05628 05629 05630 05631 05632 05633 05634 05635 05636 05637 05638 05639 05640 05641 05642 05643 05644 05645 05646 05647 05648 05649 05650 05651 05652 05653 05654 05655 05656 05657 05658 05659 05660 05661 05662 05663 05664 05665 05666 05667 05668 05669 05670 05671 05672 05673 05674 05675 05676 05677 05678 05679 05680 05681 05682 05683 05684 05685 05686 05687 05688 05689 05690 05691 05692 05693 05694 05695 05696 05697 05698 05699 05700 05701 05702 05703 05704 05705 05706 05707 05708 05709 05710 05711 05712 05713 05714 05715 05716 05717 05718 05719 05720 05721 05722 05723 05724 05725 05726 05727 05728 05729 05730 05731 05732 05733 05734 05735 05736 05737 05738 05739 05740 05741 05742 05743 05744 05745 05746 05747 05748 05749 05750 05751 05752 05753 05754 05755 05756 05757 05758 05759 05760 05761 05762 05763 05764 05765 05766 05767 05768 05769 05770 05771 05772 05773 05774 05775 05776 05777 05778 05779 05780 05781 05782 05783 05784 05785 05786 05787 05788 05789 05790 05791 05792 05793 05794 05795 05796 05797 05798 05799 05800 05801 05802 05803 05804 05805 05806 05807 05808 05809 05810 05811 05812 05813 05814 05815 05816 05817 05818 05819 05820 05821 05822 05823 05824 05825 05826 05827 05828 05829 05830 05831 05832 05833 05834 05835 05836 05837 05838 05839 05840 05841 05842 05843 05844 05845 05846 05847 05848 05849 05850 05851 05852 05853 05854 05855 05856 05857 05858 05859 05860 05861 05862 05863 05864 05865 05866 05867 05868 05869 05870 05871 05872 05873 05874 05875 05876 05877 05878 05879 05880 05881 05882 05883 05884 05885 05886 05887 05888 05889 05890 05891 05892 05893 05894 05895 05896 05897 05898 05899 05900 05901 05902 05903 05904 05905 05906 05907 05908 05909 05910 05911 05912 05913 05914 05915 05916 05917 05918 05919 05920 05921 05922 05923 05924 05925 05926 05927 05928 05929 05930 05931 05932 05933 05934 05935 05936 05937 05938 05939 05940 05941 05942 05943 05944 05945 05946 05947 05948 05949 05950 05951 05952 05953 05954 05955 05956 05957 05958 05959 05960 05961 05962 05963 05964 05965 05966 05967 05968 05969 05970 05971 05972 05973 05974 05975 05976 05977 05978 05979 05980 05981 05982 05983 05984 05985 05986 05987 05988 05989 05990 05991 05992 05993 05994 05995 05996 05997 05998 05999 06000 06001 06002 06003 06004 06005 06006 06007 06008 06009 06010 06011 06012 06013 06014 06015 06016 06017 06018 06019 06020 06021 06022 06023 06024 06025 06026 06027 06028 06029 06030 06031 06032 06033 06034 06035 06036 06037 06038 06039 06040 06041 06042 06043 06044 06045 06046 06047 06048 06049 06050 06051 06052 06053 06054 06055 06056 06057 06058 06059 06060 06061 06062 06063 06064 06065 06066 06067 06068 06069 06070 06071 06072 06073 06074 06075 06076 06077 06078 06079 06080 06081 06082 06083 06084 06085 06086 06087 06088 06089 06090 06091 06092 06093 06094 06095 06096 06097 06098 06099 06100 06101 06102 06103 06104 06105 06106 06107 06108 06109 06110 06111 06112 06113 06114 06115 06116 06117 06118 06119 06120 06121 06122 06123 06124 06125 06126 06127 06128 06129 06130 06131 06132 06133 06134 06135 06136 06137 06138 06139 06140 06141 06142 06143 06144 06145 06146 06147 06148 06149 06150 06151 06152 06153 06154 06155 06156 06157 06158 06159 06160 06161 06162 06163 06164 06165 06166 06167 06168 06169 06170 06171 06172 06173 06174 06175 06176 06177 06178 06179 06180 06181 06182 06183 06184 06185 06186 06187 06188 06189 06190 06191 06192 06193 06194 06195 06196 06197 06198 06199 06200 06201 06202 06203 06204 06205 06206 06207 06208 06209 06210 06211 06212 06213 06214 06215 06216 06217 06218 06219 06220 06221 06222 06223 06224 06225 06226 06227 06228 06229 06230 06231 06232 06233 06234 06235 06236 06237 06238 06239 06240 06241 06242 06243 06244 06245 06246 06247 06248 06249 06250 06251 06252 06253 06254 06255 06256 06257 06258 06259 06260 06261 06262 06263 06264 06265 06266 06267 06268 06269 06270 06271 06272 06273 06274 06275 06276 06277 06278 06279 06280 06281 06282 06283 06284 06285 06286 06287 06288 06289 06290 06291 06292 06293 06294 06295 06296 06297 06298 06299 06300 06301 06302 06303 06304 06305 06306 06307 06308 06309 06310 06311 06312 06313 06314 06315 06316 06317 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.qix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Point]/dp_tl.qix -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.sbn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Point]/dp_tl.sbn -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.sbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Point]/dp_tl.sbx -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Point]/dp_tl.shp -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.shp.xml: -------------------------------------------------------------------------------- 1 | 2 | 20180919095845001.0TRUECalculateField dp_tl z [FID] VB #CalculateField dp_tl z [FID] VB #CalculateField dp_tl z "[z] +1" VB # 3 | -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Point]/dp_tl.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Point]/dp_tl.shx -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Polygon]/china_building_part.cpg: -------------------------------------------------------------------------------- 1 | UTF-8 -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Polygon]/china_building_part.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Polygon]/china_building_part.dbf -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Polygon]/china_building_part.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Polygon]/china_building_part.qix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Polygon]/china_building_part.qix -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Polygon]/china_building_part.qpj: -------------------------------------------------------------------------------- 1 | GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] 2 | -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Polygon]/china_building_part.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Polygon]/china_building_part.shp -------------------------------------------------------------------------------- /src/main/resources/static/shpTest[Polygon]/china_building_part.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kobeyk/SpringBoot-ShpTools/317eddae100744bde7029b6a5983831f5c33852e/src/main/resources/static/shpTest[Polygon]/china_building_part.shx -------------------------------------------------------------------------------- /src/test/java/com/appleyk/SpringbootshaperApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.appleyk; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootshaperApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | --------------------------------------------------------------------------------