[Schmitzm-commits] r775 - trunk/src/skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Mar 28 11:45:24 CEST 2010


Author: alfonx
Date: 2010-03-28 11:45:22 +0200 (Sun, 28 Mar 2010)
New Revision: 775

Modified:
   trunk/src/skrueger/geotools/StyledFS.java
Log:
AS-feature: For Strings we add the "" as NODATA values by default for StyledFS

Modified: trunk/src/skrueger/geotools/StyledFS.java
===================================================================
--- trunk/src/skrueger/geotools/StyledFS.java	2010-03-25 11:07:41 UTC (rev 774)
+++ trunk/src/skrueger/geotools/StyledFS.java	2010-03-28 09:45:22 UTC (rev 775)
@@ -256,13 +256,28 @@
 
 			map = new AttributeMetadataImplMap();
 
+//			// 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);
 			}
 		}



More information about the Schmitzm-commits mailing list