Your're right about the jar file. It was a jar file issue. I removed three
commons jar files (codec, collections, logging) in the application
WEB-INF/lib that were probably conflicting with the versions from the
geotools M2 library. Once I removed them, the attribute addition code worked
fine.
J
I tried the
builder.add(AttributeTypeFactory.newAttributeType("stringProperty",
String.class, true, 10) like you suggested and I still didn't have success.
Knowing from your reply that it works for you, I checked my system as I
figured it had to be somethere there. I found three commons* jar files
Interesting; shapefile has the concept of a maximum string length (I
think it may be 256 characters?). As such when you call .createSchema it
actually makes a new FeatureType with all these restrictions represented.
The restriction on string length is represented as something like
"length(strin
I'm not sure why the code you have isn't working. It looks like it
should. When I have created simple features to go into a shapefile in
the past, I have used AttributeTypeFactory for the attributes. Perhaps
you could see if the following works to add the String attribute...
builder.add(Att
Hi,
I am a new user to geotools and am using the 2.5M2 version. (Thank you for
the great tool and documention). I've successfully created a shapefile of
points but am having problems when trying to include additional attributes.
I'm using the SimpleFeatureTypeBuilder.
SimpleFeatureTypeBuilder b