case 11: case 21: handler = new PointHandler(this, gf); break; case 3:
public Object read(ByteBuffer buffer, ShapeType type, boolean flatGeometry) { if (type == ShapeType.NULL) { return createNull(); } int dimension = shapeType == ShapeType.POINTZ && !flatGeometry ? 3 : 2; CoordinateSequence cs = JTS.createCS(geometryFactory.getCoordinateSequenceFactory(), 1, dimension); cs.setOrdinate(0, 0, buffer.getDouble()); cs.setOrdinate(0, 1, buffer.getDouble()); if (shapeType == ShapeType.POINTM) { buffer.getDouble(); } if (dimension > 2) { cs.setOrdinate(0, 2, buffer.getDouble()); } return geometryFactory.createPoint(cs); }
public Object read(ByteBuffer buffer, ShapeType type) { if (type == ShapeType.NULL) { return createNull(); } double x = buffer.getDouble(); double y = buffer.getDouble(); double z = Double.NaN; if (shapeType == ShapeType.POINTM) { buffer.getDouble(); } if (shapeType == ShapeType.POINTZ) { z = buffer.getDouble(); } return geometryFactory.createPoint(new Coordinate(x, y, z)); }
/** Each ShapeType corresponds to a handler. In the future this should probably go * else where to allow different handlers, or something... * @throws ShapefileException If the ShapeType is bogus. * @return The correct handler for this ShapeType. Returns a new one. */ public ShapeHandler getShapeHandler() throws ShapefileException { ShapeHandler handler; switch (id) { case 1: case 11: case 21: handler = new PointHandler(this); break; case 3: case 13: case 23: handler = new MultiLineHandler(this); break; case 5: case 15: case 25: handler = new PolygonHandler(this); break; case 8: case 18: case 28: handler = new MultiPointHandler(this); break; default: handler = null; } return handler; }
public Object read(ByteBuffer buffer, ShapeType type, boolean flatGeometry) { if (type == ShapeType.NULL) { return createNull(); } int dimension = shapeType == ShapeType.POINTZ && !flatGeometry ? 3 : 2; CoordinateSequence cs = geometryFactory.getCoordinateSequenceFactory().create(1, dimension); cs.setOrdinate(0, 0, buffer.getDouble()); cs.setOrdinate(0, 1, buffer.getDouble()); if (shapeType == ShapeType.POINTM) { buffer.getDouble(); } if (dimension > 2) { cs.setOrdinate(0, 2, buffer.getDouble()); } return geometryFactory.createPoint(cs); }
case 11: case 21: handler = new PointHandler(this, gf); break; case 3:
public Object read(ByteBuffer buffer, ShapeType type, boolean flatGeometry) { if (type == ShapeType.NULL) { return createNull(); } int dimension = shapeType == ShapeType.POINTZ && !flatGeometry ? 3 : 2; CoordinateSequence cs = geometryFactory.getCoordinateSequenceFactory().create(1, dimension); cs.setOrdinate(0, 0, buffer.getDouble()); cs.setOrdinate(0, 1, buffer.getDouble()); if (shapeType == ShapeType.POINTM) { buffer.getDouble(); } if (dimension > 2) { cs.setOrdinate(0, 2, buffer.getDouble()); } return geometryFactory.createPoint(cs); }
case 11: case 21: handler = new PointHandler(this, gf); break; case 3: