Feature request #515

Thoroughly use OGR

Added by bertelli - over 17 years ago. Updated almost 15 years ago.

Assignee:Tim Sutton
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:10574


The Add Vector Layer interface could be enhanced to thoroughly use OGR features.
OGR has lots of options that remain hidden in QGIS.
First of all, more formats. File formats but also database formats. QGIS doesn't even make any use of SQLite for spatial storage. It could. It's a practical format, only one file instead of 3 for shapefiles and 4 for MapInfo. Nor it makes any use of other spatial repositories, mainly Oracle Spatial and OGR makes it very easy.
Second, and maybe more important if you don't have data inside Grass, make use of the "-sql" and "-where" options. Managing and filtering datafiles before viewing them in a map is very important.
Third, not so important, an "advanced" mode could make use of recent "enhancements" of OGR which request a more precise description of the data source.
Fourth, and this is finally a minor glitch, OGR lets the user access graphical features which are common in DGN and MapInfo files. It's not necessary for GIS operations, but sometimes this carry some implicit data...

openvector.zip - Adds support for ogr databases and procotol datasources (15.7 KB) Redmine Admin, 2009-03-04 01:29 PM

openvectorv2.zip - Patch with enconding combo added (16.2 KB) Redmine Admin, 2009-03-05 09:00 PM


#1 Updated by Tim Sutton almost 16 years ago

Generic access to OGR database sources is being worked on by Godofredo. I'm not sure if it will make it into 1.0 release. Godofredo please set the milestone to 2.0 if you dont think it will happen in the 1.0 release.



#2 Updated by Tim Sutton almost 16 years ago

I'm setting this to milestone 2.0 - Godofredo can always change it back if he is able to implement his generic access changes in time for version 1.0

#3 Updated by Redmine Admin over 15 years ago

I have been working in a patch for open vector layer dialog to improve it and extend it to support database, protocol and directory connections in addition to the already implemented file support.

I have tested the patch with the following drivers:

Database drivers:

Mysql,Oracle,Postgres,ODBC,Esri Personal Geodatabase

Protocol drivers:


Directory drivers:

UK. NTF.,US Census Tiger/Line,Arc Info Binary Coverage

File drivers:

Atlas BNA,Esri Personal Geodatabase,Esri Shapefile,GML,GPX,KML,Mapinfo File,Microstation DGN,S-57,X-PLANE,

The supported drivers are not limited to the ones in the list, I have coded the uri
translation for most drivers mentioned in gdal/ogr site.

#4 Updated by Tim Sutton over 15 years ago

  • Status changed from Open to In Progress

Hi Godofredo

I tested your patch here. The dialog has some layout issues making the upper frame impossible to see here on Ubuntu. I can fix this for you. Also the encoding selector has gone from the open dialog which may cause people in some locales issues - is there a way to reinstate that?

Also note that for sake of clarity, new methods added to the 1.x api should state which version they were added

     virtual QString fileVectorFilters() const;
+    /** return a string containing the available database drivers */
+    virtual QString databaseDrivers() const;
+    /** return a string containing the available directory drivers */
+    virtual QString directoryDrivers() const;
+    /** return a string containing the available protocol drivers */
+    virtual QString protocolDrivers() const;

Should have comments added like:

/** return a string containing the available protocol drivers 
** @note this method was added in QGIS 1.1

so that it is obvious to programmers when they will be deviating from the stable supported 1.0.x api.

I am really looking forward to the new functionality introduced by your patch making its way into SVN!



#5 Updated by Redmine Admin over 15 years ago

Hi Tim:

I added a combo to openvectordialog and removed it from the file selector. This way the encoding can be applied to any kind of datasource selected. With regard to the layout problem I will appreciate if you can fix it.

Godofredo Contreras

#6 Updated by Paolo Cavallini about 15 years ago

Isn't this solved in trunk? Better close it?

#7 Updated by Tim Sutton about 15 years ago

  • Status changed from In Progress to Closed
  • Resolution set to fixed

This is addressed in the upcoming 1.1 release. Closing this ticket. Many thanks to Godofredo for his great work.



#8 Updated by Anonymous almost 15 years ago

Milestone Version 1.1.0 deleted

Also available in: Atom PDF