Tabnine Logo
Geometry.getPrecisionModel
Code IndexAdd Tabnine to your IDE (free)

How to use
getPrecisionModel
method
in
com.vividsolutions.jts.geom.Geometry

Best Java code snippets using com.vividsolutions.jts.geom.Geometry.getPrecisionModel (Showing top 20 results out of 315)

origin: com.vividsolutions/jts

public GeometryGraphOperation(Geometry g0, Geometry g1, BoundaryNodeRule boundaryNodeRule)
{
 // use the most precise model for the result
 if (g0.getPrecisionModel().compareTo(g1.getPrecisionModel()) >= 0)
  setComputationPrecision(g0.getPrecisionModel());
 else
  setComputationPrecision(g1.getPrecisionModel());
 arg = new GeometryGraph[2];
 arg[0] = new GeometryGraph(0, g0, boundaryNodeRule);
 arg[1] = new GeometryGraph(1, g1, boundaryNodeRule);
}
origin: com.vividsolutions/jts

public static Point createPointFromInternalCoord(Coordinate coord, Geometry exemplar)
{
 exemplar.getPrecisionModel().makePrecise(coord);
 return exemplar.getFactory().createPoint(coord);
}
origin: com.vividsolutions/jts

private Point createPointFromInternalCoord(Coordinate coord, Geometry exemplar)
{
 exemplar.getPrecisionModel().makePrecise(coord);
 return exemplar.getFactory().createPoint(coord);
}
origin: com.vividsolutions/jts

/**
 *  Converts a <code>Geometry</code> to its Well-known Text representation.
 *
 *@param  geometry  a <code>Geometry</code> to process
 */
private void writeFormatted(Geometry geometry, boolean useFormatting, Writer writer)
 throws IOException
{
 this.useFormatting = useFormatting;
 formatter = createFormatter(geometry.getPrecisionModel());
 appendGeometryTaggedText(geometry, 0, writer);
}
origin: com.vividsolutions/jts

public GeometryGraphOperation(Geometry g0) {
 setComputationPrecision(g0.getPrecisionModel());
 arg = new GeometryGraph[1];
 arg[0] = new GeometryGraph(0, g0);;
}
origin: com.vividsolutions/jts

protected CoordinateSequence transformCoordinates(
    CoordinateSequence coords, Geometry parent) {
  Coordinate[] inputPts = coords.toCoordinateArray();
  Coordinate[] newPts = Densifier
      .densifyPoints(inputPts, distanceTolerance, parent.getPrecisionModel());
  // prevent creation of invalid linestrings
  if (parent instanceof LineString && newPts.length == 1) {
    newPts = new Coordinate[0];
  }
  return factory.getCoordinateSequenceFactory().create(newPts);
}
origin: com.vividsolutions/jts

/**
 * Estimates the snap tolerance for a Geometry, taking into account its precision model.
 * 
 * @param g a Geometry
 * @return the estimated snap tolerance
 */
public static double computeOverlaySnapTolerance(Geometry g)
{
   double snapTolerance = computeSizeBasedSnapTolerance(g);
   
   /**
    * Overlay is carried out in the precision model 
    * of the two inputs.  
    * If this precision model is of type FIXED, then the snap tolerance
    * must reflect the precision grid size.  
    * Specifically, the snap tolerance should be at least 
    * the distance from a corner of a precision grid cell
    * to the centre point of the cell.  
    */
   PrecisionModel pm = g.getPrecisionModel();
   if (pm.getType() == PrecisionModel.FIXED) {
     double fixedSnapTol = (1 / pm.getScale()) * 2 / 1.415;
     if (fixedSnapTol > snapTolerance)
       snapTolerance = fixedSnapTol;
   }
   return snapTolerance;
}
origin: org.geotools/gt-render

public PrecisionModel getPrecisionModel() {
  return geometry.getPrecisionModel();
}
origin: com.vividsolutions/jts

precisionModel = g.getPrecisionModel();
origin: com.vividsolutions/jts-core

public GeometryGraphOperation(Geometry g0, Geometry g1, BoundaryNodeRule boundaryNodeRule)
{
 // use the most precise model for the result
 if (g0.getPrecisionModel().compareTo(g1.getPrecisionModel()) >= 0)
  setComputationPrecision(g0.getPrecisionModel());
 else
  setComputationPrecision(g1.getPrecisionModel());
 arg = new GeometryGraph[2];
 arg[0] = new GeometryGraph(0, g0, boundaryNodeRule);
 arg[1] = new GeometryGraph(1, g1, boundaryNodeRule);
}
origin: com.vividsolutions/jts-core

public static Point createPointFromInternalCoord(Coordinate coord, Geometry exemplar)
{
 exemplar.getPrecisionModel().makePrecise(coord);
 return exemplar.getFactory().createPoint(coord);
}
origin: com.vividsolutions/jts-core

private Point createPointFromInternalCoord(Coordinate coord, Geometry exemplar)
{
 exemplar.getPrecisionModel().makePrecise(coord);
 return exemplar.getFactory().createPoint(coord);
}
origin: com.vividsolutions/jts-core

/**
 *  Converts a <code>Geometry</code> to its Well-known Text representation.
 *
 *@param  geometry  a <code>Geometry</code> to process
 */
private void writeFormatted(Geometry geometry, boolean useFormatting, Writer writer)
 throws IOException
{
 this.useFormatting = useFormatting;
 formatter = createFormatter(geometry.getPrecisionModel());
 appendGeometryTaggedText(geometry, 0, writer);
}
origin: com.vividsolutions/jts-core

public GeometryGraphOperation(Geometry g0) {
 setComputationPrecision(g0.getPrecisionModel());
 arg = new GeometryGraph[1];
 arg[0] = new GeometryGraph(0, g0);;
}
origin: com.vividsolutions/jts-core

protected CoordinateSequence transformCoordinates(
    CoordinateSequence coords, Geometry parent) {
  Coordinate[] inputPts = coords.toCoordinateArray();
  Coordinate[] newPts = Densifier
      .densifyPoints(inputPts, distanceTolerance, parent.getPrecisionModel());
  // prevent creation of invalid linestrings
  if (parent instanceof LineString && newPts.length == 1) {
    newPts = new Coordinate[0];
  }
  return factory.getCoordinateSequenceFactory().create(newPts);
}
origin: com.vividsolutions/jts-core

/**
 * Estimates the snap tolerance for a Geometry, taking into account its precision model.
 * 
 * @param g a Geometry
 * @return the estimated snap tolerance
 */
public static double computeOverlaySnapTolerance(Geometry g)
{
   double snapTolerance = computeSizeBasedSnapTolerance(g);
   
   /**
    * Overlay is carried out in the precision model 
    * of the two inputs.  
    * If this precision model is of type FIXED, then the snap tolerance
    * must reflect the precision grid size.  
    * Specifically, the snap tolerance should be at least 
    * the distance from a corner of a precision grid cell
    * to the centre point of the cell.  
    */
   PrecisionModel pm = g.getPrecisionModel();
   if (pm.getType() == PrecisionModel.FIXED) {
     double fixedSnapTol = (1 / pm.getScale()) * 2 / 1.415;
     if (fixedSnapTol > snapTolerance)
       snapTolerance = fixedSnapTol;
   }
   return snapTolerance;
}
origin: DataSystemsLab/GeoSpark

/**
 * Instantiates a new circle.
 *
 * @param centerGeometry the center geometry
 * @param givenRadius the given radius
 */
public Circle(Geometry centerGeometry, Double givenRadius)
{
  super(new GeometryFactory(centerGeometry.getPrecisionModel()));
  this.centerGeometry = centerGeometry;
  Envelope centerGeometryMBR = this.centerGeometry.getEnvelopeInternal();
  this.centerPoint = new Coordinate((centerGeometryMBR.getMinX() + centerGeometryMBR.getMaxX()) / 2.0,
      (centerGeometryMBR.getMinY() + centerGeometryMBR.getMaxY()) / 2.0);
  // Get the internal radius of the object. We need to make sure that the circle at least should be the minimum circumscribed circle
  double width = centerGeometryMBR.getMaxX() - centerGeometryMBR.getMinX();
  double length = centerGeometryMBR.getMaxY() - centerGeometryMBR.getMinY();
  double centerGeometryInternalRadius = Math.sqrt(width * width + length * length) / 2;
  this.radius = givenRadius > centerGeometryInternalRadius ? givenRadius : centerGeometryInternalRadius;
  this.MBR = new Envelope(this.centerPoint.x - this.radius, this.centerPoint.x + this.radius, this.centerPoint.y - this.radius, this.centerPoint.y + this.radius);
  this.setUserData(centerGeometry.getUserData());
}
origin: org.datasyslab/geospark

/**
 * Instantiates a new circle.
 *
 * @param centerGeometry the center geometry
 * @param givenRadius the given radius
 */
public Circle(Geometry centerGeometry, Double givenRadius)
{
  super(new GeometryFactory(centerGeometry.getPrecisionModel()));
  this.centerGeometry = centerGeometry;
  Envelope centerGeometryMBR = this.centerGeometry.getEnvelopeInternal();
  this.centerPoint = new Coordinate((centerGeometryMBR.getMinX() + centerGeometryMBR.getMaxX()) / 2.0,
      (centerGeometryMBR.getMinY() + centerGeometryMBR.getMaxY()) / 2.0);
  // Get the internal radius of the object. We need to make sure that the circle at least should be the minimum circumscribed circle
  double width = centerGeometryMBR.getMaxX() - centerGeometryMBR.getMinX();
  double length = centerGeometryMBR.getMaxY() - centerGeometryMBR.getMinY();
  double centerGeometryInternalRadius = Math.sqrt(width * width + length * length) / 2;
  this.radius = givenRadius > centerGeometryInternalRadius ? givenRadius : centerGeometryInternalRadius;
  this.MBR = new Envelope(this.centerPoint.x - this.radius, this.centerPoint.x + this.radius, this.centerPoint.y - this.radius, this.centerPoint.y + this.radius);
  this.setUserData(centerGeometry.getUserData());
}
origin: com.vividsolutions/jts-core

precisionModel = g.getPrecisionModel();
origin: org.geomajas.project/geomajas-project-geometry-jts

PrecisionModel precisionmodel = geometry.getPrecisionModel();
if (!precisionmodel.isFloating()) {
  precision = (int) Math.log10(precisionmodel.getScale());
com.vividsolutions.jts.geomGeometrygetPrecisionModel

Javadoc

Returns the PrecisionModel used by the Geometry.

Popular methods of Geometry

  • getEnvelopeInternal
    Gets an Envelope containing the minimum and maximum x and y values in this Geometry. If the geometr
  • getCoordinates
    Returns an array containing the values of all the vertices for this geometry. If the geometry is a c
  • isEmpty
    Tests whether the set of points covered by this Geometry is empty.
  • getCentroid
    Computes the centroid of this Geometry. The centroid is equal to the centroid of the set of componen
  • getGeometryN
    Returns an element Geometry from a GeometryCollection(or this, if the geometry is not a collection).
  • toText
    Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text
  • getNumGeometries
    Returns the number of Geometrys in a GeometryCollection(or 1, if the geometry is not a collection).
  • getFactory
    Gets the factory which contains the context in which this geometry was created.
  • getGeometryType
    Returns the name of this Geometry's actual class.
  • getSRID
    Returns the ID of the Spatial Reference System used by the Geometry. JTS supports Spatial Reference
  • getCoordinate
    Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordi
  • intersection
    Computes a Geometry representing the point-set which is common to both this Geometry and the other
  • getCoordinate,
  • intersection,
  • buffer,
  • contains,
  • getArea,
  • getEnvelope,
  • intersects,
  • union,
  • apply,
  • getLength

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • setContentView (Activity)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now