Package org.opengis.feature.type

Examples of org.opengis.feature.type.GeometryType


        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


        builder.setBinding(String.class);
        AttributeType ANZLIC_NO = builder.attribute();

        builder.setName("locationType");
        builder.setBinding(Point.class);
        GeometryType LOCATION = builder.geometry();

        // build complex attribute
        AttributeType MEASUREMENT = createMeasurementType(typeFactory);

        builder.setName("project_noType");
View Full Code Here

            throw new RuntimeException(e);
        }
        builder.setCRS(fakeCrs);
        builder.setBinding(Point.class);

        GeometryType type = builder.geometry();
        return type;
    }
View Full Code Here

        builder.setBinding(String.class);
        AttributeType ANZLIC_NO = builder.attribute();

        builder.setName("locationType");
        builder.setBinding(Point.class);
        GeometryType LOCATION = builder.geometry();

        // build complex attribute
        AttributeType MEASUREMENT = createMeasurementType(typeFactory);

        builder.setName("project_noType");
View Full Code Here

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

            GeometryType geometryType = build.buildGeometryType();
            attributes.add(build.buildDescriptor(BasicFeatureTypes.GEOMETRY_ATTRIBUTE_NAME,
                    geometryType));
            Set<String> usedNames = new HashSet<String>(); // record names in
            // case of
            // duplicates
View Full Code Here

                    // where it is done for feature chaining for simple content
                    if (Types.isSimpleContentType(parent.getType())) {
                        return setSimpleContentValue(parent, value);
                    } else if (Types.isGeometryType(parent.getType())) {
                        ComplexFeatureTypeFactoryImpl typeFactory = new ComplexFeatureTypeFactoryImpl();
                        GeometryType geomType;
                        if (parent.getType() instanceof GeometryType) {
                            geomType = (GeometryType) parent.getType();
                        } else {
                            geomType = (GeometryType) ((NonFeatureTypeProxy) parent.getType())
                                    .getSubject();
View Full Code Here

   
    private GeometryDescriptor reprojectGeometry(GeometryDescriptor descr) {
      if (descr == null) {
        return null;
      }
      GeometryType type = ftf.createGeometryType(descr.getType().getName(), descr.getType().getBinding(), reprojection, descr.getType().isIdentified(), descr.getType().isAbstract(), descr.getType().getRestrictions(), descr.getType().getSuper(), descr.getType().getDescription());
      type.getUserData().putAll(descr.getType().getUserData());
      GeometryDescriptor gd = ftf.createGeometryDescriptor(type, descr.getName(), descr.getMinOccurs(), descr.getMaxOccurs(), descr.isNillable(), descr.getDefaultValue());
      gd.getUserData().putAll(descr.getUserData());
      return gd;
    }
View Full Code Here

            binding = aType.getBinding();
            isIdentified = aType.isIdentified();
            superType = aType.getSuper();
        }
        if (type instanceof GeometryType) {
            GeometryType geometryType = (GeometryType) type;

            this.crs = geometryType.getCoordinateReferenceSystem();
        }
        if (type instanceof ComplexType) {
            ComplexType cType = (ComplexType) type;

            properties = null;
View Full Code Here

                    LOGGER.warning("Creating "+name+" with null CoordinateReferenceSystem - did you mean to setCRS?");
                }
                attributeBuilder.setCRS(defaultCrs);
            }

            GeometryType type = attributeBuilder.buildGeometryType();
            descriptor = attributeBuilder.buildDescriptor(name, type);
        } else {
            AttributeType type = attributeBuilder.buildType();
            descriptor = attributeBuilder.buildDescriptor(name, type);
        }
View Full Code Here

  public void add(String name, Class<?> binding, CoordinateReferenceSystem crs ) {
    attributeBuilder.setBinding(binding);
    attributeBuilder.setName(name);
    attributeBuilder.setCRS(crs);
   
    GeometryType type = attributeBuilder.buildGeometryType();
    GeometryDescriptor descriptor = attributeBuilder.buildDescriptor(name,type);
    attributes().add(descriptor);
  }
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.