diff --git a/DialogTools/ExportDataDlg.cpp b/DialogTools/ExportDataDlg.cpp index 85d4f330e..6d0f5c8b4 100644 --- a/DialogTools/ExportDataDlg.cpp +++ b/DialogTools/ExportDataDlg.cpp @@ -587,11 +587,15 @@ ExportDataDlg::CreateOGRLayer(wxString& ds_name, bool is_table, new_ref.importFromEPSG(4326); valid_input_crs = true; } - if (spatial_ref && (valid_input_crs && !spatial_ref->IsSame(&new_ref))) { - OGRCoordinateTransformation *poCT; - poCT = OGRCreateCoordinateTransformation(spatial_ref, &new_ref); - for (size_t i=0; i < ogr_geometries.size(); i++) { - ogr_geometries[i]->transform(poCT); + if (ogr_geometries.size() > 0 && valid_input_crs) { + if (spatial_ref && spatial_ref->IsSame(&new_ref) == false) { + // transform geometries from old CRS to new CRS + OGRCoordinateTransformation *poCT; + poCT = OGRCreateCoordinateTransformation(spatial_ref, &new_ref); + for (size_t i=0; i < ogr_geometries.size(); i++) { + ogr_geometries[i]->transform(poCT); + } + OGRCoordinateTransformation::DestroyCT(poCT); } spatial_ref = &new_ref; // use new CRS } diff --git a/version.h b/version.h index 2af793a7e..dc8e8d4b5 100644 --- a/version.h +++ b/version.h @@ -5,7 +5,7 @@ namespace Gda { const int version_subbuild = 2; const int version_year = 2019; const int version_month = 10; - const int version_day = 10; + const int version_day = 15; const int version_night = 0; const int version_type = 2; // 0: alpha, 1: beta, 2: release }