Skip to content

Commit 17a32e8

Browse files
committed
Geopackage Export plugin
* Fix for incorrect setup of CRS for output * Fix for Windows build
1 parent f3803bc commit 17a32e8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

plugins/uiGeopackageExport/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ if (UNIX)
44
list( APPEND OD_MODULE_EXTERNAL_LIBS ${OpendTect_DIR}/${OD_EXEC_OUTPUT_RELPATH}/libCRS.so )
55
SET(CMAKE_INSTALL_RPATH "\$ORIGIN/")
66
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
7+
else()
8+
list( APPEND OD_MODULE_EXTERNAL_LIBS ${OpendTect_DIR}/${OD_EXEC_OUTPUT_RELPATH}/Release/CRS.lib )
79
endif()
8-
910
SET(OD_MODULE_DEPS uiODMain uiWGMHelp)
11+
1012
SET(OD_IS_PLUGIN yes)
1113
SET(OD_MODULE_SOURCES
1214
uigeopackageexportmainwin.cc

plugins/uiGeopackageExport/uigeopackagewriter.cc

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ uiGeopackageWriter::uiGeopackageWriter( const char* filename, bool append )
3636
if (SI().getCoordSystem()->isProjection()) {
3737
const Coords::ProjectionBasedSystem* const proj = dynamic_cast<const Coords::ProjectionBasedSystem* const>(SI().getCoordSystem().ptr());
3838
poSRS_= new OGRSpatialReference();
39-
poSRS_->importFromEPSG(proj->getProjection()->authCode().id());
39+
if (poSRS_->importFromProj4(proj->getProjection()->defStr()) != OGRERR_NONE) {
40+
BufferString tmp("uiGeopackageWriter::uiGeopackageWriter - setting CRS in output file failed \n");
41+
tmp += "Survey CRS: ";
42+
tmp += SI().getCoordSystem()->summary();
43+
tmp += "\n";
44+
ErrMsg(tmp);
45+
}
4046
open(filename);
4147
} else {
4248
BufferString crsSummary("uiGeopackageWriter::uiGeopackageWriter - unrecognised CRS: ");

0 commit comments

Comments
 (0)