public FeatureType createFeatureType( Name name, Collection schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List restrictions, AttributeType superType, InternationalString description) { return new FeatureTypeImpl( name, schema, defaultGeometry, isAbstract, restrictions, superType, description); }
public GeometryDescriptor getGeometryDescriptor() { if (defaultGeometry == null) { for (PropertyDescriptor property : getDescriptors()) { if (property instanceof GeometryDescriptor) { defaultGeometry = (GeometryDescriptor) property; break; } } } return defaultGeometry; }
public AttributeDescriptor getDescriptor(Name name) { return (AttributeDescriptor) super.getDescriptor(name); }
public CoordinateReferenceSystem getCoordinateReferenceSystem() { if (crs == null) { if (getGeometryDescriptor() != null && getGeometryDescriptor().getType().getCoordinateReferenceSystem() != null) { crs = defaultGeometry.getType().getCoordinateReferenceSystem(); } if (crs == null) { for (PropertyDescriptor property : getDescriptors()) { if (property instanceof GeometryDescriptor) { GeometryDescriptor geometry = (GeometryDescriptor) property; if (geometry.getType().getCoordinateReferenceSystem() != null) { crs = geometry.getType().getCoordinateReferenceSystem(); break; } } } } } return crs; }
public boolean equals(Object o) { if (this == o) { return true; } if (!super.equals(o)) { return false; } if (getClass() != o.getClass()) { return false; } FeatureType other = (FeatureType) o; if (!Utilities.equals(getGeometryDescriptor(), other.getGeometryDescriptor())) { return false; } return true; }
public CoordinateReferenceSystem getCoordinateReferenceSystem() { if(crs == null) { if ( getGeometryDescriptor() != null && getGeometryDescriptor().getType().getCoordinateReferenceSystem() != null) { crs = defaultGeometry.getType().getCoordinateReferenceSystem(); } if(crs == null) { for (PropertyDescriptor property : getDescriptors()) { if ( property instanceof GeometryDescriptor ) { GeometryDescriptor geometry = (GeometryDescriptor) property; if ( geometry.getType().getCoordinateReferenceSystem() != null ) { crs = geometry.getType().getCoordinateReferenceSystem(); break; } } } } } return crs; }
public boolean equals(Object o) { if(this == o) { return true; } if(!super.equals(o)){ return false; } if (getClass() != o.getClass()) { return false; } FeatureType other = (FeatureType) o; if (!Utilities.equals( getGeometryDescriptor(), other.getGeometryDescriptor())) { return false; } return true; }
public FeatureType createFeatureType(Name name, Collection schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List restrictions, AttributeType superType, InternationalString description) { return new FeatureTypeImpl(name, schema, defaultGeometry, isAbstract, restrictions, superType, description); }
public GeometryDescriptor getGeometryDescriptor() { if (defaultGeometry == null) { for (PropertyDescriptor property : getDescriptors()) { if (property instanceof GeometryDescriptor ) { defaultGeometry = (GeometryDescriptor) property; break; } } } return defaultGeometry; }
public AttributeDescriptor getDescriptor(Name name) { return (AttributeDescriptor) super.getDescriptor(name); }
childSchema.add(attOneDescriptor); FeatureType childType = new FeatureTypeImpl( new NameImpl("ns", "childType"), childSchema, parentSchema.add(attTwoDescriptor); FeatureType parentType = new FeatureTypeImpl( new NameImpl("ns", "parentType"), parentSchema,
private void writeAttributeDefinitions(String layer, String ownerHandle, FeatureCollection fc) throws IOException { FeatureTypeImpl schema = (FeatureTypeImpl) fc.getSchema(); for ( PropertyDescriptor p : schema.getDescriptors()) { Name name = p.getName(); LOGGER.warning(" attr: " + name.getLocalPart()); if (!(p.getType() instanceof GeometryType)) { writeAttrDef(layer, ownerHandle, name.getLocalPart()); } } }
public AttributeDescriptor getDescriptor(String name) { return (AttributeDescriptor) super.getDescriptor(name); }
@Test public void testIsValidInput() throws Exception { final FeatureCsvWriter csvWriter = new FeatureCsvWriter(null, null); final SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName(new NameImpl("")); final SimpleFeatureType simpleFeatureType = builder.buildFeatureType(); assertTrue(csvWriter.isValidInput(simpleFeatureType, new DefaultFeatureCollection("id", simpleFeatureType))); final FeatureTypeImpl featureType = new FeatureTypeImpl(new NameImpl(""), null, null, false, null, null, null); assertFalse(csvWriter.isValidInput(featureType, new DefaultFeatureCollection("id", simpleFeatureType))); assertFalse(csvWriter.isValidInput()); }
childSchema.add(attOneDescriptor); FeatureType childType = new FeatureTypeImpl( new NameImpl("ns", "childType"), childSchema, parentSchema.add(attTwoDescriptor); FeatureType parentType = new FeatureTypeImpl( new NameImpl("ns", "parentType"), parentSchema,