  | 1 | 1 | | |
  | 2 | | - | |
| | | 2 | + | |
| 3 | 3 | | |
| | 4 | 4 | | |
| | 5 | 5 | | |
| |
|
|
 |
… |
| 51 | 51 | | |
| | 52 | 52 | | SqlServerGeometry sqlServerGeom = new SqlServerGeometry(); |
| | 53 | 53 | | sqlServerGeom.setSrid(geom.getSRID()); |
  | 54 | | - | sqlServerGeom.setIsSinglePoint(); |
| 55 | 54 | | sqlServerGeom.setIsValid(); |
  | | 55 | + | |
| | | 56 | + | if (geom.isEmpty()) { |
| | | 57 | + | sqlServerGeom.setNumberOfPoints(0); |
| | | 58 | + | sqlServerGeom.setNumberOfFigures(0); |
| | | 59 | + | sqlServerGeom.setNumberOfShapes(1); |
| | | 60 | + | sqlServerGeom.setShape(0, new Shape(-1, -1, OpenGisType.POINT)); |
| | | 61 | + | return sqlServerGeom; |
| | | 62 | + | } |
| | | 63 | + | |
| | | 64 | + | sqlServerGeom.setIsSinglePoint(); |
| 56 | 65 | | sqlServerGeom.setNumberOfPoints(1); |
| | 57 | 66 | | Coordinate coordinate = geom.getCoordinate(); |
| | 58 | 67 | | if (is3DPoint(coordinate)) { |
| |
|
|
 |
… |
| 70 | 79 | | @Override |
| | 71 | 80 | | protected void encode(Geometry geom, int parentIdx, List<Coordinate> coordinates, List<Figure> figures, List<Shape> shapes) { |
| | 72 | 81 | | if (!(geom instanceof Point)) throw new IllegalArgumentException("Require Point geometry"); |
  | | 82 | + | if (geom.isEmpty()) { |
| | | 83 | + | shapes.add(new Shape(parentIdx, -1, OpenGisType.POINT)); |
| | | 84 | + | } |
  | 73 | 85 | | int pntOffset = coordinates.size(); |
| | 74 | 86 | | int figureOffset = figures.size(); |
| | 75 | 87 | | coordinates.add(geom.getCoordinate()); |