热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.geotools.feature.FeatureCollection.add()方法的使用及代码示例

本文整理了Java中org.geotools.feature.FeatureCollection.add()方法的一些代码示例,展示了FeatureColl

本文整理了Java中org.geotools.feature.FeatureCollection.add()方法的一些代码示例,展示了FeatureCollection.add()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FeatureCollection.add()方法的具体详情如下:
包路径:org.geotools.feature.FeatureCollection
类名称:FeatureCollection
方法名:add

FeatureCollection.add介绍

[英]Adds a listener for collection events.

When this collection is backed by live data the event notification will follow the guidelines outlined by FeatureListner.
[中]为集合事件添加侦听器。
当此集合由实时数据支持时,事件通知将遵循FeatureListner概述的准则。

代码示例

代码示例来源:origin: org.geotools/gt2-main

/**
* Receives an OGC feature and adds it into the collection
*
* @param feature the OGC feature
*/
public void feature(Feature feature) {
featureCollection.add(feature);
}
}

代码示例来源:origin: org.geotools/gt2-main

public boolean contains(Object o) {
// must back project any geometry attributes
return delegate.add(o);
}

代码示例来源:origin: org.geotools/gt-main

public boolean add(SimpleFeature feature) {
return collection.add(feature);
}

代码示例来源:origin: org.geotools/gt2-main

public boolean contains(Object o) {
return delegate.add( o );
}

代码示例来源:origin: org.geotools/gt2-main

public boolean contains(Object o) {
return delegate.add( o );
}

代码示例来源:origin: org.geotools/gt-main

public boolean add(F o) {
return delegate.add(o);
}

代码示例来源:origin: org.geotools/gt-main

public boolean add(F o) {
if ( !filter.evaluate( o ) ) {
return false;
}

return delegate.add( o );
}

代码示例来源:origin: org.geotools/gt-main

public boolean add(F o) {
long size = delegate.size();
if ( size return delegate.add( o );
}

return false;
}

代码示例来源:origin: org.geotools/gt2-main

public boolean add(Object o) {
if ( !filter.evaluate( o ) ) {
return false;
}

return delegate.add( o );
}

代码示例来源:origin: bcdev/beam

private void extract(Object[] input) {
if (input.length == 2 && (input[0] instanceof SimpleFeatureType && input[1] instanceof FeatureCollection)) {
this.featureType = (SimpleFeatureType) input[0];
this.featureCollection = (FeatureCollection) input[1];
} else if (input.length >= 2 && input[0] instanceof SimpleFeatureType) {
this.featureType = (SimpleFeatureType) input[0];
this.featureCollection = new ListFeatureCollection(featureType);
for (int i = 1; i featureCollection.add((SimpleFeature) input[i]);
}
}
}

代码示例来源:origin: org.geotools/gt2-main

public boolean add(Object o) {
long size = delegate.size();
if ( size return delegate.add( o );
}

return false;
}

代码示例来源:origin: org.geotools/gt2-render

/**
* @see org.geotools.data.FeatureResults#collection()
*/
public FeatureCollection collection() throws IOException {
FeatureCollection fc = FeatureCollections.newCollection();
List results = index.query(bounds);
for (Iterator it = results.iterator(); it.hasNext();) {
fc.add(it.next());
}
return fc;
}

代码示例来源:origin: bcdev/beam

private void addToVectorData(final Placemark placemark) {
synchronized (vectorDataNode) {
if (!vectorDataNode.getFeatureCollection().contains(placemark.getFeature())) {
vectorDataNode.getFeatureCollection().add(placemark.getFeature());
}
}
}

代码示例来源:origin: bcdev/beam

@Test
public void testMaskIsNotAddedWhenFeatureIsAddedForTheSecondTime() throws Exception {
final Product p = new Product("P", "T", 1, 1);
final SimpleFeatureType featureType = new GeometryDescriptor().getBaseFeatureType();
final VectorDataNode node = new VectorDataNode("V", featureType);
p.getVectorDataGroup().add(node);
node.getFeatureCollection().add(new SimpleFeatureBuilder(featureType).buildFeature("id1"));
node.getFeatureCollection().add(new SimpleFeatureBuilder(featureType).buildFeature("id2"));
assertEquals(1, p.getMaskGroup().getNodeCount());
assertNotNull(p.getMaskGroup().get("V"));
}

代码示例来源:origin: bcdev/beam

@Test
public void testMaskIsRemovedWhenAllFeaturesAreRemoved() throws Exception {
final Product p = new Product("P", "T", 1, 1);
final SimpleFeatureType featureType = new GeometryDescriptor().getBaseFeatureType();
final VectorDataNode node = new VectorDataNode("V", featureType);
p.getVectorDataGroup().add(node);
node.getFeatureCollection().add(new SimpleFeatureBuilder(featureType).buildFeature("id1"));
node.getFeatureCollection().add(new SimpleFeatureBuilder(featureType).buildFeature("id2"));
node.getFeatureCollection().clear();
assertEquals(0, p.getMaskGroup().getNodeCount());
}

代码示例来源:origin: bcdev/beam

@Test
public void testMaskIsAddedWhenFeatureIsAddedForTheFirstTime() throws Exception {
final Product p = new Product("P", "T", 1, 1);
final SimpleFeatureType featureType = new GeometryDescriptor().getBaseFeatureType();
final VectorDataNode node = new VectorDataNode("V", featureType);
p.getVectorDataGroup().add(node);
node.getFeatureCollection().add(new SimpleFeatureBuilder(featureType).buildFeature("id"));
assertEquals(1, p.getMaskGroup().getNodeCount());
assertNotNull(p.getMaskGroup().get("V"));
}

代码示例来源:origin: bcdev/beam

@Test
public void testMaskIsAddedWhenNonEmptyVdnIsAdded() throws Exception {
final Product p = new Product("P", "T", 1, 1);
final SimpleFeatureType featureType = new GeometryDescriptor().getBaseFeatureType();
final VectorDataNode node = new VectorDataNode("V", featureType);
node.getFeatureCollection().add(new SimpleFeatureBuilder(featureType).buildFeature("id"));
p.getVectorDataGroup().add(node);
assertEquals(1, p.getMaskGroup().getNodeCount());
assertNotNull(p.getMaskGroup().get("V"));
}

代码示例来源:origin: bcdev/beam

@Test
public void testMaskIsRemovedWhenVdnIsRemoved() throws Exception {
final Product p = new Product("P", "T", 1, 1);
final SimpleFeatureType featureType = new GeometryDescriptor().getBaseFeatureType();
final VectorDataNode node = new VectorDataNode("V", featureType);
p.getVectorDataGroup().add(node);
node.getFeatureCollection().add(new SimpleFeatureBuilder(featureType).buildFeature("id1"));
assertEquals(1, p.getMaskGroup().getNodeCount());
p.getVectorDataGroup().remove(node);
assertEquals(0, p.getMaskGroup().getNodeCount());
}
}

代码示例来源:origin: bcdev/beam

@Test
public void imageIsUpdated() {
assertTrue(0 == image.getImage(0).getData().getSample(0, 0, 0));
assertTrue(0 == image.getImage(0).getData().getSample(5, 5, 0));
pyramids.getFeatureCollection().add(
createFeature("Cheops", new Rectangle2D.Double(2.0, 2.0, 7.0, 7.0)));
assertTrue(0 == image.getImage(0).getData().getSample(0, 0, 0));
assertTrue(0 != image.getImage(0).getData().getSample(5, 5, 0));
}

代码示例来源:origin: bcdev/beam

@Test
public void testVectorDataNodeAndPlacemarkGroup() {
Product p = new Product("p", "pt", 512, 512);
ProductNodeGroup vectorDataGroup = p.getVectorDataGroup();
Placemark placemark = Placemark.createPointPlacemark(PointDescriptor.getInstance(), "placemark_1", null, null,
new PixelPos(10, 10), null, null);
VectorDataNode vectorDataNode = new VectorDataNode("Features", Placemark.createPointFeatureType("feature"));
FeatureCollection featureCollection = vectorDataNode.getFeatureCollection();
vectorDataGroup.add(vectorDataNode); //Also: Sets the owner of the vectorDataNode
vectorDataNode.getPlacemarkGroup(); //Also: Creates the PlacemarkGroup (owner has to be set!)
featureCollection.add(placemark.getFeature());
assertEquals(1, vectorDataNode.getFeatureCollection().size());
assertEquals(vectorDataNode.getFeatureCollection().size(), vectorDataNode.getPlacemarkGroup().getNodeCount());
}

推荐阅读
author-avatar
风信子的春天R
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有