private void checkValid(Geometry g) { if (! g.isValid()) { System.out.println("Snapped geometry is invalid"); } } }
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); }
Geometry resultEP = cbo.intersection(geom0, geom1); if (! resultEP.isValid()) throw originalEx; return resultEP;
Geometry resultEP = cbo.symDifference(geom0, geom1); if (! resultEP.isValid()) throw originalEx; return resultEP;
Geometry resultEP = cbo.union(geom0, geom1); if (! resultEP.isValid()) throw originalEx; return resultEP;
Geometry resultEP = cbo.difference(geom0, geom1); if (! resultEP.isValid()) throw originalEx; return resultEP;
Geometry resultEP = cbo.buffer(geom, distance); if (! resultEP.isValid()) throw originalEx; return resultEP;
static public boolean isValid(Geometry arg0) { Geometry _this = arg0; return _this.isValid(); }
static public boolean isValid(Geometry arg0) { if (arg0 == null) return false; Geometry _this = arg0; return _this.isValid(); }
private void checkValid(Geometry g) { if (! g.isValid()) { System.out.println("Snapped geometry is invalid"); } } }
public static Boolean isValid(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); return g.isValid(); }
@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++; }
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); }
@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); } }
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; }
@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; }
@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; }
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); } }
@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")); } } }