I forgot to mention the ability to validate attribute values using the
Filter class. Very cool...and the ability to query Features using CQL.
That is also very cool.

The more I think about it, the more I see the benefits of moving
OpenJUMP to the GeoTools feature model. If only it weren't so painful
to do so.

Maybe I can set aside a couple months for an attempt at the
refactoring this fall, or find a Google Summer of Code student that
would accept the challenge next summer.

Landon

On Thu, May 29, 2008 at 1:11 PM, Sunburned Surveyor
<[EMAIL PROTECTED]> wrote:
> Have I qualified as GeoTools most annoying programmer yet? :]
>
> I wanted to pass on my enthusiastic commendation for the great design
> of the GeoAPI/GeoTools SimpleFeature code. This would include the
> SimpleFeature interface, SimpleFeatureType interface,
> PropertyDescriptior/AttributeDescriptor interfaces, and the
> PropertyType/AttributeType interfaces. I've been working with these
> interfaces for a few days now and I enjoy their elegance. I don't know
> which specific programmers are responsible for the design, but they
> have done really great work, and I thank them.
>
> I was afraid that the feature model in GeoTools would be too complex
> to be really useful in my endeavors, but I can see now that is not the
> case. If I ignore the complex feature code, and only concentrate on
> the classes/interfaces that deal with SimpleFeature objects, its
> really not that bad at all!
>
> In fact (don't quote me on this) I even think OpenJUMP could be
> refactored at some point to use the SimpleFeature model from GeoTools.
> This would be a major programming effort similar to the challenge we
> will face when/if Martin migrates the JTS Geometry class to an
> interface, but I think the potential rewards would be huge. This would
> be the most important step towards greater sharing of code between
> OpenJUMP and GeoTools.
>
> I always thought the way OpenJUMP defined attributes was a little
> akward, and the PropertyType/PropertyDescriptor combination is an
> excellent alternative.
>
> I was just writing a method in which would set an attribute value of a
> WaypointDataObject to null when given the attribute name. However, I
> didn't want to allow the method to set the latitude or longitude
> attributes to null. Instead of testing for these values in a chained
> conditional statement, I just obtained the AttributeDescriptor for the
> attribute identified by the caller and tested the result of the
> descriptor's isNillable() method. If the result was true, I allowed
> the attribute value to be set to null. If it was false, I threw an
> exception.
>
> Very nice! I don't know that you could currently do this with
> OpenJUMP's feature model. (At least not as elegantly.)
>
> I'm excited about working with the SimpleFeature code in GeoTools more
> in the next few weeks. I don't know if we'll ever have the resources
> to move OpenJUMP to this feature model, but I now understand that it
> is at least possible.
>
> Landon
>
> P.S. - You can view my WaypointDataObject class here:
>
> http://surveyos.svn.sourceforge.net/viewvc/surveyos/java/gpx/src/org/geotools/gpx2/dataobjects/WaypointDataObject.java?view=markup
>
> You can view some an interface containing some utitlites for
> SimpleFeatureType that I hope to implement soon here:
>
> http://surveyos.svn.sourceforge.net/viewvc/surveyos/java/gpx/src/org/geotools/dataobjects/SimpleFeatureTypeUtils.java?view=markup
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to