53 |
import schmitzm.geotools.io.GeoImportUtil; |
import schmitzm.geotools.io.GeoImportUtil; |
54 |
import schmitzm.geotools.styling.StylingUtil; |
import schmitzm.geotools.styling.StylingUtil; |
55 |
import skrueger.AttributeMetadataImpl; |
import skrueger.AttributeMetadataImpl; |
56 |
|
import skrueger.AttributeMetadataInterface; |
57 |
import skrueger.i8n.Translation; |
import skrueger.i8n.Translation; |
58 |
|
|
59 |
import com.vividsolutions.jts.geom.Envelope; |
import com.vividsolutions.jts.geom.Envelope; |
89 |
private File sldFile; |
private File sldFile; |
90 |
|
|
91 |
/** A map of simple attribute names to their meta-data **/ |
/** A map of simple attribute names to their meta-data **/ |
92 |
private AttributeMetadataMap<AttributeMetadataImpl> map; |
private AttributeMetadataMap<AttributeMetadataImpl> attMap; |
93 |
|
|
94 |
private Filter filter = Filter.INCLUDE; |
private Filter filter = Filter.INCLUDE; |
95 |
|
|
272 |
/** |
/** |
273 |
* |
* |
274 |
*/ |
*/ |
275 |
|
@Override |
276 |
public AttributeMetadataMap<AttributeMetadataImpl> getAttributeMetaDataMap() { |
public AttributeMetadataMap<AttributeMetadataImpl> getAttributeMetaDataMap() { |
277 |
if (map == null) { |
if (attMap == null) { |
278 |
|
attMap = StyledLayerUtil |
279 |
map = new AttributeMetadataImplMap(); |
.createDefaultAttributeMetadataMap(getSchema()); |
|
|
|
|
// // Leaving out the first one, it will be the_geom |
|
|
// for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) { |
|
|
// AttributeDescriptor attDesc = fs.getSchema().getDescriptor(i); |
|
|
// |
|
|
// AttributeMetadataImpl attMetaData = new AttributeMetadataImpl( |
|
|
// new NameImpl(attDesc |
|
|
// .getName().getNamespaceURI(), attDesc |
|
|
// .getName().getLocalPart()), map.getLanguages()); |
|
|
// map.put(attDesc.getName(), attMetaData); |
|
|
// } |
|
|
|
|
|
// Leaving out the first one, it will be the_geom |
|
|
for (int i = 1; i < fs.getSchema().getAttributeCount(); i++) { |
|
|
AttributeDescriptor attDesc = fs.getSchema().getDescriptor(i); |
|
|
|
|
|
// TODO AttributeMetadataAS would be nicer, which would not work |
|
|
// with Translations ;-) |
|
|
AttributeMetadataImpl attMetaData = new AttributeMetadataImpl( |
|
|
new NameImpl(attDesc.getName().getNamespaceURI(), |
|
|
attDesc.getName().getLocalPart()), |
|
|
map.getLanguages()); |
|
|
if (String.class.isAssignableFrom(attDesc.getType() |
|
|
.getBinding())) { |
|
|
// For Strings we add the "" as NODATA values |
|
|
attMetaData.addNodataValue(""); |
|
|
} |
|
|
map.put(attDesc.getName(), attMetaData); |
|
|
} |
|
280 |
} |
} |
281 |
return map; |
return attMap; |
282 |
} |
} |
283 |
|
|
284 |
/** |
/** |