Package org.opengis.feature

Examples of org.opengis.feature.Feature


        assertEquals(1, listener.events.size());
        TransactionEvent event = (TransactionEvent) listener.events.get(0);
        assertEquals(TransactionEventType.PRE_DELETE, event.getType());
        assertEquals(MockData.POINTS, event.getLayerName());
        assertEquals(1, listener.features.size());
        Feature deleted = (Feature) listener.features.get(0);
        assertEquals("t0000", deleted.getProperty("id").getValue());
    }
View Full Code Here


        postAsDOM("wfs", insert);
        assertEquals(2, listener.events.size());
        TransactionEvent firstEvent = (TransactionEvent) listener.events.get(0);
        assertEquals(TransactionEventType.PRE_UPDATE, firstEvent.getType());
        assertEquals(MockData.POLYGONS, firstEvent.getLayerName());
        Feature updatedBefore = (Feature) listener.features.get(0);
        assertEquals("t0002", updatedBefore.getProperty("id").getValue());
       
        TransactionEvent secondEvent = (TransactionEvent) listener.events.get(1);
        assertEquals(TransactionEventType.POST_UPDATE, secondEvent.getType());
        assertEquals(MockData.POLYGONS, secondEvent.getLayerName());
        Feature updatedAfter = (Feature) listener.features.get(1);
        assertEquals("t0003", updatedAfter.getProperty("id").getValue());
       
        assertEquals(2, listener.features.size());
    }
View Full Code Here

        final SimpleFeature sampleFeature;
        if (layer == null) {
            sampleFeature = createSampleFeature();
        } else {
            final Feature temp = createSampleFeature(layer);
            if (!(temp instanceof SimpleFeature)) {
                throw new UnsupportedOperationException("not a SimpleFeature");
            }
            sampleFeature = (SimpleFeature) temp;
        }
View Full Code Here

        assertEquals("EPSG:4269", fti.getSRS());
        assertEquals(ProjectionPolicy.FORCE_DECLARED, fti.getProjectionPolicy());
        FeatureCollection fc = fti.getFeatureSource(null, null).getFeatures();
        assertEquals(CRS.decode("EPSG:4269"), fc.getSchema().getCoordinateReferenceSystem());
        FeatureIterator fi = fc.features();
        Feature f = fi.next();
        fi.close();
        assertEquals(CRS.decode("EPSG:4269"), f.getType().getCoordinateReferenceSystem());
    }
View Full Code Here

        assertEquals("EPSG:3003", fti.getSRS());
        assertEquals(ProjectionPolicy.REPROJECT_TO_DECLARED, fti.getProjectionPolicy());
        FeatureCollection fc = fti.getFeatureSource(null, null).getFeatures();
        assertEquals(CRS.decode("EPSG:3003"), fc.getSchema().getCoordinateReferenceSystem());
        FeatureIterator fi = fc.features();
        Feature f = fi.next();
        fi.close();
        assertEquals(CRS.decode("EPSG:3003"), f.getType().getCoordinateReferenceSystem());
    }
View Full Code Here

        assertEquals("EPSG:3004", fti.getSRS());
        assertEquals(ProjectionPolicy.NONE, fti.getProjectionPolicy());
        FeatureCollection fc = fti.getFeatureSource(null, null).getFeatures();
        assertEquals(CRS.decode("EPSG:32615"), fc.getSchema().getCoordinateReferenceSystem());
        FeatureIterator fi = fc.features();
        Feature f = fi.next();
        fi.close();
        assertEquals(CRS.decode("EPSG:32615"), f.getType().getCoordinateReferenceSystem());
    }
View Full Code Here

  public void setUp() throws Exception
  {
    this.geometryFactory = new GeometryFactory( new PrecisionModel( PrecisionModel.FLOATING ), 27700 );
   
    SimpleFeatureType featureType = new SimpleFeatureTypeImpl( new NameImpl( "test" ), null, null, false, null, null, null );
    Feature feature = new SimpleFeatureImpl( new ArrayList<Object>(), featureType, new FeatureIdImpl( "test" ) );
   
    this.limb = new Limb();
    this.limb.setEdges( new HashSet<Edge>() );
    this.limb.setFeature( feature );
    this.limb.setIntersection( this.geometryFactory.createPoint( new Coordinate( 0, 0 ) ) );
View Full Code Here

   * @param limb the LIMB
   * @return the geometry of the feature being labelled
   */
  public static Geometry getFeatureGeometry( Limb limb )
  {
    Feature feature = limb.getFeature();
    if (feature == null)
      throw new MissingGeometryException( "Limb has no feature." );
   
    GeometryAttribute geomAttribute = feature.getDefaultGeometryProperty();
    if (geomAttribute == null)
      throw new IllegalStateException( "The feature has had the geometry attribute reset/removed." );
   
    Object geometry = geomAttribute.getValue();
    if (geomAttribute == null)
View Full Code Here

   
    List<Limb> limbs = new ArrayList<Limb>();
   
    while (features.hasNext())
    {
      Feature feature = features.next();
     
      // Generate the intersections for this feature.
      Geometry intersections = intersectionGenerator.generateIntersections( feature );
      if (intersections != null)
      {
View Full Code Here

 
 
  /** {@inheritDoc} */
  public void refine( Limb limb, Geometry view, Options options )
  {
    Feature feature = limb.getFeature();
   
    if (feature == null)
      throw new IllegalStateException( "Cannot assign the id when the feature has not been assigned to the LIMB." );
   
   
    Name layerName = feature.getType().getName();
    String layerNamespace = this.catalog.getNamespacePrefix( layerName.getNamespaceURI() );
   
    String layerId;
    if (layerNamespace == null)
    {
      layerId = layerName.getLocalPart();
    }
    else
    {
      layerId = layerNamespace + ":" + layerName.getLocalPart();
    }
   
    limb.setFeatureId( feature.getIdentifier().getID() );
    limb.setLayerId( layerId );
  }
View Full Code Here

TOP

Related Classes of org.opengis.feature.Feature

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.