Tabnine Logo
Geometry.isValid
Code IndexAdd Tabnine 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)

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

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Reference (javax.naming)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top 17 PhpStorm Plugins
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