Feature request #1249

Submission of OGR Layer Converter plugin

Added by Mateusz Loskot - over 16 years ago. Updated over 15 years ago.

Status:Closed
Priority:Low
Assignee:Marco Hugentobler
Category:C++ Plugins
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:11309

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 <[email protected]>

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...

ogr_converter-plugin-mloskot.patch Magnifier - Patch with source code of OGR Layer Converter plugin (cmake configuration included) (56.4 KB) Mateusz Loskot -, 2008-08-26 04:28 PM

ogrconverter.png - Icon bitmap missing from the patch (1.2 KB) Mateusz Loskot -, 2008-08-27 05:09 AM

qgis-ogr_converter-register-r9195.patch Magnifier - Patch removing redundant test of number of registered OGR drivers, after QGIS's OGR registrar function introduced (1.15 KB) Mateusz Loskot -, 2008-08-27 03:14 PM

History

#1 Updated by Marco Hugentobler over 16 years ago

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

#2 Updated by Mateusz Loskot - over 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.

#3 Updated by Mateusz Loskot - over 16 years ago

I've noticed the plugin has been submitted to the SVN trunk (27113fca (SVN r9192)) and added to Debian packaging (455873d7 (SVN r9193))

#4 Updated by Mateusz Loskot - over 16 years ago

Second patch already in trunk (29b72b48 (SVN r9198))

#5 Updated by Marco Hugentobler over 16 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

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

#6 Updated by Anonymous over 15 years ago

Milestone Version 1.0.1 deleted

Also available in: Atom PDF