public PointHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.POINT) && (type != ShapeType.POINTM) && (type != ShapeType.POINTZ)) { // 2d, 2d+m, 3d+m throw new ShapefileException( "PointHandler constructor: expected a type of 1, 11 or 21"); } shapeType = type; this.geometryFactory = gf; }
public PolygonHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.POLYGON) && (type != ShapeType.POLYGONM) && (type != ShapeType.POLYGONZ)) { throw new ShapefileException( "PolygonHandler constructor - expected type to be 5, 15, or 25."); } shapeType = type; this.geometryFactory = gf; }
public MultiPointHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.MULTIPOINT) && (type != ShapeType.MULTIPOINTM) && (type != ShapeType.MULTIPOINTZ)) { throw new ShapefileException( "Multipointhandler constructor - expected type to be 8, 18, or 28"); } shapeType = type; this.geometryFactory = gf; }
/** * Create a MultiLineHandler for one of: <br> * ShapeType.ARC,ShapeType.ARCM,ShapeType.ARCZ * * @param type The ShapeType to use. * @throws ShapefileException If the ShapeType is not correct (see constructor). */ public MultiLineHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.ARC) && (type != ShapeType.ARCM) && (type != ShapeType.ARCZ)) { throw new ShapefileException( "MultiLineHandler constructor - expected type to be 3,13 or 23"); } shapeType = type; this.geometryFactory = gf; }
break; default: throw new ShapefileException( "Too many dimensions for shapefile : " + shapeFileDimentions); break; default: throw new ShapefileException( "Too many dimensions for shapefile : " + shapeFileDimentions); break; default: throw new ShapefileException( "Too many dimensions for shapefile : " + shapeFileDimentions); break; default: throw new ShapefileException( "Too many dimensions for shapefile : " + shapeFileDimentions); throw new ShapefileException( "Cannot handle geometry type : " + (geom == null ? "null" : geom.getClass().getName()));
/** * Determine the default ShapeType for a featureClass. Shapetype will be the 2D shapetype. * * @param featureClass The Geometry to examine. * @return The best ShapeType. * @throws ShapefileException If theres a problem, like a bogus feature class. */ public static final ShapeType getShapeType(Class featureClass) throws ShapefileException { ShapeType type = null; if (Point.class.equals(featureClass)) { type = ShapeType.POINT; } else if (MultiPoint.class.equals(featureClass)) { type = ShapeType.MULTIPOINT; } else if (Polygon.class.equals(featureClass) || MultiPolygon.class.equals(featureClass)) { type = ShapeType.POLYGON; } else if (LineString.class.equals(featureClass) || MultiLineString.class.equals(featureClass)) { type = ShapeType.ARC; } if (type == null) { throw new ShapefileException( "Cannot handle geometry class : " + (featureClass == null ? "null" : featureClass.getName())); } return type; }
throw new ShapefileException( "Cannot handle geometry class : " + (featureClass == null ? "null" : featureClass.getName()));
public PointHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.POINT) && (type != ShapeType.POINTM) && (type != ShapeType.POINTZ)) { // 2d, 2d+m, 3d+m throw new ShapefileException( "PointHandler constructor: expected a type of 1, 11 or 21"); } shapeType = type; this.geometryFactory = gf; }
public MultiPointHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.MULTIPOINT) && (type != ShapeType.MULTIPOINTM) && (type != ShapeType.MULTIPOINTZ)) { throw new ShapefileException( "Multipointhandler constructor - expected type to be 8, 18, or 28"); } shapeType = type; this.geometryFactory = gf; }
public MultiPointHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.MULTIPOINT) && (type != ShapeType.MULTIPOINTM) && (type != ShapeType.MULTIPOINTZ)) { throw new ShapefileException( "Multipointhandler constructor - expected type to be 8, 18, or 28"); } shapeType = type; this.geometryFactory = gf; }
public PolygonHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.POLYGON) && (type != ShapeType.POLYGONM) && (type != ShapeType.POLYGONZ)) { throw new ShapefileException( "PolygonHandler constructor - expected type to be 5, 15, or 25."); } shapeType = type; this.geometryFactory = gf; }
public PointHandler(ShapeType type) throws ShapefileException { if ((type != ShapeType.POINT) && (type != ShapeType.POINTM) && (type != ShapeType.POINTZ)) { // 2d, 2d+m, 3d+m throw new ShapefileException( "PointHandler constructor: expected a type of 1, 11 or 21"); } shapeType = type; }
public PolygonHandler(ShapeType type) throws ShapefileException { if ((type != ShapeType.POLYGON) && (type != ShapeType.POLYGONM) && (type != ShapeType.POLYGONZ)) { throw new ShapefileException( "PolygonHandler constructor - expected type to be 5, 15, or 25."); } shapeType = type; }
public MultiPointHandler(ShapeType type) throws ShapefileException { if ((type != ShapeType.MULTIPOINT) && (type != ShapeType.MULTIPOINTM) && (type != ShapeType.MULTIPOINTZ)) { throw new ShapefileException( "Multipointhandler constructor - expected type to be 8, 18, or 28"); } shapeType = type; }
public PointHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.POINT) && (type != ShapeType.POINTM) && (type != ShapeType.POINTZ)) { // 2d, 2d+m, 3d+m throw new ShapefileException( "PointHandler constructor: expected a type of 1, 11 or 21"); } shapeType = type; this.geometryFactory = gf; }
public PolygonHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.POLYGON) && (type != ShapeType.POLYGONM) && (type != ShapeType.POLYGONZ)) { throw new ShapefileException( "PolygonHandler constructor - expected type to be 5, 15, or 25."); } shapeType = type; this.geometryFactory = gf; }
/** * Create a MultiLineHandler for one of: <br> * ShapeType.ARC,ShapeType.ARCM,ShapeType.ARCZ * * @param type * The ShapeType to use. * @throws ShapefileException * If the ShapeType is not correct (see constructor). */ public MultiLineHandler(ShapeType type) throws ShapefileException { if ((type != ShapeType.ARC) && (type != ShapeType.ARCM) && (type != ShapeType.ARCZ)) { throw new ShapefileException( "MultiLineHandler constructor - expected type to be 3,13 or 23"); } shapeType = type; }
/** * Create a MultiLineHandler for one of: <br> * ShapeType.ARC,ShapeType.ARCM,ShapeType.ARCZ * * @param type * The ShapeType to use. * @throws ShapefileException * If the ShapeType is not correct (see constructor). */ public MultiLineHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.ARC) && (type != ShapeType.ARCM) && (type != ShapeType.ARCZ)) { throw new ShapefileException( "MultiLineHandler constructor - expected type to be 3,13 or 23"); } shapeType = type; this.geometryFactory = gf; }
/** * Create a MultiLineHandler for one of: <br> * ShapeType.ARC,ShapeType.ARCM,ShapeType.ARCZ * * @param type * The ShapeType to use. * @throws ShapefileException * If the ShapeType is not correct (see constructor). */ public MultiLineHandler(ShapeType type, GeometryFactory gf) throws ShapefileException { if ((type != ShapeType.ARC) && (type != ShapeType.ARCM) && (type != ShapeType.ARCZ)) { throw new ShapefileException( "MultiLineHandler constructor - expected type to be 3,13 or 23"); } shapeType = type; this.geometryFactory = gf; }
break; default: throw new ShapefileException("Too many dimensions for shapefile : " + shapeFileDimentions); break; default: throw new ShapefileException("Too many dimensions for shapefile : " + shapeFileDimentions); break; default: throw new ShapefileException("Too many dimensions for shapefile : " + shapeFileDimentions); break; default: throw new ShapefileException("Too many dimensions for shapefile : " + shapeFileDimentions); throw new ShapefileException("Cannot handle geometry type : " + (geom == null ? "null" : geom.getClass().getName()));