GeoTools.getDefaultHints() - since that may be specified on the command 
line or something else crazy.

Jody

Andrea Aime wrote:
> Hi,
> some notes from the query hints proposal implementation.
>
> What is the right behaviour when the user did not set any hint?
> Shall we use an empty Hints, or the global defaults provided
> by GeoTools.getDefaultHints()?
>
> If the former is the right answer, it would be nice to have
> a constanst Hints.EMTPY that avoid useless instantiations
> of emtpy hints (such as Collections.EMTPY_MAP, and un-modifiable, too).
>   
I wanted this as well; but given that this is supposed to be a global 
option I was unable to pull it off.
I considered making Hints.EMPTY == null so the code that checked for 
"null" would at least read
better.

But yes we are supposed to use GeoTools.getDefaultHints() whenever the 
programmer does not
tell us anything specific to use. Martin has a trick where he:
1. Gets GeoTools.getDefaultHints() - it always returns a copy
2. Adds in the the hints the user supplied - I modified the hints method 
so you could add in "null" and not get a NPE
3. And then uses it ...

The above is "needed" so that programmers wanting to control just a few 
settings can have a chance to. The GeoTools.getDefaultHints() will
be used to fill in the blanks.
> I noticed with pleasure that Hints already sports some of the hints
> I was looking for, that is JTS_GEOMETRY_FACTORY and 
> JTS_COORDINATE_SEQUENCE_FACTORY. Thinking about it, for some datastores
> the former may be unfortunately useless. Oracle data store in particular
> sets the SRID on all Geometries, and I cannot guarantee it will
> work properly without them...
>   
Not sure I understood the comment about SRID? The XML parser sets the 
SRID as well ..  I think the JTS_GEOMETRY_FACTORY is registered with 
respect to its JTS_COORDINATE_SEQUENCE_FACTORY. This was important for 
Oracle datastore when it encounters SDO_GEOMETRY that has linear 
reference system measurements.
> Anyways, the second option, stating the coordinate sequence, is a good
> one for the moment.
>
> Oh, I also implemented the coordinate sequence query hint for postgis.
> It works, I cannot say it makes things visibly faster because things
> are still dominated by the query execution and image encoding in 
> Geoserver. Decimation should have a more visible effect.
>   
Very cool :-) Looking forward to reviewing your work.
Jody

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to