当前位置: 首页>>代码示例>>Java>>正文


Java GeometryComponentFilter类代码示例

本文整理汇总了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;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:22,代码来源:FacetSequenceTreeBuilder.java

示例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;
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:23,代码来源:FilterToElasticHelper.java

示例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;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:26,代码来源:FacetSequenceTreeBuilder.java

示例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);
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb,代码行数:26,代码来源:FilterToSqlHelper.java

示例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);
            }
        }
    });
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:13,代码来源:ClipProcess.java

示例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);
        }
    });
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:15,代码来源:LineMerger.java

示例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);
            }
        }
    });
}
 
开发者ID:Semantive,项目名称:jts,代码行数:17,代码来源:LineMerger.java

示例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);
            }
        }
    });
}
 
开发者ID:Semantive,项目名称:jts,代码行数:18,代码来源:EdgeGraphBuilder.java

示例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);
      }
    }      
  });
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:17,代码来源:LineMerger.java

示例10: apply

import com.vividsolutions.jts.geom.GeometryComponentFilter; //导入依赖的package包/类
@Override
public void apply(final GeometryComponentFilter filter) {
	filter.filter(this);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:5,代码来源:DynamicLineString.java

示例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.
}
 
开发者ID:DataSystemsLab,项目名称:GeoSpark,代码行数:5,代码来源:Circle.java

示例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);
        }
    });
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:16,代码来源:LineSequencer.java


注:本文中的com.vividsolutions.jts.geom.GeometryComponentFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。