On Mon, 23 Jan 2023 at 16:29, Matthias Loeks <matth...@loeks.net> wrote:
> Hi all, > > I've noticed that org.geotools.data.DataUtilities.createType() > <https://github.com/geotools/geotools/blob/main/modules/library/main/src/main/java/org/geotools/data/DataUtilities.java#L1883> > does not properly map attributed if the name of the descriptor contains a > comma. > > Example: Decoding "the_geom:Point,value,%:Double" > yields both "value:String" and "%:Double" attributes, instead of only > "value,%:Double" > > Is this behaviour intended for those featureType specs or is this a bug? > > Not sure if using commas in attributed is generally discouraged, but > matter of fact is we're getting customer SHP data with this. > If it isn't outright forbidden to use commas in variable names (it really should be) it will be in that function - as explained at https://github.com/geotools/geotools/blob/a4b65151f993702f05b4e4a0e9f053c71243a14e/modules/library/main/src/main/java/org/geotools/data/DataUtilities.java#L1818 the comma separates the feature descriptors. I'm not at all sure that % is a valid name either. But in general you shouldn't be using those simple create functions in anything except unit tests. Use a proper FeatureTypeBuilder and I suspect all your problems will disappear. Ian
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel