Martin Desruisseaux wrote:
> Jody Garnett a écrit :
>> I started in on DataSource proposal today... and Andrea asked the
>> sensible question of how does one hook it up. And I am not sure yet
>> how multiple valid CRSFactories are chosen ....CRS is caching a
>> DefaultAuthorityFactory - which I eventually will need to get Hints
>> into.
> CRS is just a set of convenience methods. If we complexify it too
> much, it will no longer be convenience methods and will start to looks
> like FactoryFinder.
CRS is not the only problem here ... there are a lot of cached
singletons in the library. Each one of the FactoryFinders as an easy
example.
> If more control are wanted, org.geotools.referencing.FactoryFinder
> should be considered. Lets see if it can fit the needs.
I will review how CRS does its thing and write up the result in the user
guide for you to review. You were thinking of renaming this beast - is
now a good time?
>> Apparently GeoServer is using a system property right now ... I went
>> through all the source code and found the following:
>>
>> From FactoryUsingWKT:
>> - public static final String CRS_DIRECTORY_KEY =
>> "org.geotools.referencing.crs-directory";
>> - final String directory = System.getProperty(CRS_DIRECTORY_KEY);
> System properties should not be needed in any way for configuring the
> factories. I admit that CRS_DIRECTORY_KEY is an exception. This is a
> bug and should be fixed. If this is an urgent issue and if you have a
> little bit of time, would you like to fix it? I may not be able to do
> significant work before a few days.
>
> * Add a new value in org.geotools.factory.Hints (name to be
> determined. Maybe
> EXTRA_CRS_DIRECTORY?)
>
> * Add a "directory" (or some other name) private field in
> FactoryUsingWKT.
>
> * Initialize this field in the constror with:
>
> if (hints != null) {
> directory = hints.get(Hints.EXTRA_CRS_DIRECTORY);
> }
> if (directory == null) {
> // Cut and paste the code currently in getDefinitionsURL()
> // which check the system property. Keep this field to null
> // if the system property was not set.
> }
> super.hints.put(Hints.EXTRA_CRS_DIRECTORY, directory);
>
> * Check this "directory" private field in getDefinitionsURL(), in place
>
> of the code that previously checked for system property (now moved to
> the constructor).
>
Thanks Martin ... I am going to do this now (as a learning experience so
I can do the Hint for EPSG_DATASOURCE correctly)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel