org.locationtech.jts.geom.GeometryFactory.getPrecisionModel()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.locationtech.jts.geom.GeometryFactory.getPrecisionModel()方法的一些代码示例,展示了GeometryFactory.getPrecisionModel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeometryFactory.getPrecisionModel()方法的具体详情如下:
包路径:org.locationtech.jts.geom.GeometryFactory
类名称:GeometryFactory
方法名:getPrecisionModel

GeometryFactory.getPrecisionModel介绍

[英]Returns the PrecisionModel that Geometries created by this factory will be associated with.
[中]返回此工厂创建的几何图形将与之关联的PrecisionModel。

代码示例

代码示例来源:origin: geotools/geotools

public DB2WKBReader(GeometryFactory geometryFactory) {
  this.factory = geometryFactory;
  precisionModel = factory.getPrecisionModel();
}

代码示例来源:origin: geotools/geotools

public PrecisionModel getPrecisionModel() {
  return delegate.getPrecisionModel();
}

代码示例来源:origin: geotools/geotools

/**
 * 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();
}

代码示例来源:origin: locationtech/spatial4j

@Override
public double normDist(double d) {
 return geometryFactory.getPrecisionModel().makePrecise(d);
}

代码示例来源:origin: locationtech/spatial4j

@Override
public double normZ(double z) {
 z = super.normZ(z);
 return geometryFactory.getPrecisionModel().makePrecise(z);
}

代码示例来源:origin: locationtech/spatial4j

@Override
public double normX(double x) {
 x = super.normX(x);
 return geometryFactory.getPrecisionModel().makePrecise(x);
}

代码示例来源:origin: locationtech/spatial4j

@Override
public double normY(double y) {
 y = super.normY(y);
 return geometryFactory.getPrecisionModel().makePrecise(y);
}

代码示例来源:origin: geotools/geotools

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))) {

代码示例来源:origin: locationtech/jts

/**
 *  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();
}

代码示例来源:origin: locationtech/jts

/**
 * 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();
}

代码示例来源:origin: locationtech/jts

/**
 *  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();
}

代码示例来源:origin: locationtech/jts

public WKBReader(GeometryFactory geometryFactory) {
 this.factory = geometryFactory;
 precisionModel = factory.getPrecisionModel();
 csFactory = factory.getCoordinateSequenceFactory();
}

代码示例来源:origin: org.n52.series-api/spi

/**
 * 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());
}

代码示例来源:origin: locationtech/jts

protected Coordinate createCoord(double x, double y)
{
  Coordinate pt = new Coordinate(x, y);
  geomFactory.getPrecisionModel().makePrecise(pt);
 return pt;
}

代码示例来源:origin: locationtech/jts

protected Coordinate createCoord(double x, double y)
{
  Coordinate pt = new Coordinate(x, y);
  geomFactory.getPrecisionModel().makePrecise(pt);
 return pt;
}

代码示例来源:origin: locationtech/jts

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;
}

代码示例来源:origin: locationtech/jts

private double getRandOrdinate()
{
  double randNum = getRand();
  double ord = geomFactory.getPrecisionModel().makePrecise(randNum * gridWidth);
  return ord;
}

代码示例来源:origin: locationtech/jts

private void computeGeometry()
{
 bufferOriginalPrecision();
 if (resultGeometry != null) return;
 PrecisionModel argPM = argGeom.getFactory().getPrecisionModel();
 if (argPM.getType() == PrecisionModel.FIXED)
  bufferFixedPrecision(argPM);
 else
  bufferReducedPrecision();
}

代码示例来源:origin: locationtech/jts

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;
}

代码示例来源:origin: locationtech/jts

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;
}

相关文章