Gabriel Roldan ha scritto:
> Chiming in with an extra concern and a suggestion, on different topics though:
> - concern:
>  what about two files in the same directory, different format, same feature 
> type 
> name: roads.shp and roads.properties. Namespace seems like not enough to 
> handle that.

Right... let's not make this too difficult: the first wins, and a log
message is provided to warn the user that some other file with the
same name has been discarded. What about this?

> - suggestion:
> about how to identify if a given DataAccessFactorySpi works upon files.
> We already have immutable datastore parameters where needed (dbtype?). Also, 
> we have this new param metadata information coming from 
> DataAccessFactory.Param extending org.geotools.data.Parameter. 
> Param.isPassword() being just a convenience method to get to a parameter 
> metadata field.
> We could use a parameter convention for file datastores, being the parameter 
> both immutable and holding a Boolean metadata field stating it works upon 
> files 
> instead of database or remote service or whatever.
> 
> Then, the DirectoryDataStore could get all the factories that work on files, 
> figure out which param is either a File or an URL and ask them if they 
> canProcess(...) first the directory and then a given file.
> Or better, the URL or File based datastore may contain a metadata field 
> indicating whether it expects a directory or a file....
> 
> just thinking loud, but may be of help.

Gabriel, they seem like very good suggestions to me. Adding a parameter
IS_FILE and IS_DIRECTORY to the url/file datastore param seems like a
simple and  effective way to figure out which datastores can handle file
based content. I can get all the factories, filter out those that cannot
open files, and then have each remaining factory try to open the
existing files one by one.

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to