Java 类com.vividsolutions.jts.geom.GeometryComponentFilter 实例源码

项目:Earth    文件:FacetSequenceTreeBuilder.java   
/**
 * Creates facet sequences
 *
 * @param g
 * @return List<GeometryFacetSequence>
 */
private static List computeFacetSequences(Geometry g) {
    final List sections = new ArrayList();

    g.apply((GeometryComponentFilter) geom -> {
        CoordinateSequence seq = null;
        if (geom instanceof LineString) {
            seq = ((LineString) geom).getCoordinateSequence();
            addFacetSequences(seq, sections);
        } else if (geom instanceof Point) {
            seq = ((Point) geom).getCoordinateSequence();
            addFacetSequences(seq, sections);
        }
    });
    return sections;
}
项目:elasticgeo    文件:FilterToElasticHelper.java   
protected Literal clipToWorld(Literal geometry) {
    if(geometry != null) {
        Geometry g = geometry.evaluate(null, Geometry.class);
        if(g != null) {
            g.apply(new GeometryComponentFilter() {
                @Override
                public void filter(Geometry geom) {
                    geom.apply(new CoordinateFilter() {
                        @Override
                        public void filter(Coordinate coord) {
                            coord.setCoordinate(new Coordinate(clipLon(coord.x),clipLat(coord.y)));
                        }
                    });
                }
            });
            geometry = CommonFactoryFinder.getFilterFactory(null).literal(g);

        }
    }

    return geometry;
}
项目:geodroid_master_update    文件:FacetSequenceTreeBuilder.java   
/**
 * Creates facet sequences
 * 
 * @param g
 * @return List<GeometryFacetSequence>
 */
private static List computeFacetSequences(Geometry g) {
  final List sections = new ArrayList();

  g.apply(new GeometryComponentFilter() {

    public void filter(Geometry geom) {
      CoordinateSequence seq = null;
      if (geom instanceof LineString) {
        seq = ((LineString) geom).getCoordinateSequence();
        addFacetSequences(seq, sections);
      }
      else if (geom instanceof Point) {
        seq = ((Point) geom).getCoordinateSequence();
        addFacetSequences(seq, sections);
      }
    }
  });
  return sections;
}
项目:gt-jdbc-monetdb    文件:FilterToSqlHelper.java   
/**
 * Given a geometry that might contain heterogeneous components extracts only the polygonal ones
 * @param geometry
 * @return
 */
private Geometry sanitizePolygons(Geometry geometry) {
    // already sane?
    if(geometry == null || geometry instanceof Polygon || geometry instanceof MultiPolygon) {
        return geometry;
    }

    // filter out only polygonal parts
    final List<Polygon> polygons = new ArrayList<Polygon>(); 
    geometry.apply(new GeometryComponentFilter() {

        public void filter(Geometry geom) {
            if(geom instanceof Polygon) {
                polygons.add((Polygon) geom);
            }
        }
    });

    // turn filtered selection into a geometry
    return toPolygon(geometry.getFactory(), polygons);
}
项目:terraingis    文件:FacetSequenceTreeBuilder.java   
/**
 * Creates facet sequences
 * 
 * @param g
 * @return List<GeometryFacetSequence>
 */
private static List computeFacetSequences(Geometry g) {
  final List sections = new ArrayList();

  g.apply(new GeometryComponentFilter() {

    public void filter(Geometry geom) {
      CoordinateSequence seq = null;
      if (geom instanceof LineString) {
        seq = ((LineString) geom).getCoordinateSequence();
        addFacetSequences(seq, sections);
      }
      else if (geom instanceof Point) {
        seq = ((Point) geom).getCoordinateSequence();
        addFacetSequences(seq, sections);
      }
    }
  });
  return sections;
}
项目:sumo    文件:ClipProcess.java   
public LinearElevationInterpolator(Geometry original, CoordinateReferenceSystem crs) {
    originalLines = new ArrayList<LineString>();
    original.apply(new GeometryComponentFilter() {

        @Override
        public void filter(Geometry geom) {
            if(geom instanceof LineString) {
                originalLines.add((LineString) geom);
            }
        }
    });
}
项目:Earth    文件:LineMerger.java   
/**
 * Adds a Geometry to be processed. May be called multiple times.
 * Any dimension of Geometry may be added; the constituent linework will be
 * extracted.
 *
 * @param geometry geometry to be line-merged
 */
public void add(Geometry geometry) {
    geometry.apply((GeometryComponentFilter) component -> {
        if (component instanceof LineString) {
            add((LineString) component);
        }
    });
}
项目:jts    文件:LineMerger.java   
/**
 * Adds a Geometry to be processed. May be called multiple times.
 * Any dimension of Geometry may be added; the constituent linework will be
 * extracted.
 *
 * @param geometry geometry to be line-merged
 */
public void add(Geometry geometry) {
    geometry.apply(new GeometryComponentFilter() {
        public void filter(Geometry component) {
            if (component instanceof LineString) {
                add((LineString) component);
            }
        }
    });
}
项目:jts    文件:EdgeGraphBuilder.java   
/**
 * Adds the edges of a Geometry to the graph.
 * May be called multiple times.
 * Any dimension of Geometry may be added; the constituent edges are
 * extracted.
 *
 * @param geometry geometry to be added
 */
public void add(Geometry geometry) {
    geometry.apply(new GeometryComponentFilter() {
        public void filter(Geometry component) {
            if (component instanceof LineString) {
                add((LineString) component);
            }
        }
    });
}
项目:geodroid_master_update    文件:LineMerger.java   
/**
 * Adds a Geometry to be processed. May be called multiple times.
 * Any dimension of Geometry may be added; the constituent linework will be
 * extracted.
 * 
 * @param geometry geometry to be line-merged
 */  
public void add(Geometry geometry) {
  geometry.apply(new GeometryComponentFilter() {
    public void filter(Geometry component) {
      if (component instanceof LineString) {
        add((LineString)component);
      }
    }      
  });
}
项目:terraingis    文件:LineMerger.java   
/**
 * Adds a Geometry to be processed. May be called multiple times.
 * Any dimension of Geometry may be added; the constituent linework will be
 * extracted.
 * 
 * @param geometry geometry to be line-merged
 */  
public void add(Geometry geometry) {
  geometry.apply(new GeometryComponentFilter() {
    public void filter(Geometry component) {
      if (component instanceof LineString) {
        add((LineString)component);
      }
    }      
  });
}
项目:gama    文件:DynamicLineString.java   
@Override
public void apply(final GeometryComponentFilter filter) {
    filter.filter(this);
}
项目:GeoSpark    文件:Circle.java   
@Override
public void apply(GeometryComponentFilter filter) {
    // Do nothing. This circle is not expected to be a complete geometry.
}
项目:Earth    文件:LineSequencer.java   
/**
 * Adds a {@link Geometry} to be sequenced.
 * May be called multiple times.
 * Any dimension of Geometry may be added; the constituent linework will be
 * extracted.
 *
 * @param geometry the geometry to add
 */
public void add(Geometry geometry) {
    geometry.apply((GeometryComponentFilter) component -> {
        if (component instanceof LineString) {
            addLine((LineString) component);
        }
    });
}