Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Processing] A new tool to import data in PostGIS based on ogr2ogr and a... #1674

Closed
wants to merge 1 commit into from
Closed

Conversation

gioman
Copy link
Contributor

@gioman gioman commented Nov 5, 2014

... few other ogr related fixes.

None of the tools available in QGIS (SPIT, DB Manager, drag and drop in Browser, the tool already available in Processing) to allow users import data into PostGIS is very efficient, to tell the truth are pretty slow and they lack many important options (for example the one to append to existing tables). Command line tools are available and rich of options and switches to allow boost importing speed especially of very large vectors.

See

https://doublebyteblog.wordpress.com/2014/08/06/importing-large-spatial-dataset-into-postgis/comment-page-1/#comment-123

for an example.

While the solution based on shp2pgsql/psql requires to install them, as they are not part of the standard QGIS installation, ogr2ogr is part of any QGIS installation and therefore a Processing tool based on it will be added with this pull request. And the tool is several times faster than any other alternative available in QGIS.

@gioman
Copy link
Contributor Author

gioman commented Nov 5, 2014

assigend @volaya @alexbruy

@volaya
Copy link
Contributor

volaya commented Nov 21, 2014

Merged

@volaya volaya closed this Nov 21, 2014
@nyalldawson
Copy link
Collaborator

@gioman This is really nice. The only thing I see missing from the existing "Import Into PostGIS" algorithm is the option to drop the length constraints on columns. This could be done using ogr2ogr with the -unsetFieldWidth flag and the PRECISION=NO layer creation option. The only other thing missing is that the existing option gives a list of fields to choose from for an existing primary key field.

@gioman
Copy link
Contributor Author

gioman commented Nov 26, 2014

Hi Nyall, I filed a ticket for the first request

http://hub.qgis.org/issues/11749

I'm not sure I have understand the second one. Cheers!

@nyalldawson
Copy link
Collaborator

@gioman - if you run the older "Import into PostGIS" algorithm, the "Primary key field" setting is a combo box containing all the fields in the original layer. The newer import algorithm just has a text field for Primary Key, which isn't as handy as the combo box.

@gioman
Copy link
Contributor Author

gioman commented Nov 27, 2014

ok, I should be able to add this option too.

@olivierdalang
Copy link
Contributor

@gioman
Hi ! Thanks for the great contribution ! I was exactly looking for this :)
However, there's a small (but blocking) bug under windows.
I filed an issue here: https://hub.qgis.org/issues/12019
The fix should be easy, but I'm not familiar with processing algorithms, so I didn't checked it out.

@olivierdalang
Copy link
Contributor

@gioman
(sorry for the spam)
and a feature request : would it be possible to allow loading of non geometric tables as well ?
https://hub.qgis.org/issues/12020

@gioman
Copy link
Contributor Author

gioman commented Jan 23, 2015

tool for geometryless tables #1862

@olivierdalang
Copy link
Contributor

@gioman very cool, thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants