Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Geometry.intersects()


    System.out.println( "Intersects on polygon: " + (endTime - startTime) + " ms" );
   
    startTime = System.currentTimeMillis();
    for (int i=0; i<REPEAT_COUNT; i++)
    {
      boundingBox.intersects( this.complexPolygon );
    }
    endTime = System.currentTimeMillis();
    System.out.println( "Intersects on bounding box: " + (endTime - startTime) + " ms" );
  }
 
View Full Code Here


                                    break;
                                case SpatialOperator.DISJOINT:
                                    geometryMatches = geometry.disjoint(EPSG4326_geometry);
                                    break;
                                case SpatialOperator.INTERSECTS:
                                    geometryMatches = geometry.intersects(EPSG4326_geometry);
                                    break;
                                case SpatialOperator.TOUCHES:
                                    geometryMatches = geometry.touches(EPSG4326_geometry);
                                    break;
                                case SpatialOperator.CROSSES:
View Full Code Here

        } else {
            Coordinate startCoordinate = from.getCoordinate();
            Point startPoint = geometryFactory.createPoint(startCoordinate);
            for (NamedArea area : intersects) {
                Geometry polygon = area.getPolygon();
                if (!polygon.intersects(startPoint))
                    continue;
                Geometry lineParts = line.intersection(polygon);
                if (lineParts.getLength() > 0.000001) {
                    Coordinate edgeCoordinate = null;
                    // this is either a LineString or a MultiLineString (we hope)
View Full Code Here

                Geometry cbTransformed = JTS.transform(conflictBounds, tx2d);
                transformedConflictBounds.add(cbTransformed);
                List results = qt.query(cbTransformed.getEnvelopeInternal());
                for (Iterator it = results.iterator(); it.hasNext();) {
                    Geometry candidate = (Geometry) it.next();
                    if (candidate.intersects(cbTransformed)) {
                        // location conflict
                        conflict = true;
                        break;
                    }
                }
View Full Code Here

            // load raster data
            //
            // create a granuleDescriptor loader
            final Geometry bb = JTS.toGeometry((BoundingBox) mosaicBBox);
            final Geometry inclusionGeometry = granuleDescriptor.getFootprint();
            if (!footprintBehavior.handleFootprints() || inclusionGeometry == null || (footprintBehavior.handleFootprints() && inclusionGeometry.intersects(bb))) {

                // find the right filter for this granule
                boolean found = false;
                for (GranuleCollector collector : granuleCollectors) {
                    if (collector.accept(granuleDescriptor)) {
View Full Code Here

     */
    protected void processFeature(SimpleFeature feature, Object attribute) throws Exception {

        Geometry geometry = (Geometry) feature.getDefaultGeometry();

        if (geometry.intersects(extentGeometry)) {

            Number value = getFeatureValue(feature, attribute);
            switch (transferType) {
                case FLOAT:
                    if (minAttValue == null) {
View Full Code Here

            @Override
            public boolean isSatisfied(Object object) {
                if (object instanceof Geometry) {
                    Geometry geom = (Geometry) object;
                    if (swapped) {
                        return geom.intersects(value);
                    }
                    return value.intersects(geom);
                }
                return false;
            }
View Full Code Here

    }

    static public boolean intersects(Geometry arg0, Geometry arg1) {
        Geometry _this = arg0;

        return _this.intersects(arg1);
    }

    static public boolean isValid(Geometry arg0) {
        Geometry _this = arg0;
View Full Code Here

     static public boolean intersects(Geometry arg0,Geometry arg1)
     {
           if (arg0 == null || arg1 == null) return false;
           Geometry _this = arg0;

           return _this.intersects(arg1);
     }

     static public boolean isValid(Geometry arg0)
     {
           if (arg0 == null) return false;
View Full Code Here

     */
    private static boolean intersects(GeometryCollection gc, Geometry g) {
      final int size=gc.getNumGeometries();
        for (int i = 0; i < size; i++) {
            Geometry g1 = (Geometry)gc.getGeometryN(i);
            if( g1.intersects(g) )
                return true;
        }
        return false;
    }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.