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

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

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

origin: opentripplanner/OpenTripPlanner

/**
 * Create a new concave hull construction for the input {@link Geometry}.
 * 
 * @param geometry
 * @param threshold
 */
public ConcaveHull(Geometry geometry, double threshold) {
  this.geometries = transformIntoPointGeometryCollection(geometry);
  this.threshold = threshold;
  this.geomFactory = geometry.getFactory();
}

origin: opentripplanner/OpenTripPlanner

private Geometry removeDuplicatePoints(Geometry routeGeometry) {
  List<Coordinate> coords = new ArrayList<Coordinate>();
  Coordinate last = null;
  for (Coordinate c : routeGeometry.getCoordinates()) {
    if (!c.equals(last)) {
      last = c;
      coords.add(c);
    }
  }
  if (coords.size() < 2) {
    return null;
  }
  Coordinate[] coordArray = new Coordinate[coords.size()];
  return routeGeometry.getFactory().createLineString(coords.toArray(coordArray));
}
origin: opentripplanner/OpenTripPlanner

/**
 * Transform into GeometryCollection.
 * 
 * @param geom
 *         input geometry
 * @return
 *         a geometry collection
 */
private static GeometryCollection transformIntoPointGeometryCollection(Geometry geom) {
  UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
  geom.apply(filter);
  Coordinate[] coord = filter.getCoordinates();
  
  Geometry[] geometries = new Geometry[coord.length];
  for (int i = 0 ; i < coord.length ; i++) {
    Coordinate[] c = new Coordinate[] { coord[i] };
    CoordinateArraySequence cs = new CoordinateArraySequence(c);
    geometries[i] = new Point(cs, geom.getFactory());
  }
  
  return new GeometryCollection(geometries, geom.getFactory());
}
origin: com.vividsolutions/jts

public BoundaryOp(Geometry geom, BoundaryNodeRule bnRule)
{
 this.geom = geom;
 geomFact = geom.getFactory();
 this.bnRule = bnRule;
}
origin: com.vividsolutions/jts

/**
 * Extracts the GeometryFactory used by the geometries in a collection
 * 
 * @param geoms
 * @return a GeometryFactory
 */
public static GeometryFactory extractFactory(Collection geoms) {
  if (geoms.isEmpty())
    return null;
  return ((Geometry) geoms.iterator().next()).getFactory();
}
 
origin: com.vividsolutions/jts

public InteriorPointArea(Geometry g)
{
 factory = g.getFactory();
 add(g);
}
public Coordinate getInteriorPoint()
origin: com.vividsolutions/jts

/**
 * Create a new convex hull construction for the input {@link Geometry}.
 */
public ConvexHull(Geometry geometry)
{
 this(extractCoordinates(geometry), geometry.getFactory());
}
/**
origin: com.vividsolutions/jts

public void filter(Geometry geom)
{
  if (isForcedToLineString && geom instanceof LinearRing) {
    LineString line = geom.getFactory().createLineString( ((LinearRing) geom).getCoordinateSequence());
    lines.add(line);
    return;
  }
  // if not being forced, and this is a linear component
  if (geom instanceof LineString) 
    lines.add(geom);
  
  // else this is not a linear component, so skip it
}
origin: com.vividsolutions/jts

private Geometry bufferUnion(List geoms)
{
  GeometryFactory factory = ((Geometry) geoms.get(0)).getFactory();
  Geometry gColl = factory.buildGeometry(geoms);
  Geometry unionAll = gColl.buffer(0.0);
 return unionAll;
}
 
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

public static void unionUsingBuffer(Geometry[] geom)
{
 GeometryFactory fact = geom[0].getFactory();
 Geometry geomColl = fact.createGeometryCollection(geom);
 Geometry union = geomColl.buffer(0.0);
 System.out.println(union);
}
origin: com.vividsolutions/jts

/**
 * Gets the segment forming the base of the minimum diameter
 *
 * @return the segment forming the base of the minimum diameter
 */
public LineString getSupportingSegment()
{
 computeMinimumDiameter();
 return inputGeom.getFactory().createLineString(new Coordinate[] { minBaseSeg.p0, minBaseSeg.p1 } );
}
origin: com.vividsolutions/jts

private Geometry bufferUnion(Geometry g0, Geometry g1)
{
  GeometryFactory factory = g0.getFactory();
  Geometry gColl = factory.createGeometryCollection(new Geometry[] { g0, g1 } );
  Geometry unionAll = gColl.buffer(0.0);
 return unionAll;
}
origin: com.vividsolutions/jts

private Geometry getPolygonLines(Geometry g)
{
  List lines = new ArrayList();
  LinearComponentExtracter lineExtracter = new LinearComponentExtracter(lines);
  List polys = PolygonExtracter.getPolygons(g);
  for (Iterator i = polys.iterator(); i.hasNext(); ) {
    Polygon poly = (Polygon) i.next();
    poly.apply(lineExtracter);
  }
  return g.getFactory().buildGeometry(lines);
}
 
origin: com.vividsolutions/jts

public LineString getLine()
{
 compute();
 return inputGeom.getFactory().createLineString(minClearancePts);
}
 
origin: com.vividsolutions/jts

public UnionInteracting(Geometry g0, Geometry g1)
{
  this.g0 = g0;
  this.g1 = g1;
  geomFactory = g0.getFactory();
  interacts0 = new boolean[g0.getNumGeometries()];
  interacts1 = new boolean[g1.getNumGeometries()];
}
 
origin: com.vividsolutions/jts

public OverlayOp(Geometry g0, Geometry g1) {
 super(g0, g1);
 graph = new PlanarGraph(new OverlayNodeFactory());
 /**
  * Use factory of primary geometry.
  * Note that this does NOT handle mixed-precision arguments
  * where the second arg has greater precision than the first.
  */
 geomFact = g0.getFactory();
}
origin: com.vividsolutions/jts

public Geometry reduce(Geometry geom)
{
 GeometryEditor geomEdit;
 if (changePrecisionModel) {
  GeometryFactory newFactory = new GeometryFactory(newPrecisionModel, geom.getFactory().getSRID());
  geomEdit = new GeometryEditor(newFactory);
 }
 else
  // don't change geometry factory
  geomEdit = new GeometryEditor();
 return geomEdit.edit(geom, new PrecisionReducerCoordinateOperation());
}
origin: com.vividsolutions/jts

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

Javadoc

Gets the factory which contains the context in which this geometry was created.

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).
  • 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
  • buffer
    Computes a buffer area around this geometry having the given width and with a specified accuracy of
  • intersection,
  • buffer,
  • contains,
  • getArea,
  • getEnvelope,
  • intersects,
  • union,
  • apply,
  • getLength

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • Menu (java.awt)
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ImageIO (javax.imageio)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm 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