本文整理汇总了Java中org.geotools.filter.identity.FeatureIdImpl类的典型用法代码示例。如果您正苦于以下问题:Java FeatureIdImpl类的具体用法?Java FeatureIdImpl怎么用?Java FeatureIdImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FeatureIdImpl类属于org.geotools.filter.identity包,在下文中一共展示了FeatureIdImpl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
public void execute(Tuple tuple) {
final String[] attributes = tuple.getValue(0).toString().split(",");
// Only ingest attributes that have a latitude and longitude
if (attributes.length == 2 && attributes[LATITUDE_COL_IDX] != null && attributes[LONGITUDE_COL_IDX] != null) {
featureBuilder.reset();
final SimpleFeature simpleFeature = featureBuilder.buildFeature(String.valueOf(UUID.randomUUID().getMostSignificantBits()));
simpleFeature.setDefaultGeometry(getGeometry(attributes));
try {
final SimpleFeature next = featureWriter.next();
for (int i = 0; i < simpleFeature.getAttributeCount(); i++) {
next.setAttribute(i, simpleFeature.getAttribute(i));
}
((FeatureIdImpl)next.getIdentifier()).setID(simpleFeature.getID());
featureWriter.write();
} catch (IOException e) {
log.error("Exception writing feature", e);
}
}
}
示例2: startElement
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (qName.indexOf(":") > 0) {
qName = qName.substring(qName.indexOf(":") + 1);
}
buffer.setLength(0);
switch (qName) {
case "LinearRing":
linRingCount++;
break;
case "MaskFeature":
String id = attributes.getValue("gml:id");
currentFeatureId = new FeatureIdImpl(id);
currentFeaturePoligons.clear();
break;
case "posList":
String dimStr = attributes.getValue("srsDimension");
try {
dimensions = Integer.parseInt(dimStr);
} catch (Exception e) {
dimensions = 2;
}
break;
}
}
示例3: setUp
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// Draw a "Z"
path = new Path2D.Double();
path.moveTo(0, 0);
path.lineTo(3, 0);
path.lineTo(0, 3);
path.lineTo(3, 3);
product = new Product("p", "t", 4, 4);
band = product.addBand("b", "4 * (Y-0.5) + (X-0.5) + 0.1");
dataSourceConfig = new ProfilePlotPanel.DataSourceConfig();
SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder();
ftb.setName("ft");
ftb.add("lat", Double.class);
ftb.add("lon", Double.class);
ftb.add("data", Double.class);
SimpleFeatureType ft = ftb.buildFeatureType();
DefaultFeatureCollection fc = new DefaultFeatureCollection("id", ft);
fc.add(new SimpleFeatureImpl(new Object[]{0, 0, 0.3}, ft, new FeatureIdImpl("id1"), false));
fc.add(new SimpleFeatureImpl(new Object[]{0, 0, 0.5}, ft, new FeatureIdImpl("id2"), false));
fc.add(new SimpleFeatureImpl(new Object[]{0, 0, 0.7}, ft, new FeatureIdImpl("id3"), false));
fc.add(new SimpleFeatureImpl(new Object[]{0, 0, 0.1}, ft, new FeatureIdImpl("id4"), false));
dataSourceConfig.pointDataSource = new VectorDataNode("vd", fc);
dataSourceConfig.dataField = ft.getDescriptor("data");
dataSourceConfig.boxSize = 1;
dataSourceConfig.computeInBetweenPoints = true;
}
示例4: changeSomeFids
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
private void changeSomeFids() {
for (int i = 0; i < 10; i++) {
int f = i+1;
FeatureAccessor accessor = m_features.get(new FeatureIdImpl("states." + f));
Feature feature = accessor.getFeature();
feature.getProperty("STATE_NAME").setValue("Changed." + i);
}
}
示例5: tesFid
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
@Test
public void tesFid() {
final FilterFactoryImpl factory = new FilterFactoryImpl();
final Id f = factory.id(new FeatureIdImpl(
"123-abc"));
final String ss = ECQL.toCQL(f);
System.out.println(ss);
assertTrue(ss.contains("'123-abc'"));
}
示例6: createFidFilter
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
@Override
public Filter createFidFilter(String[] featureIDs) {
HashSet<Identifier> ids = new HashSet<Identifier>();
for (String id : featureIDs) {
ids.add(new FeatureIdImpl(id));
}
return FF.id(ids);
}
示例7: check
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
private void check(Map<Identifier, FeatureAccessor> clientMap, int expected, String fid) {
assertEquals(expected, byFid(clientMap, new FeatureIdImpl(fid)).getProperty("classification").getValue());
}
示例8: WrappedFeature
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
public WrappedFeature(SimpleFeatureType featureType) {
super(new Object[featureType.getAttributeCount()], featureType, new FeatureIdImpl(""), false);
}
示例9: setId
import org.geotools.filter.identity.FeatureIdImpl; //导入依赖的package包/类
public void setId(String fid) {
((FeatureIdImpl) id).setID(fid);
}