Package org.opengis.feature.type

Examples of org.opengis.feature.type.GeometryType


                //
          if ( !(att instanceof GeometryDescriptor ) ) {
              LOGGER.warning("Default Geometry "+this.defaultGeometry+" was added as a geoemtry");
            attributeBuilder.init( att );
            attributeBuilder.setCRS(defaultCrs);
            GeometryType type = attributeBuilder.buildGeometryType();
           
            att = attributeBuilder.buildDescriptor(att.getName(),type);
            atts.set( i, att );
          }
          defGeom = (GeometryDescriptor)att;
View Full Code Here


        //look it up from the type
        if (((FeatureType)getType()).getGeometryDescriptor() == null ) {
          return null;
        }
       
        GeometryType geometryType =
           (GeometryType) getType().getGeometryDescriptor().getType();
       
         if (geometryType != null) {
           for (Iterator itr = getValue().iterator(); itr.hasNext();) {
             Property property =  (Property) itr.next();
View Full Code Here

   * <p>
   * This method resets all state after the attribute is built.
   * </p>
   */
  public GeometryType buildGeometryType() {
    GeometryType type = factory.createGeometryType(
      name(), binding, crs, isIdentifiable, isAbstract,
      restrictions(), superType, description());
   
    resetTypeState();
   
View Full Code Here

           
            if( Geometry.class.isAssignableFrom( binding )){
                CoordinateReferenceSystem crs;
                AttributeType originalAttributeType = origional.getType(name);
                if( originalAttributeType != null && originalAttributeType instanceof GeometryType ) {
                    GeometryType geometryType = (GeometryType)originalAttributeType;
                    crs = geometryType.getCoordinateReferenceSystem();
                } else {
                    crs = origional.getCoordinateReferenceSystem();
                }
                build.crs(crs);
                build.add(name, binding);
View Full Code Here

                }
            }

            Class clazz = type(type);
            if (Geometry.class.isAssignableFrom(clazz)) {
                GeometryType at = new GeometryTypeImpl(new NameImpl(name), clazz, crs, false,
                        false, Collections.EMPTY_LIST, null, null);
                return new GeometryDescriptorImpl(at, new NameImpl(name), 0, 1, nillable, null);
            } else {
                AttributeType at = new AttributeTypeImpl(new NameImpl(name), clazz, false, false,
                        Collections.EMPTY_LIST, null, null);
View Full Code Here

        if (!(type instanceof AttributeTypeProxy)
                && (Geometry.class.isAssignableFrom(type.getBinding()) || CurvedGeometry.class
                        .isAssignableFrom(type.getBinding()))) {
            // create geometry descriptor with the simple feature type CRS
            GeometryType geomType = new GeometryTypeImpl(type.getName(), type.getBinding(), crs,
                    type.isIdentified(), type.isAbstract(), type.getRestrictions(),
                    type.getSuper(), type.getDescription());
            descriptor = typeFactory.createGeometryDescriptor(geomType, elemName, minOccurs,
                    maxOccurs, nillable, defaultValue);
        } else {
View Full Code Here

            return false;
        }
        if (!super.equals(other)) {
            return false;
        }
        GeometryType o = (GeometryType) other;
        if (CRS == null) {
            return o.getCoordinateReferenceSystem() == null;
        }
        if (o.getCoordinateReferenceSystem() == null) {
            return false;
        }
        return org.geotools.referencing.CRS.equalsIgnoreMetadata(CRS,
                o.getCoordinateReferenceSystem());
    }
View Full Code Here

        assertEquals(4, features.size());

        SimpleFeature feature;
        Geometry geom;
        Property prop;
        GeometryType geomType;
        SimpleFeatureIterator iterator = features.features();
        while (iterator.hasNext()) {
            feature = iterator.next();
            prop = feature.getProperty("geom");
            assertTrue(prop.getType() instanceof GeometryType);
            geomType = (GeometryType) prop.getType();

            Object val = prop.getValue();
            assertTrue(val != null && val instanceof Geometry);
            geom = (Geometry) val;

            Object userData = geom.getUserData();
            assertTrue(userData != null && userData instanceof CoordinateReferenceSystem);
            // ensure the same CRS is passed on to userData for encoding
            assertEquals(userData, geomType.getCoordinateReferenceSystem());
        }
    }
View Full Code Here

  private static GeometryDescriptor toGeometryAttribute(int shapeType,
      CoordinateReferenceSystem crs, AttributeTypeBuilder builder) {

    Class<?> s[] = { Point.class, MultiLineString.class, MultiPolygon.class };
    GeometryType buildGeometryType = builder.crs(crs).binding(s[shapeType]).buildGeometryType();
    return builder.buildDescriptor("geom", buildGeometryType);
  }
View Full Code Here

        build.setName(Classes.getShortName(geometryClass));
        build.setNillable(true);
        build.setCRS(crs);
        build.setBinding(geometryClass);

        GeometryType geometryType = build.buildGeometryType();

        List<AttributeDescriptor> attributes = new ArrayList<AttributeDescriptor>();
        attributes.add(build.buildDescriptor(BasicFeatureTypes.GEOMETRY_ATTRIBUTE_NAME, geometryType));

        if (extraPropertyNames != null) {
View Full Code Here

TOP

Related Classes of org.opengis.feature.type.GeometryType

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.