Feature request #1249
Submission of OGR Layer Converter plugin
|Pull Request or Patch supplied:||Resolution:||fixed|
|Easy fix?:||No||Copied to github as #:||11309|
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).
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...
#1 Updated by Marco Hugentobler about 13 years ago
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.
#2 Updated by Mateusz Loskot - about 13 years ago
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.