On 02/20/2013 04:10 PM, Mateusz Loskot wrote:
Whoever comes up with an idea to directly drive his app GUI with a
library such as GDAL should leave his desk, go fishing for as long as it takes
him to come back
with solution on his app side.
Mateusz,
I've come up with this idea. However, I'm not very often confronted with
data in strange formats and I've been happy with a standard GTK+ File
Open dialog for raster data - and then relying on GDAL autodetect. For
vector data I've cooked up my own dialog - mostly because I want to show
meta data of the selected layer in the dialog. But, I found out that in
some cases one needs to specify the OGR driver which to use - so in the
dialog box there is a drop down widget for optionally specifying the
driver (the default is autodetect). The file browser can select
directories and files - so the user can optionally try various drivers
on the same file/directory.
The practical problem often is of course that the dataset can be made
from more than one file.
Just the last few days I've worked on the support in the GUI for using
the WMS and WFS drivers in GDAL. For WMS I made a completely new dialog
box but for the WFS I added it into the Open vector data dialog - it
already had support for PostGIS data so non-filesystem datasource was
not a completely new concept. What I did earlier was to write the OGR
driver connection strings as templates so that they can be used to
create simple a dialog box to ask the basic data from the user - this
seems to work quite nicely. What I did now was to add the WFS "get
layers" and "get layer meta data" functionality - I ended up using Perl
bindings to general XML libraries for those. I only use the OGR WFS
driver to retrieve the data of a known layer, with
OGR_WFS_LOAD_MULTIPLE_LAYER_DEFN set to false to avoid unnecessary calls.
So, maybe what I want to say is that the file extension is just a part
of the issue. GDAL can get data from many other sources than local
filesystem - and creating a unified easy to use GUI for all those may be
more interesting and useful.
Cheers,
Ari
Make JSON file with GDAL driver to extension mapping, and configure
your GUI based on that.
Flexibility will be way better. Maintenance will be none (GDAL does
not deliver new drivers every week).
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev