/** Normalize the 'y' dimension. Might reduce precision or wrap it to be within the bounds. This * is called by {@link org.locationtech.spatial4j.io.WKTReader} before creating a shape. */ @Deprecated public double normY(double y) { return shapeFactory.normY(y); }
public <T extends ShapeFactory.PointsBuilder> T readPoints(T builder) throws IOException { while(isData()) { builder.pointXY(shpFactory.normX(readLat()), shpFactory.normY(readLng())); } return builder; }
/** * Reads a raw Point (AKA Coordinate) from the current position. Only the first 2 numbers are * used. The values are normalized. * * <pre> * number number number* * </pre> */ protected ShapeFactory.PointsBuilder point(State state, ShapeFactory.PointsBuilder pointsBuilder) throws ParseException { double x = state.nextDouble(); double y = state.nextDouble(); state.skipNextDoubles();//TODO capture to call pointXYZ pointsBuilder.pointXY(shapeFactory.normX(x), shapeFactory.normY(y)); return pointsBuilder; }
/** * Parses an ENVELOPE (aka Rectangle) shape from the raw string. The values are normalized. * <p> * Source: OGC "Catalogue Services Specification", the "CQL" (Common Query Language) sub-spec. * <em>Note the inconsistent order of the min & max values between x & y!</em> * * <pre> * '(' x1 ',' x2 ',' y2 ',' y1 ')' * </pre> */ protected Shape parseEnvelopeShape(State state) throws ParseException { // FYI no dimension or EMPTY state.nextExpect('('); double x1 = state.nextDouble(); state.nextExpect(','); double x2 = state.nextDouble(); state.nextExpect(','); double y2 = state.nextDouble(); state.nextExpect(','); double y1 = state.nextDouble(); state.nextExpect(')'); return shapeFactory.rect(shapeFactory.normX(x1), shapeFactory.normX(x2), shapeFactory.normY(y1), shapeFactory.normY(y2)); }
lastShape = shpFactory.pointXY(shpFactory.normX(reader.readLat()), shpFactory.normY(reader.readLng())); break; double lon1 = shpFactory.normY(reader.readLng()); lastShape = shpFactory.rect(lat1, shpFactory.normX(reader.readLat()), lon1, shpFactory.normY(reader.readLng())); break; throw new IllegalArgumentException("the input should have a radius argument"); lastShape = shpFactory.circle(shpFactory.normX(reader.readLat()), shpFactory.normY(reader.readLng()), shpFactory.normDist(arg.doubleValue())); break;