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

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

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

origin: com.vividsolutions/jts

private void write(Geometry geom, Writer writer, int level)
    throws IOException 
    {
  isRootTag = true;
  if (geom instanceof Point) {
    writePoint((Point) geom, writer, level);
  } else if (geom instanceof LineString) {
    writeLineString((LineString) geom, writer, level);
  } else if (geom instanceof Polygon) {
    writePolygon((Polygon) geom, writer, level);
  } else if (geom instanceof MultiPoint) {
    writeMultiPoint((MultiPoint) geom, writer, level);
  } else if (geom instanceof MultiLineString) {
    writeMultiLineString((MultiLineString) geom, writer, level);
  } else if (geom instanceof MultiPolygon) {
    writeMultiPolygon((MultiPolygon) geom, writer, level);
  } else if (geom instanceof GeometryCollection) {
    writeGeometryCollection((GeometryCollection) geom, writer,
        startingIndentIndex);
  } else {
    throw new IllegalArgumentException("Unhandled geometry type: "
        + geom.getGeometryType());
  }
  writer.flush();
}
origin: org.orbisgis/h2gis

  /**
   * @param geometry Geometry instance
   * @return Geometry type equivalent to {@link com.vividsolutions.jts.geom.Geometry#getGeometryType()}
   */
  public static String getGeometryType(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getGeometryType();
  }
}
origin: org.geotools/gt-main

static public String geometryType(Geometry arg0)
{
   if (arg0 == null) return null;
   Geometry _this = arg0;
   return _this.getGeometryType();
}
origin: org.geotools/gt2-main

static public String geometryType(Geometry arg0)
{
   Geometry _this = arg0;
   return _this.getGeometryType();
}
origin: org.orbisgis/h2gis-functions

  /**
   * @param geometry Geometry instance
   * @return Geometry type equivalent to {@link com.vividsolutions.jts.geom.Geometry#getGeometryType()}
   */
  public static String getGeometryType(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getGeometryType();
  }
}
origin: org.orbisgis/h2spatial

  /**
   * @param geometry Geometry instance
   * @return Geometry type equivalent to {@link com.vividsolutions.jts.geom.Geometry#getGeometryType()}
   */
  public static String getGeometryType(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getGeometryType();
  }
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a MultiPoint.
 * @param geometry
 * @return
 */
public static boolean isMultiPoint(Geometry geometry) {
  return geometry.getGeometryType().equals(MULTIPOINT_GEOMETRY_TYPE);
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a MultiPolygon.
 * @param geometry
 * @return
 */
public static boolean isMultiPolygon(Geometry geometry) {
  return geometry.getGeometryType().equals(MULTIPOLYGON_GEOMETRY_TYPE);
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a Point.
 * @param geometry
 * @return
 */
public static boolean isPoint(Geometry geometry) {
  return geometry.getGeometryType().equals(POINT_GEOMETRY_TYPE);
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a LineString.
 * @param geometry
 * @return
 */
public static boolean isLineString(Geometry geometry) {
  return geometry.getGeometryType().equals(LINESTRING_GEOMETRY_TYPE);
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a LinearRing.
 * @param geometry
 * @return
 */
public static boolean isLinearRing(Geometry geometry) {
  return geometry.getGeometryType().equals(LINEARRING_GEOMETRY_TYPE);
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a Polygon.
 * @param geometry
 * @return
 */
public static boolean isPolygon(Geometry geometry) {
  return geometry.getGeometryType().equals(POLYGON_GEOMETRY_TYPE);
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a MultiPoint.
 * @param geometry
 * @return
 */
public static boolean isMultiLineString(Geometry geometry) {
  return geometry.getGeometryType().equals(MULTILINESTRING_GEOMETRY_TYPE);
}
origin: org.orbisgis/orbisgis-core

/**
 * Tests if the geometry is a GeometryCollection.
 * @param geometry
 * @return
 */
public static boolean isGeometryCollection(Geometry geometry) {
  return geometry.getGeometryType().equals(GEOMETRYCOLLECTION_GEOMETRY_TYPE);
}
origin: net.disy.wps/wps-samples

private String getType(Geometry geometry) {
 if (geometry instanceof Point) {
  return "point"; //$NON-NLS-1$
 }
 if (geometry instanceof LineString) {
  return "polyline"; //$NON-NLS-1$
 }
 throw new IllegalArgumentException("Type '" //$NON-NLS-1$
   + geometry.getGeometryType()
   + "' is not supported."); //$NON-NLS-1$
}
origin: sinergise/Sentinel2ProductIngestor

public Geometry getCoverage(double bufferSize) throws Exception {
  Geometry geom =   bufferSize == 0 ? coveragesIntersection : coveragesIntersection == null ? null : shrink(coveragesIntersection, bufferSize);
  if (!(geom instanceof Polygon || geom instanceof MultiPolygon)) {
    logger.error("The result of buffering should be a polygon or multipolygon, its {} instead.",
        geom.getGeometryType());
    System.out.println(geom.toText());
    throw new Exception("The result of buffering should be a polygon or multipolygon, its "
        + geom.getGeometryType() + " instead.");
  }
  return geom;
}

origin: codice/ddf

@Override
public Map toJsonMap() {
 Map map = new HashMap();
 if (TYPE.equals(geometry.getGeometryType())) {
  map.put(TYPE_KEY, TYPE);
  List linearRingsList = buildJsonPolygon((com.vividsolutions.jts.geom.Polygon) geometry);
  map.put(COORDINATES_KEY, linearRingsList);
 } else {
  throw new UnsupportedOperationException("Geometry is not a " + TYPE);
 }
 return map;
}
origin: DataSystemsLab/GeoSpark

@Override
public boolean equalsExact(Geometry g, double tolerance)
{
  String type1 = this.getGeometryType();
  String type2 = ((Geometry) g).getGeometryType();
  double radius1 = this.radius;
  double radius2 = ((Circle) g).radius;
  if (type1 != type2) { return false; }
  if (radius1 != radius2) { return false; }
  return this.centerGeometry.equals(((Circle) g).centerGeometry);
}
origin: BaseXdb/basex

 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return new QNm(GML, checkGeo(0, qc).getGeometryType(), URI);
 }
}
origin: org.datasyslab/geospark

@Override
public boolean equalsExact(Geometry g, double tolerance)
{
  String type1 = this.getGeometryType();
  String type2 = ((Geometry) g).getGeometryType();
  double radius1 = this.radius;
  double radius2 = ((Circle) g).radius;
  if (type1 != type2) { return false; }
  if (radius1 != radius2) { return false; }
  return this.centerGeometry.equals(((Circle) g).centerGeometry);
}
com.vividsolutions.jts.geomGeometrygetGeometryType

Javadoc

Returns the name of this Geometry's actual class.

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

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Notification (javax.management)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Vim 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