/** * Normalize the line string * * @param lineString * line string * @param maxX * max positive x value in the geometry projection */ private static void normalize(LineString lineString, double maxX) { for (Point point : lineString.getPoints()) { normalize(point, maxX); } }
switch (geometryType) { case POINT: normalize((Point) geometry, maxX); break; case LINESTRING: normalize((LineString) geometry, maxX); break; case POLYGON: normalize((Polygon) geometry, maxX); break; case MULTIPOINT: normalize((MultiPoint) geometry, maxX); break; case MULTILINESTRING: normalize((MultiLineString) geometry, maxX); break; case MULTIPOLYGON: normalize((MultiPolygon) geometry, maxX); break; case CIRCULARSTRING: normalize((CircularString) geometry, maxX); break; case COMPOUNDCURVE: normalize((CompoundCurve) geometry, maxX); break; case CURVEPOLYGON: @SuppressWarnings("unchecked") CurvePolygon<Curve> curvePolygon = (CurvePolygon<Curve>) geometry; normalize(curvePolygon, maxX);
/** * Normalize the compound curve * * @param compoundCurve * compound curve * @param maxX * max positive x value in the geometry projection */ private static void normalize(CompoundCurve compoundCurve, double maxX) { for (LineString lineString : compoundCurve.getLineStrings()) { normalize(lineString, maxX); } }
/** * Normalize the polygon * * @param polygon * polygon * @param maxX * max positive x value in the geometry projection */ private static void normalize(Polygon polygon, double maxX) { for (LineString ring : polygon.getRings()) { normalize(ring, maxX); } }
/** * Normalize the polyhedral surface * * @param polyhedralSurface * polyhedral surface * @param maxX * max positive x value in the geometry projection */ private static void normalize(PolyhedralSurface polyhedralSurface, double maxX) { for (Polygon polygon : polyhedralSurface.getPolygons()) { normalize(polygon, maxX); } }
/** * Normalize the multi line string * * @param multiLineString * multi line string * @param maxX * max positive x value in the geometry projection */ private static void normalize(MultiLineString multiLineString, double maxX) { List<LineString> lineStrings = multiLineString.getLineStrings(); for (LineString lineString : lineStrings) { normalize(lineString, maxX); } }
/** * Normalize the multi point * * @param multiPoint * multi point * @param maxX * max positive x value in the geometry projection */ private static void normalize(MultiPoint multiPoint, double maxX) { List<Point> points = multiPoint.getPoints(); for (Point point : points) { normalize(point, maxX); } }
/** * Normalize the multi polygon * * @param multiPolygon * multi polygon * @param maxX * max positive x value in the geometry projection */ private static void normalize(MultiPolygon multiPolygon, double maxX) { List<Polygon> polygons = multiPolygon.getPolygons(); for (Polygon polygon : polygons) { normalize(polygon, maxX); } }