public GeometryDescriptor createGeometryDescriptor( GeometryType type, Name name, int minOccurs, int maxOccurs, boolean isNillable, Object defaultValue) { return new GeometryDescriptorImpl( type, name, minOccurs, maxOccurs, isNillable, defaultValue); }
null, null); return new GeometryDescriptorImpl(at, new NameImpl(name), 0, 1, nillable, null); } else { AttributeType at =
public GeometryDescriptor createGeometryDescriptor(GeometryType type, Name name, int minOccurs, int maxOccurs, boolean isNillable, Object defaultValue) { return new GeometryDescriptorImpl(type, name, minOccurs, maxOccurs, isNillable, defaultValue); }
if (type instanceof GeometryType) { descriptor = new GeometryDescriptorImpl( (GeometryType) type, name,
new GeometryDescriptorImpl( geomType, descriptor.getName(),
/** Test extracting geometry from geometryattribute should be successful. */ public void testGeometry() { Geometry geometry = new EmptyGeometry(); GeometryAttribute geoatt = new GeometryAttributeImpl( geometry, new GeometryDescriptorImpl( new GeometryTypeImpl( new NameImpl(""), EmptyGeometry.class, null, false, false, null, null, null), new NameImpl(""), 0, 0, false, null), null); Geometry geometry2 = Converters.convert(geoatt, Geometry.class); assertTrue(geometry == geometry2); }
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,
,oldGeometryDescriptor.getType().getDescription()); GeometryDescriptor newGeometryDescriptor = new GeometryDescriptorImpl(type, property.getName(), 0, 1, true, null); Identifier identifier = new GmlObjectIdImpl(feature.getID()); GeometryAttributeImpl geo = new GeometryAttributeImpl((Object) g, newGeometryDescriptor, identifier);
descriptor = new GeometryDescriptorImpl((GeometryType) type, name, minOccurs, maxOccurs, nillable, defaultValue); } else {
/** * Create a new geometry attribute, even for null id. * * @see org.geotools.feature.AbstractFeatureFactoryImpl#createGeometryAttribute(java.lang.Object, * org.opengis.feature.type.GeometryDescriptor, java.lang.String, * org.opengis.referencing.crs.CoordinateReferenceSystem) */ @Override public GeometryAttribute createGeometryAttribute(Object value, GeometryDescriptor descriptor, String id, CoordinateReferenceSystem crs) { if (crs != null && !(crs.equals(descriptor.getCoordinateReferenceSystem()))) { // update CRS GeometryType origType = (GeometryType) descriptor.getType(); GeometryType geomType = new GeometryTypeImpl(origType.getName(), origType.getBinding(), crs, origType.isIdentified(), origType.isAbstract(), origType.getRestrictions(), origType.getSuper(), origType.getDescription()); geomType.getUserData().putAll(origType.getUserData()); descriptor = new GeometryDescriptorImpl(geomType, descriptor.getName(), descriptor .getMinOccurs(), descriptor.getMaxOccurs(), descriptor.isNillable(), ((GeometryDescriptor) descriptor).getDefaultValue()); descriptor.getUserData().putAll(descriptor.getUserData()); } return new GeometryAttributeImpl(value, descriptor, buildSafeGmlObjectId(id)); }
.getDescription()); GeometryDescriptor newGeometryDescriptor = new GeometryDescriptorImpl( type, property.getName(), 0, 1, true, null);
/** * Test extracting geometry from geometryattribute should be successful. */ public void testGeometry() { Geometry geometry = new EmptyGeometry(); GeometryAttribute geoatt = new GeometryAttributeImpl(geometry, new GeometryDescriptorImpl(new GeometryTypeImpl(new NameImpl(""), EmptyGeometry.class, null, false, false, null, null, null), new NameImpl(""), 0, 0, false, null), null); Geometry geometry2 = Converters.convert(geoatt, Geometry.class); assertTrue(geometry == geometry2); }
GeometryType type = new GeometryTypeImpl(property.getName(),(Class<?>)oldGeometryDescriptor.getType().getBinding(),oldGeometryDescriptor.getType().getCoordinateReferenceSystem(),oldGeometryDescriptor.getType().isIdentified(),oldGeometryDescriptor.getType().isAbstract(),oldGeometryDescriptor.getType().getRestrictions(),oldGeometryDescriptor.getType().getSuper(),oldGeometryDescriptor.getType().getDescription()); GeometryDescriptor newGeometryDescriptor = new GeometryDescriptorImpl(type,property.getName(),0,1,true,null); Identifier identifier = new GmlObjectIdImpl(feature.getID()); GeometryAttributeImpl geo = new GeometryAttributeImpl((Object)g,newGeometryDescriptor, identifier);
type.getSuper(), type.getDescription()); return new GeometryDescriptorImpl( curvedType, gd.getName(), type.getSuper(), type.getDescription()); return new GeometryDescriptorImpl( curvedType, gd.getName(),
null); builder.add(new GeometryDescriptorImpl(gt, new NameImpl("GEOMETRY"), 0, 1, false, null));
GeometryType type1 = new GeometryTypeImpl(geomProperty.getName(),MultiPolygon.class, oldGeometryDescriptor.getType().getCoordinateReferenceSystem(),oldGeometryDescriptor.getType().isIdentified(),oldGeometryDescriptor.getType().isAbstract(),oldGeometryDescriptor.getType().getRestrictions(),oldGeometryDescriptor.getType().getSuper(),oldGeometryDescriptor.getType().getDescription()); GeometryDescriptor newGeometryDescriptor = new GeometryDescriptorImpl(type1,geomProperty.getName(),0,1,true,null); Identifier identifier = new GmlObjectIdImpl(sf.getID()); geo = new GeometryAttributeImpl((Object)g,newGeometryDescriptor, identifier);
new GeometryDescriptorImpl( gt, geomDescriptor.getName(),
new GeometryDescriptorImpl( gt, geomDescriptor.getName(),
false, false, null, null, null); GeometryDescriptor gd1 = new GeometryDescriptorImpl(gt1, new NameImpl("geometry"), 0, 1,