Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Add Data wizard "Directory of spatial files (Shapefile)" doesn't work

Hallo List,

when I tested the GDAL I stumbled over the DataStores and here especially the mentioned above. I was debugging through DataStoreConnectionPage and DataStoreParameterPage and here is my resume:

right now the Shapefile DataStore and the Directory of Shapefiles DataStore are broken because of the EXTENSION value coming from geotools ShapefileDataStoreFactory right there is added the metadata 
Param.EXT,"shp". Because the Wizard uses this extension to filter files in FileDialog, nothing is shown up and the user cant choose a file. I changed temp. the code and tested with

                    FileDialog browse = new FileDialog(parent.getShell(), SWT.OPEN);

                    if (EXTENSION != null) {
                    String ext = "*." + EXTENSION.replace("*.", "").replace(".", "");
                        browse.setFilterExtensions(new String[]{ext});
                    }
instead of the origin code fragment:

                    if (EXTENSION != null) {
                        browse.setFilterExtensions(new String[]{EXTENSION});
                    }

and then the Shapefile DataStore works fine. BUT the Directory DataStore does more or less and has a behavior the user doesn't expects: the user has to choose a file instead of a directory, that contains files. 
I'm wondering whether this feature worked correctly in the past. I guess its implicit a new feature since ShapefileDirectoryFactory was created in geotools.

Could anybody confirm, that this could be an issue. If so, whats the best way to solve this - ignore ShapefileDirectoryFactory explicit in udig or change the generic code to handle this Store in a specific way (means DirectoryDialog instead of FileDialog)? Are there other Stores with a identical behavior?

Cheers, 
-Frank

Back to the top