Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- import com.vividsolutions.jump.workbench.ui.*;
- import java.util.*;
- // 'EOTR100000_envelop', st_geomfromtext('POLYGON((384000 32000, 384000 384000, 960000 384000, 960000 32000, 384000 32000))',23700);
- // 'EOTR25000_envelop', st_geomfromtext('POLYGON((420000 40000, 420000 368000, 948000 368000, 948000 40000, 420000 40000))',23700);
- //Layer layer = wc.getLayerManager().getLayer("teszt");
- //if (layer == null) { print ("Layer not found"); return; }
- Layer layer;
- Layer[] layers = wc.LayerNamePanel.selectedLayers;
- if (layers.length != 1) {
- wc.workbench.frame.warnUser("Exactly one layer must be selected");
- return;
- }
- layer = layers[0];
- print(layers);
- FeatureSchema schema = layer.getFeatureCollectionWrapper().getFeatureSchema();
- Iterator iter = layer.getFeatureCollectionWrapper().iterator();
- String layerName = "GEOMETRY";
- int layerIndex = schema.getAttributeIndex(layerName);
- while ( iter.hasNext() ) {
- BasicFeature bf = (BasicFeature)iter.next();
- print(bf.getAttribute(layerIndex));
- }
- for (f : layer.featureCollectionWrapper.features) {
- //for (c:f.geometry.getCoordinates()) c.z = Double.NaN;
- print(f.geometry.getEnvelope());
- }
- print("");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement