Package org.opengis.feature.simple

Examples of org.opengis.feature.simple.SimpleFeatureType


    protected FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatures() throws IOException {
        return getFeatureStore().getFeatures();
    }

    public void modifyIssue( final IIssue issue ) throws IOException {
          SimpleFeatureType schema = getFeatureStore().getSchema();
          AttributeDescriptor[] attributeType=new AttributeDescriptor[9];
          Object[] newValues=new Object[9];
         
          attributeType[0]=schema.getDescriptor(getAttributeMapper().getBounds());
          attributeType[1]=schema.getDescriptor(getAttributeMapper().getDescription());
          attributeType[2]=schema.getDescriptor(getAttributeMapper().getExtensionId());
          attributeType[3]=schema.getDescriptor(getAttributeMapper().getGroupId());
          attributeType[4]=schema.getDescriptor(getAttributeMapper().getId());
          attributeType[5]=schema.getDescriptor(getAttributeMapper().getMemento());
          attributeType[6]=schema.getDescriptor(getAttributeMapper().getPriority());
          attributeType[7]=schema.getDescriptor(getAttributeMapper().getResolution());
          attributeType[8]=schema.getDescriptor(getAttributeMapper().getViewMemento());
         
          XMLMemento memento=XMLMemento.createWriteRoot("memento"); //$NON-NLS-1$
          XMLMemento viewMemento=XMLMemento.createWriteRoot("viewMemento"); //$NON-NLS-1$
         
          issue.save(memento);
View Full Code Here


public void op(Display display, Object target, IProgressMonitor monitor)
        throws Exception {
  FeatureSource<SimpleFeatureType, SimpleFeature> source =
    (FeatureSource<SimpleFeatureType, SimpleFeature>) target;
 
    SimpleFeatureType featureType = source.getSchema();
    GeometryDescriptor geometryType = featureType.getGeometryDescriptor();
    CoordinateReferenceSystem crs = geometryType.getCoordinateReferenceSystem();   
   
    String typeName = featureType.getTypeName();   
   
    // String filename = promptSaveDialog( typeName )
    String filename = typeName.replace(':', '_');   
    URL directory = FileLocator.toFileURL( Platform.getInstanceLocation().getURL() );
    URL shpURL = new URL(directory.toExternalForm() + filename + ".shp");
View Full Code Here

        }
        //find the layer that matches the typeRef
        for (int j = 0; j < layers.length; j++) {
          ILayer thisLayer = layers[j];
          //make the typeRef
          SimpleFeatureType schema = thisLayer.getSchema();
          if(schema == null)
            continue;
         
          String dataStoreID = schema.getName().getNamespaceURI();
          String thisTypeRef = dataStoreID+":"+schema.getName().getLocalPart(); //$NON-NLS-1$
          //if the typeRefs match, add the layer to our set
          if (thisTypeRef.equals(typeRef)) {
            relevantLayers.add(thisLayer);
            break;
          }
        }
      }
     
      //for each relevant layer
      for (Iterator k = relevantLayers.iterator(); k.hasNext();) {
                ILayer thisLayer = (ILayer) k.next();
        //get the SimpleFeatureType
        SimpleFeatureType type = thisLayer.getSchema();
        //create a FeatureReader (collection.reader)
        FeatureSource<SimpleFeatureType, SimpleFeature> source;
        source = thisLayer.getResource(FeatureSource.class, monitor);
                FeatureCollection<SimpleFeatureType, SimpleFeature> collection = source.getFeatures();
                //hmm... pretty pictures or efficiency?
View Full Code Here

        });
       
        final FeatureValidation featureValidation = getValidator();
        if (featureValidation == null) return;
        //IsValidGeometryValidation geometryValidation = new IsValidGeometryValidation();
        SimpleFeatureType type;
       
        // iterate through the collection and validate each feature
        FeatureIterator<SimpleFeature> iterator = collection.features();
        while( iterator.hasNext()){
           
View Full Code Here

        }
        return bounds;
    }

  public CoordinateReferenceSystem getCRS() {
    SimpleFeatureType ft = getFeatureType();
    if (ft == null) {
      return DefaultGeographicCRS.WGS84;
    }
    return ft.getCoordinateReferenceSystem();
  }
View Full Code Here

  public String getName() {
    return owner.typename;
  }

  public URI getSchema() {
    SimpleFeatureType ft = getFeatureType();
    if (ft == null)
      return null;

    try {
      Name typeName = ft.getName();
      if (typeName.getNamespaceURI() != null) {
        return new URI(ft.getName().getNamespaceURI());
      } else {
        return null; // should probably be GML?
      }
    } catch (URISyntaxException e) {
      return null;
View Full Code Here

     */
    @Test
    public void testRun() throws Exception {
        Map map = MapTests.createDefaultMap("test", 2, true, new Dimension(10,10)); //$NON-NLS-1$
        Layer layer = map.getLayersInternal().get(0);
        SimpleFeatureType schema = layer.getSchema();
    SimpleFeature feature = SimpleFeatureBuilder.build(schema, new Object[]{null,null}, "id");
       
        AddFeatureCommand command=new AddFeatureCommand(feature, layer);
       
        command.setMap(map);
View Full Code Here

        return viewid;
    }

    public String getProblemObject() {
      SimpleFeature feature = getFeature();
      SimpleFeatureType featureType = feature.getFeatureType();
      String text = null;
      text = getAttribute(feature, featureType, Messages.FeatureIssue_attributeName);
    if( text==null ){
      text = getAttribute(feature, featureType, Messages.FeatureIssue_idAttempt1);
    }
View Full Code Here

        }
       
        class NameListener implements KeyListener, FocusListener {

            public void keyPressed( KeyEvent e ) {
                SimpleFeatureType ft = (SimpleFeatureType) viewer.getInput();
                if (e.character == SWT.ESC) {
                    nameText.setText(ft.getTypeName());
                } else
                if (e.character == SWT.Selection) {
                    SimpleFeatureTypeBuilder ftB = new SimpleFeatureTypeBuilder();
                    ftB.init(ft);
                    ftB.setName(nameText.getText());
View Full Code Here

                    transferData);

            WKTReader reader = new WKTReader();
            try {
                Geometry read = reader.read(string);
                SimpleFeatureType ft=DataUtilities.createType("Temp Type", "*geom:"+read.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
               
                return SimpleFeatureBuilder.build( ft, new Object[]{read}, null );
            } catch (Exception e) {
                UiPlugin.log("", e); //$NON-NLS-1$
            }
View Full Code Here

TOP

Related Classes of org.opengis.feature.simple.SimpleFeatureType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.