Package com.vividsolutions.jts.geom

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


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


      throw new IllegalStateException( "The shape has not been set into the generator." );
   
    // TODO The Geometry#intersection method can cause a single intersection to be split into several line strings.
    //      We need to patch together any lines that have been split.
    //      See LimbGeneratorTest#testVariousProcessorsAndRefiners
    return bounds.intersection( feature );
  }
 
}
View Full Code Here

                                SimpleFeature second = iterator.next();
                                if (currentGeom.getEnvelope().intersects(
                                        ((Geometry) second.getDefaultGeometry()))) {
                                    // compute geometry
                                    if (intersectionMode == IntersectionMode.INTERSECTION) {
                                        attribute = currentGeom.intersection((Geometry) second
                                                .getDefaultGeometry());

                                        GeometryFilterImpl filter = new GeometryFilterImpl(geomType
                                                .getType().getBinding());
                                        ((Geometry) attribute).apply(filter);
View Full Code Here

            Geometry geometry = (Geometry) literal;
            if (!WORLD.contains(geometry.getEnvelopeInternal()) && !WORLD.equals(geometry.getEnvelopeInternal())) {
                if(LOGGER.isLoggable(Level.FINE)){
                    LOGGER.fine("SOLR cannot deal with filters using geometries that span beyond the whole world, clip feature geometry to world");
                }
                geometry = geometry.intersection(JTS.toGeometry(WORLD));
            }
            //Splits segments exceeds the 180 degrees longitude limit to conforms to SOLR WKT manager specification
            //Using JTS Densify, all segments exceeds the 180 degrees length will be densified, not only the one exceeds it in longitude!
            Envelope env = geometry.getEnvelopeInternal();
            if(env.getWidth() > SOLR_DISTANCE_TOLERANCE){
View Full Code Here

    }

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

        return _this.intersection(arg1);
    }

    static public Geometry union(Geometry arg0, Geometry arg1) {
        Geometry _this = arg0;
View Full Code Here

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

           return _this.intersection(arg1);
     }

     static public Geometry union(Geometry arg0,Geometry arg1)
     {
           if (arg0 == null || arg1 == null) return null;
View Full Code Here

            Geometry g = geometry.evaluate(null, Geometry.class);
            if(g != null) {
                Envelope env = g.getEnvelopeInternal();
                // first, limit to world
                if(!WORLD.contains(env)) {
                    g = sanitizePolygons(g.intersection(JTS.toGeometry(WORLD)));
                }
               
                // second, postgis will always use the shortest distance between two
                // points, if an arc is longer than 180 degrees the opposite will
                // be used instead, so we have to slice the geometry in parts
View Full Code Here

    private static List<Geometry> intersection(GeometryCollection gc, Geometry g) {
        List<Geometry> ret = new ArrayList<Geometry>();
        final int size=gc.getNumGeometries();
        for (int i = 0; i < size; i++) {
            Geometry g1 = (Geometry)gc.getGeometryN(i);
            collect(g1.intersection(g), ret);
        }
        return ret;
    }

    /**
 
View Full Code Here

                            while (iterator.hasNext()) {
                                added = false;
                                SimpleFeature second = iterator.next();
                                if (currentGeom.getEnvelope().intersects(
                                        ((Geometry) second.getDefaultGeometry()))) {
                                    attribute = currentGeom.intersection((Geometry) second
                                            .getDefaultGeometry());
                                    if (((Geometry) attribute).getNumGeometries() > 0) {
                                        fb.add(attribute);

                                        // add first feature's attributes
View Full Code Here

      final Geometry[] shapes ) {
    if (noDataSummary.indices.size() > MAX_LIST_NO_DATA) {
      Geometry finalShape = shapes[0];
      if (shapes.length > 1) {
        for (int i = 1; i < shapes.length; i++) {
          finalShape = finalShape.intersection(shapes[i]);
        }
      }
      return new NoDataByFilter(
          finalShape,
          noDataSummary.usedNoDataValues);
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.