Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1249 closed enhancement (fixed)

Submission of OGR Layer Converter plugin

Reported by: mloskot Owned by: mhugent
Priority: minor: annoyance Milestone:
Component: C++ Plugins Version: Trunk
Keywords: ogr2gui ogr Cc: msieczka
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

Folks,

Inspired by ogr2gui tool, I created today similar utility but available as QGIS plugin. I called it "OGR Layer Converter".

Using this ticked, I'm submitting my plugin for review with hope it is interesting to other users, so could be included to the official set of QGIS plugin and SVN repo. This is first version of the OGR Layer Converter plugin, number 0.1, so it's still in alpha state and testing would be appreciated.

The plugin was written in C++ (GCC 4.0.1) with Qt 4.4.1 and was tested under Mac OS X 10.5.

I've attached the plugin as a regular patch against trunk r9174. So, it's easy to deploy, compile, install, test and use.

More on the plugin in README file (below).

README file:

OGR Layer Converter Pluginm, Version 0.1 (Alpha)
------------------------------------------------------------------------------
Author: Mateusz Loskot <mateusz@loskot.net>

OGR Layer Converter aims to be a GUI-based implementation of well-known
ogr2ogr utility from GDAL/OGR package. The plugin translates layers
between OGR supported formats built-in GDAL/OGR library available for
particular QGIS installation.
Built-in formats are listed in drop-down boxes.

Currently, it is possible to translate one selected source
layer to another OGR format.

Testing appreciated.

List of TODOs I plan to implement soon:

TODO: Add selection of QGIS active layer as a source layer

translator.h: // TODO: Implement, currently always overwrite
translator.h: // TODO: Append option not supported
dialog.cpp:   // TODO: Add support of QGIS projection selector 
dialog.cpp:   // TODO: Transformation support
dialog.cpp:   // TODO: SRS transformation support
dialog.cpp:   // TODO: Use try-catch to display more meaningful error messages from Translator
plugin.cpp:   // TODO: Who is responsible for OGR cleanup?
translator.cpp:    // TODO: RAII for OGR handlers!!!
translator.cpp:    // TODO: Support translation of all layers from input data source
translator.cpp:    // TODO: -nlt option support
translator.cpp:    // TODO: Implement SRS transformation 
translator.cpp:    // TODO: Append and createion options not implemented
translator.cpp:    // TODO: RAII for feature handlers!!!
translator.cpp:    // TODO: Transform feature geometry
translator.cpp:    // TODO: Skip failures support
translator.cpp:    // TODO: Add support for creation options

Looking forward to hear from you...

Attachments (3)

ogr_converter-plugin-mloskot.patch (56.4 KB ) - added by mloskot 16 years ago.
Patch with source code of OGR Layer Converter plugin (cmake configuration included)
ogrconverter.png (1.2 KB ) - added by mloskot 16 years ago.
Icon bitmap missing from the patch
qgis-ogr_converter-register-r9195.patch (1.1 KB ) - added by mloskot 16 years ago.
Patch removing redundant test of number of registered OGR drivers, after QGIS's OGR registrar function introduced

Download all attachments as: .zip

Change History (11)

by mloskot, 16 years ago

Patch with source code of OGR Layer Converter plugin (cmake configuration included)

comment:1 by mhugent, 16 years ago

Owner: changed from nobody to mhugent

Hi mloskot,

Wow, really great work! I'd like to commit it to svn as I'm sure it will be usefull for a lot of people.

There are a few things I noticed:

  • ogrconverter.png does not seem to be in the patch
  • dialog.cpp:180, file needs #include <assert.h> for my compiler
  • the formats in the combo box appear twice

And a feature enhancement wish: it would be a great feature if user could select a different CRS to convert to.

Regards, Marco

by mloskot, 16 years ago

Attachment: ogrconverter.png added

Icon bitmap missing from the patch

comment:2 by mloskot, 16 years ago

Marco,

I've attached GDAL icon bitmap.

Regarding the assert macro missing, please include #include <cassert>. Or, just replace assert with Q_ASSERT. I tried to follow QGIS approach and prefer Qt4 features than C++ std. Apparently, I've forgot to replace assert() with QASSERT()

And, yes SRS transformations are really needed and I've planned it already (see TODO: SRS transformation support) with some first bits included. I will work on it.

Perhaps, it would be possible if I have SVN write access to the QGIS repo. I will only work on my plugin. AFAIR, Gary gave me SVN access some time ago to some branch, that's why I'm listed in new ticket form for assignment.

comment:3 by mloskot, 16 years ago

I've noticed the plugin has been submitted to the SVN trunk (r9191) and added to Debian packaging (r9192)

by mloskot, 16 years ago

Patch removing redundant test of number of registered OGR drivers, after QGIS's OGR registrar function introduced

comment:4 by mloskot, 16 years ago

Second patch already in trunk (r9197)

comment:5 by msieczka, 16 years ago

Cc: msieczka added

comment:6 by pcav, 16 years ago

Milestone: Version 1.0.1

comment:7 by mhugent, 16 years ago

Resolution: fixed
Status: newclosed

The plugin is in trunk, therefore I'm colsing this ticket

comment:8 by (none), 15 years ago

Milestone: Version 1.0.1

Milestone Version 1.0.1 deleted

Note: See TracTickets for help on using tickets.