Codota Logo
Geometry.isValid
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain Geometry
private void myMethod () {
Geometry g =
  • Codota IconGeometryCollection gc;gc.getGeometryN(n)
  • Codota IconSimpleFeature feature;(Geometry) feature.getDefaultGeometry()
  • Codota IconString wellKnownText;new WKTReader().read(wellKnownText)
  • Smart code suggestions by Codota
}
origin: com.vividsolutions/jts

 private void checkValid(Geometry g)
 {
   if (! g.isValid()) {
     System.out.println("Snapped geometry is invalid");
   }
 }
}
origin: com.vividsolutions/jts

public Geometry reduce(Geometry geom)
{
 Geometry reducePW = reducePointwise(geom);
 if (isPointwise)
   return reducePW;
 
 //TODO: handle GeometryCollections containing polys
 if (! (reducePW instanceof Polygonal))
   return reducePW;
 
 // Geometry is polygonal - test if topology needs to be fixed
 if (reducePW.isValid()) return reducePW;
 
 // hack to fix topology.  
 // TODO: implement snap-rounding and use that.
 return fixPolygonalTopology(reducePW);
}
origin: com.vividsolutions/jts

Geometry resultEP = cbo.intersection(geom0, geom1);
if (! resultEP.isValid())
 throw originalEx;
return resultEP;
origin: com.vividsolutions/jts

Geometry resultEP = cbo.symDifference(geom0, geom1);
if (! resultEP.isValid())
 throw originalEx;
return resultEP;
origin: com.vividsolutions/jts

Geometry resultEP = cbo.union(geom0, geom1);
if (! resultEP.isValid())
 throw originalEx;
return resultEP;
origin: com.vividsolutions/jts

Geometry resultEP = cbo.difference(geom0, geom1);
if (! resultEP.isValid())
 throw originalEx;
return resultEP;
origin: com.vividsolutions/jts

Geometry resultEP = cbo.buffer(geom, distance);
if (! resultEP.isValid())
 throw originalEx;
return resultEP;
origin: org.geotools/gt2-main

static public boolean isValid(Geometry arg0)
{
   Geometry _this = arg0;
   return _this.isValid();
}
origin: org.geotools/gt-main

static public boolean isValid(Geometry arg0)
{
   if (arg0 == null) return false;
   Geometry _this = arg0;
   return _this.isValid();
}
origin: com.vividsolutions/jts-core

 private void checkValid(Geometry g)
 {
   if (! g.isValid()) {
     System.out.println("Snapped geometry is invalid");
   }
 }
}
origin: org.teiid/teiid-engine

public static Boolean isValid(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  return g.isValid();
}

origin: stackoverflow.com

  if(geom.isValid()){
  return toPolygonGeometry(polygonizer.getPolygons(), geom.getFactory());
}else if(geom instanceof MultiPolygon){
  if(geom.isValid()){
origin: bedatadriven/activityinfo

@Override
public void write(int adminEntityId, Geometry geometry) throws IOException {
  if (!geometry.isValid()) {
    throw new IllegalStateException(adminEntityId + " has invalid geometry");
  }
  dataOut.writeInt(adminEntityId);
  writer.write(geometry, new OutputStreamOutStream(dataOut));
  numFeatures++;
}
origin: com.vividsolutions/jts-core

public Geometry reduce(Geometry geom)
{
 Geometry reducePW = reducePointwise(geom);
 if (isPointwise)
   return reducePW;
 
 //TODO: handle GeometryCollections containing polys
 if (! (reducePW instanceof Polygonal))
   return reducePW;
 
 // Geometry is polygonal - test if topology needs to be fixed
 if (reducePW.isValid()) return reducePW;
 
 // hack to fix topology.  
 // TODO: implement snap-rounding and use that.
 return fixPolygonalTopology(reducePW);
}
origin: aseldawy/pigeon

@Override
public Boolean exec(Tuple input) throws IOException {
 Geometry geom = null;
 try {
  Object v = input.get(0);
  geom = geometryParser.parseGeom(v);
  return geom.isValid();
 } catch (ExecException ee) {
  throw new GeoException(geom, ee);
 }
}
origin: org.orbisgis/mapeditor

public Geometry moveTo(double x, double y)
    throws CannotChangeGeometryException {
    com.vividsolutions.jts.geom.Geometry ret = moveJTSTo(x, y);
    if (!ret.isValid()) {
        throw new CannotChangeGeometryException(I18N.tr("The geometry is not valid"));
    }
    return ret;
}
origin: org.orbisgis/mapeditor

@Override
public Geometry remove() throws TopologyException {
  com.vividsolutions.jts.geom.Geometry ret = removeVertex();
  if (!ret.isValid()) {
    throw new TopologyException(I18N.tr("The geometry is not valid"));
  }
  return ret;
}
origin: org.orbisgis/mapeditor

@Override
public Geometry moveTo(double x, double y)
    throws CannotChangeGeometryException {
  com.vividsolutions.jts.geom.Geometry g = moveJTSTo(x, y);
  if (!g.isValid()) {
    throw new CannotChangeGeometryException(I18N.tr("The geometry is not valid"));
  }
  return g;
}
origin: org.fudaa.framework.ebli/ebli-2d

 public Object getValueAt(final int _rowIndex, final int _columnIndex) {
  if (_columnIndex == 0) {
   return new Integer(_rowIndex + 1);
  } else if (_columnIndex == 1) {
   final Geometry s = (Geometry) ligne_.getGeometry(_rowIndex);
   return new Integer(s.getNumPoints());
  } else if (_columnIndex == 2) {
   final Geometry s = (Geometry) ligne_.getGeometry(_rowIndex);
   return s.isValid() ? valide_ : nonValide_;
  }
  return ligne_.getModel(att_[_columnIndex - 3]).getObjectValueAt(_rowIndex);
 }
}
origin: org.orbisgis/mapeditor

@Override
public void drawIn_Point(Graphics g, MapContext vc, ToolManager tm)
    throws DrawingException {
  Geometry geom = getCurrentPolygon(vc, tm);
  if (geom != null) {
    tm.addGeomToDraw(geom);
    if (!geom.isValid()) {
      throw new DrawingException(
          i18n.tr("Invalid polygon"));
    }
  }
}
com.vividsolutions.jts.geomGeometryisValid

Javadoc

Tests whether this Geometry is topologically valid, according to the OGC SFS specification.

For validity rules see the Javadoc for the specific Geometry subclass.

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

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • putExtra (Intent)
  • findViewById (Activity)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now