From: Schuster S. <ste...@ge...> - 2010-02-04 08:00:51
|
Hi, thanks again to everybody who helped me. I solved the problem by splitting my long string over several columns - it works fine :-) Stefan -----Ursprüngliche Nachricht----- Von: Andrea Aime [mailto:aa...@op...] Gesendet: Dienstag, 2. Februar 2010 13:18 An: Schuster Stefan Cc: geo...@li... Betreff: Re: AW: [Geotools-gt2-users] Width of Metadata in Shapefile Schuster Stefan ha scritto: > Hello Andrea, > > thanks a lot for your fast answer, but I still have a problem > > As you suggested I switched to SimpleFeatureTypeBuilder, therefor I replaced > the code for creating the FeatureType as follows: > > > SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); > builder.setName("Ereignisse"); > builder.setCRS(CRS.decode("EPSG:32632")); > builder.add("Location", MultiLineString.class); > for (String fieldName : fieldNames) { > builder.length(3500).add(fieldName, String.class); > } > TYPE = builder.buildFeatureType(); > > > I can now set a restriction for Strings to be _shorter_ than 255 chars, but > not to be _longer_. > I'd need a possible maximum of 3500 chars in Field That would not be a DBF file anymore, the length of a field can be specified using a byte, so it can be 255 at most: http://www.dbase.com/knowledgebase/int/db7_file_fmt.htm Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. |