public DB2WKBReader(GeometryFactory geometryFactory) { this.factory = geometryFactory; precisionModel = factory.getPrecisionModel(); }
public PrecisionModel getPrecisionModel() { return delegate.getPrecisionModel(); }
/** * Creates a reader that creates objects using the given {@link GeometryFactory}. * * @param geometryFactory the factory used to create <code>Geometry</code>s. */ public WKTReader2(GeometryFactory geometryFactory) { if (geometryFactory instanceof CurvedGeometryFactory) { this.geometryFactory = (CurvedGeometryFactory) geometryFactory; } else { this.geometryFactory = new CurvedGeometryFactory(geometryFactory, Double.MAX_VALUE); } precisionModel = geometryFactory.getPrecisionModel(); }
@Override public double normDist(double d) { return geometryFactory.getPrecisionModel().makePrecise(d); }
@Override public double normZ(double z) { z = super.normZ(z); return geometryFactory.getPrecisionModel().makePrecise(z); }
@Override public double normX(double x) { x = super.normX(x); return geometryFactory.getPrecisionModel().makePrecise(x); }
@Override public double normY(double y) { y = super.normY(y); return geometryFactory.getPrecisionModel().makePrecise(y); }
final GeometryFactory factory = (GeometryFactory) provider; final CoordinateSequenceFactory sequence = factory.getCoordinateSequenceFactory(); final PrecisionModel precision = factory.getPrecisionModel(); if (!isAcceptable(sequence, hints.get(Hints.JTS_COORDINATE_SEQUENCE_FACTORY)) || !isAcceptable(precision, hints.get(Hints.JTS_PRECISION_MODEL))) {
/** * Returns the <code>PrecisionModel</code> used by the <code>Geometry</code>. * *@return the specification of the grid of allowable points, for this * <code>Geometry</code> and all other <code>Geometry</code>s */ public PrecisionModel getPrecisionModel() { return factory.getPrecisionModel(); }
/** * Create a shape factory which will create shapes using the given * {@link GeometryFactory}. * * @param geomFact the factory to use */ public GeometricShapeFactory(GeometryFactory geomFact) { this.geomFact = geomFact; precModel = geomFact.getPrecisionModel(); }
/** * Creates a reader that creates objects using the given * {@link GeometryFactory}. * *@param geometryFactory the factory used to create <code>Geometry</code>s. */ public WKTReader(GeometryFactory geometryFactory) { this.geometryFactory = geometryFactory; this.csFactory = geometryFactory.getCoordinateSequenceFactory(); this.precisionModel = geometryFactory.getPrecisionModel(); }
public WKBReader(GeometryFactory geometryFactory) { this.factory = geometryFactory; precisionModel = factory.getPrecisionModel(); csFactory = factory.getCoordinateSequenceFactory(); }
/** * Convert the supplied {@code GeometryFactory}. * * @param factory the factory * * @return the converted factory */ private com.vividsolutions.jts.geom.GeometryFactory convertFactory( org.locationtech.jts.geom.GeometryFactory factory) { return new com.vividsolutions.jts.geom.GeometryFactory( convertPrecisionModel(factory.getPrecisionModel()), factory.getSRID()); }
protected Coordinate createCoord(double x, double y) { Coordinate pt = new Coordinate(x, y); geomFactory.getPrecisionModel().makePrecise(pt); return pt; }
protected Coordinate createCoord(double x, double y) { Coordinate pt = new Coordinate(x, y); geomFactory.getPrecisionModel().makePrecise(pt); return pt; }
private GeometryEditor createEditor(GeometryFactory geomFactory, PrecisionModel newPM) { // no need to change if precision model is the same if (geomFactory.getPrecisionModel() == newPM) return new GeometryEditor(); // otherwise create a geometry editor which changes PrecisionModel GeometryFactory newFactory = createFactory(geomFactory, newPM); GeometryEditor geomEdit = new GeometryEditor(newFactory); return geomEdit; }
private double getRandOrdinate() { double randNum = getRand(); double ord = geomFactory.getPrecisionModel().makePrecise(randNum * gridWidth); return ord; }
private void computeGeometry() { bufferOriginalPrecision(); if (resultGeometry != null) return; PrecisionModel argPM = argGeom.getFactory().getPrecisionModel(); if (argPM.getType() == PrecisionModel.FIXED) bufferFixedPrecision(argPM); else bufferReducedPrecision(); }
public static Geometry offsetCurve(Geometry geom, double distance) { BufferParameters bufParams = new BufferParameters(); OffsetCurveBuilder ocb = new OffsetCurveBuilder( geom.getFactory().getPrecisionModel(), bufParams ); Coordinate[] pts = ocb.getOffsetCurve(geom.getCoordinates(), distance); Geometry curve = geom.getFactory().createLineString(pts); return curve; }
public static Geometry singleSidedBufferCurve(Geometry geom, double distance) { BufferParameters bufParam = new BufferParameters(); bufParam.setSingleSided(true); OffsetCurveBuilder ocb = new OffsetCurveBuilder( geom.getFactory().getPrecisionModel(), bufParam ); Coordinate[] pts = ocb.getLineCurve(geom.getCoordinates(), distance); Geometry curve = geom.getFactory().createLineString(pts); return curve; }