I'm trying to scrape together a class that builds AttributeDescriptor
objects from a DBaseFileHeader. I'm finding myself hip deep in the
Geotools feature model. (How did that happen?)
Because that is what we use to describe the valid values :-)
I need to ask some questions on the proper use of the
AttributeTypeImpl class:
- Is it allowable to pass null values to the constructor for the list
of restrictions, super type, and description?
Yes - please use an AttributeTypeBuilder it will be a bit nicer and
fill in those values as appropriate.
- restrictions if a Filter; if you are not restricted. FIlter.INCLUDES
should be fine
- super type - if you have no super type null is fine
- an empty description should be fine
- What does the "identified" field indicate? I can't figure out what
it represents, and subsequently, what value I should pass for this
field to the constructor.
Identified indicates if this is an object with its own "id" in the GML
sense; sometimes you can have a geometry that is shared by two
features for example. "false" is a good default value.
Finally please do use AttributeTypeBuilder as it will supply default
values for you...
AttributeTypeBuilder build = new AttributeTypeBuilder();
build.setNillable(true);
build.setBinding(String.class);
build.setName("Text");
AttributeType textType = build.buildType();
AttributeDescriptor descriptor = build.buildDescriptor( "name",
textType );
Examples are here (thanks justin for the examples):
- http://docs.codehaus.org/display/GEOTDOC/Feature+Model+Guide
Cheers,
Jody
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel