[Schmitzm-commits] r731 - trunk/src/schmitzm/geotools/feature

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Feb 28 16:15:36 CET 2010


Author: alfonx
Date: 2010-02-28 16:15:35 +0100 (Sun, 28 Feb 2010)
New Revision: 731

Modified:
   trunk/src/schmitzm/geotools/feature/FeatureUtil.java
Log:
Atlas-Loading: When linking existing attributes with described ones, also allows " " to "_" changes as done by OpenCalc.

Modified: trunk/src/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2010-02-26 15:22:25 UTC (rev 730)
+++ trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2010-02-28 15:15:35 UTC (rev 731)
@@ -2186,8 +2186,9 @@
 	 * 
 	 * @return If no match is found, <code>null</code> is returned.
 	 */
-	public static Name findBestMatchingAttribute(SimpleFeatureType schema,
+	public static org.opengis.feature.type.Name findBestMatchingAttribute(SimpleFeatureType schema,
 			String localName) {
+//		asdads _ _ _ 
 		List<AttributeDescriptor> attributeDescriptors = schema
 				.getAttributeDescriptors();
 		if (attributeDescriptors.size() == 0) {
@@ -2207,6 +2208,14 @@
 				return d.getName();
 			}
 		}
+		// Checking for irgnoreCase match with empty spaces converted to _
+		for (AttributeDescriptor d : attributeDescriptors) {
+			if (d.getName().getLocalPart().replace(" ", "_").equalsIgnoreCase(localName.replace(" ", "_"))) {
+				LOGGER.error("Corrected attributeName '" + localName + "' to "
+						+ d.getName().getLocalPart());
+				return d.getName();
+			}
+		}		
 		return null;
 	}
 



More information about the Schmitzm-commits mailing list