本文整理汇总了Java中com.vividsolutions.jts.geom.GeometryComponentFilter类的典型用法代码示例。如果您正苦于以下问题:Java GeometryComponentFilter类的具体用法?Java GeometryComponentFilter怎么用?Java GeometryComponentFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeometryComponentFilter类属于com.vividsolutions.jts.geom包,在下文中一共展示了GeometryComponentFilter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeFacetSequences
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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;
}
示例2: clipToWorld
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
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;
}
示例3: computeFacetSequences
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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;
}
示例4: sanitizePolygons
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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);
}
示例5: LinearElevationInterpolator
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
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);
}
}
});
}
示例6: add
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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);
}
});
}
示例7: add
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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);
}
}
});
}
示例8: add
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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);
}
}
});
}
示例9: add
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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);
}
}
});
}
示例10: apply
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
@Override
public void apply(final GeometryComponentFilter filter) {
filter.filter(this);
}
示例11: apply
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
@Override
public void apply(GeometryComponentFilter filter) {
// Do nothing. This circle is not expected to be a complete geometry.
}
示例12: add
import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
/**
* 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);
}
});
}