congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Geometry.getCoordinate
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.vividsolutions/jts

public void filter(Geometry geom)
{
 if (geom instanceof Point
  || geom instanceof LineString
  || geom instanceof Polygon )
  pts.add(geom.getCoordinate());
}
origin: com.vividsolutions/jts

public void filter(Geometry geom)
{
 // add coordinates from connected components
 if (geom instanceof LineString
   || geom instanceof Point) 
  coords.add(geom.getCoordinate());
}
origin: com.vividsolutions/jts

public void filter(Geometry geom)
{
 if (geom instanceof Point
  || geom instanceof LineString
  || geom instanceof Polygon )
  locations.add(new GeometryLocation(geom, 0, geom.getCoordinate()));
}
origin: com.vividsolutions/jts

public Coordinate getCoordinate() {
 if (isEmpty()) return null;
 return geometries[0].getCoordinate();
}
origin: com.vividsolutions/jts

/**
 * Adds the point(s) defined by a Geometry to the centroid total.
 * If the geometry is not of dimension 0 it does not contribute to the centroid.
 * @param geom the geometry to add
 */
public void add(Geometry geom)
{
 if (geom instanceof Point) {
  add(geom.getCoordinate());
 }
 else if (geom instanceof GeometryCollection) {
  GeometryCollection gc = (GeometryCollection) geom;
  for (int i = 0; i < gc.getNumGeometries(); i++) {
   add(gc.getGeometryN(i));
  }
 }
}
origin: com.vividsolutions/jts

/**
 * Tests the point(s) defined by a Geometry for the best inside point.
 * If a Geometry is not of dimension 0 it is not tested.
 * @param geom the geometry to add
 */
private void add(Geometry geom)
{
 if (geom instanceof Point) {
  add(geom.getCoordinate());
 }
 else if (geom instanceof GeometryCollection) {
  GeometryCollection gc = (GeometryCollection) geom;
  for (int i = 0; i < gc.getNumGeometries(); i++) {
   add(gc.getGeometryN(i));
  }
 }
}
private void add(Coordinate point)
origin: com.vividsolutions/jts

public static void computeDistance(Geometry geom, Coordinate pt, PointPairDistance ptDist)
{
 if (geom instanceof LineString) {
  computeDistance((LineString) geom, pt, ptDist);
 }
 else if (geom instanceof Polygon) {
  computeDistance((Polygon) geom, pt, ptDist);
 }
 else if (geom instanceof GeometryCollection) {
  GeometryCollection gc = (GeometryCollection) geom;
  for (int i = 0; i < gc.getNumGeometries(); i++) {
   Geometry g = gc.getGeometryN(i);
   computeDistance(g, pt, ptDist);
  }
 }
 else { // assume geom is Point
  ptDist.setMinimum(geom.getCoordinate(), pt);
 }
}
public static void computeDistance(LineString line, Coordinate pt, PointPairDistance ptDist)
origin: com.vividsolutions/jts

public static void computeDistance(Geometry geom, Coordinate pt, PointPairDistance ptDist)
{
 if (geom instanceof LineString) {
  computeDistance((LineString) geom, pt, ptDist);
 }
 else if (geom instanceof Polygon) {
  computeDistance((Polygon) geom, pt, ptDist);
 }
 else if (geom instanceof GeometryCollection) {
  GeometryCollection gc = (GeometryCollection) geom;
  for (int i = 0; i < gc.getNumGeometries(); i++) {
   Geometry g = gc.getGeometryN(i);
   computeDistance(g, pt, ptDist);
  }
 }
 else { // assume geom is Point
  ptDist.setMinimum(geom.getCoordinate(), pt);
 }
}
public static void computeDistance(LineString line, Coordinate pt, PointPairDistance ptDist)
origin: DataSystemsLab/GeoSpark

@Override
public Coordinate getCoordinate()
{
  return this.centerGeometry.getCoordinate();
}
origin: org.orbisgis/h2gis-functions

  /**
   * @param geometry Geometry instance
   * @return A z coordinate or null if null or empty geometry.
   */
  public static Double getZ(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getCoordinate().z;
  }
}
origin: com.vividsolutions/jts-core

public void filter(Geometry geom)
{
 // add coordinates from connected components
 if (geom instanceof LineString
   || geom instanceof Point) 
  coords.add(geom.getCoordinate());
}
origin: com.vividsolutions/jts-core

public void filter(Geometry geom)
{
 if (geom instanceof Point
  || geom instanceof LineString
  || geom instanceof Polygon )
  pts.add(geom.getCoordinate());
}
origin: codice/ddf

@Override
public Map toJsonMap() {
 List<Double> coordinatesList = new ArrayList<Double>();
 coordinatesList.add(geometry.getCoordinate().x);
 coordinatesList.add(geometry.getCoordinate().y);
 return createMap(COORDINATES_KEY, coordinatesList);
}
origin: org.teiid/teiid-engine

public static Integer coordDim(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  Coordinate c = g.getCoordinate();
  if (c != null && !Double.isNaN(c.z)) {
    return 3;
  }
  return 2;
}
origin: org.orbisgis/core-map

public static void flashPoint(final Geometry geometry, Graphics2D graphics,
    MapTransform mt) {
  Point2D p = new Point2D.Double(geometry.getCoordinate().x, geometry
      .getCoordinate().y);
  p = mt.getAffineTransform().transform(p, null);
  int IND_CIRCLE_RADIUS = 20;
  Ellipse2D.Double circle = new Ellipse2D.Double(p.getX()
      - (IND_CIRCLE_RADIUS / 2), p.getY() - (IND_CIRCLE_RADIUS / 2),
      IND_CIRCLE_RADIUS, IND_CIRCLE_RADIUS);
  flash(circle, graphics, Color.red, new BasicStroke(1,
      BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND), 1000);
}

origin: org.wikibrainapi/wikibrain-spatial

public double getDistance(Geometry a, Geometry b){
  GeodeticCalculator geoCalc = new GeodeticCalculator();
  geoCalc.setStartingGeographicPoint(a.getCoordinate().x, a.getCoordinate().y);
  geoCalc.setDestinationGeographicPoint(b.getCoordinate().x, b.getCoordinate().y);
  return geoCalc.getOrthodromicDistance() / 1000;
}
origin: teiid/teiid

public static Integer coordDim(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  Coordinate c = g.getCoordinate();
  if (c != null && !Double.isNaN(c.z)) {
    return 3;
  }
  return 2;
}
origin: org.jboss.teiid/teiid-engine

public static Integer coordDim(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  Coordinate c = g.getCoordinate();
  if (c != null && !Double.isNaN(c.z)) {
    return 3;
  }
  return 2;
}
origin: BaseXdb/basex

 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return Dbl.get(geo(0, qc, POINT, Q_GML_POINT).getCoordinate().y);
 }
}
origin: BaseXdb/basex

 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return Dbl.get(geo(0, qc, POINT, Q_GML_POINT).getCoordinate().x);
 }
}
com.vividsolutions.jts.geomGeometrygetCoordinate

Javadoc

Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation.

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
  • 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

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Path (java.nio.file)
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • BoxLayout (javax.swing)
  • JOptionPane (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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