Giter Club home page Giter Club logo

Comments (32)

mrgloom avatar mrgloom commented on August 18, 2024 2

Seems it works.
diff.txt

git clone https://github.com/geo-data/cesium-terrain-builder.git
cd cesium-terrain-builder
git reset --hard 8dd633c13582956a2bfdd9f447f62bde04682b9a
git apply diff.patch
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
make all

from cesium-terrain-builder.

icemagno avatar icemagno commented on August 18, 2024 1

Solved with sudo apt install -y gdal-bin python-gdal libgdal-dev

from cesium-terrain-builder.

markerikson avatar markerikson commented on August 18, 2024 1

As best as I can tell, this only compiles with GDAL 2.1.x, because of the overview function described in #51 .

Would be great if we can figure out how to get it to compile with GDAL 2.2.x instead.

from cesium-terrain-builder.

markerikson avatar markerikson commented on August 18, 2024 1

So it seems that GDALCreateOverviewDataset both had a signature change, and is not exported any more in 2.2, per GDAL changeset 37723. Not sure why that was changed, but it was.

There's some relevant discussion in rasterio/rasterio#1161 . Still trying to go through this.

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024 1

My workaround was to include the gdaloverviewdataset.cpp source file in GDALTiler.cpp just before "getOverviewDataset" declaration. I build with GDAL 2.3.x in Windows.

LINE204: #include "gdaloverviewdataset.cpp"

But obviously you have to download the GDAL sources

from cesium-terrain-builder.

ediebold avatar ediebold commented on August 18, 2024 1

Okay, thanks to the fix in #55 to allow for 2.1 support, I was able to build using the 2.1.3 GDAL library from the ubuntugis stable ppa.

Thanks!

from cesium-terrain-builder.

gberaudo avatar gberaudo commented on August 18, 2024

Latest ctb version has a fix for a similar issue.
See #14.

from cesium-terrain-builder.

MCerk avatar MCerk commented on August 18, 2024

I have used now the latest ctp version and I pass that error. However now it can't find the GDALOpenEx function.

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found GDAL: /usr/local/lib/libgdal.so
-- Looking for GDALOpenEx in gdal
-- Looking for GDALOpenEx in gdal - not found
CMake Error at src/CMakeLists.txt:10 (message):
The GDAL version must be one that implements RFC 46 (GDAL/OGR unification)
i.e. >= 2.0.0

from cesium-terrain-builder.

gberaudo avatar gberaudo commented on August 18, 2024

from cesium-terrain-builder.

MCerk avatar MCerk commented on August 18, 2024

I have installed GDAL from source yesterday (see my first post). This is the list (ls) of the file above:

lrwxrwxrwx 1 root root 17 Feb 15 23:51 /usr/local/lib/libgdal.so -> libgdal.so.1.18.0

By installing GDAL I did not pass any parameters (./configure), neither did I by CTP (cmake).

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

I'm having similar issues tring to build the latest git clone of cesium-terrain-builder. On my system i have gdal installed from its git-svn mirror

My gdal version :

gdalinfo --version
GDAL 2.0.0dev, released 2014/04/16

I installed gdal on a non standard prefix, this is the results of gdal-config --libs :

which gdal-config 
/home/epilib/Envs/env1/bin//gdal-config
gdal-config --libs
-L/home/epilib/Envs/env1/lib -lgdal

In the cesium-terrain-builder cmake configuration i have the following :

 GDAL_CONFIG                      /home/epilib/Envs/env1/bin/gdal-config                             
 GDAL_INCLUDE_DIR                 /home/epilib/Envs/env1/include                                     
 GDAL_LIBRARY                     /home/epilib/Envs/env1/lib/libgdal.so 

But the cmake configure ends with the following error :

 CMake Error at src/CMakeLists.txt:10 (message):
   The GDAL version must be one that implements RFC 46 (GDAL/OGR unification)
   i.e.  >= 2.0.0

In my /lib ls ../lib/ | grep gdal directory i have :


gdalplugins
libgdal.a
libgdal.la
libgdal.so
libgdal.so.1
libgdal.so.1.17.1
libgdal.so.1.18.0

that's my gdal.pc cat ../lib/pkgconfig/gdal.pc:

CONFIG_VERSION=2.0.0
CONFIG_INST_PREFIX=/home/epilib/Envs/env1
CONFIG_INST_LIBS=-L/home/epilib/Envs/env1/lib -lgdal
CONFIG_INST_CFLAGS=-I/home/epilib/Envs/env1/include
CONFIG_INST_DATA=/home/epilib/Envs/env1/share/gdal/data
prefix=${CONFIG_INST_PREFIX}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${exec_prefix}/include
datadir=${CONFIG_INST_DATA}

Name: libgdal
Description: Geospatial Data Abstraction Library
Version: ${CONFIG_VERSION}
Libs: ${CONFIG_INST_LIBS}
Cflags: ${CONFIG_INST_CFLAGS}

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

i had to remove the check and ctb built fine without errors/worning. I'll try to generate tiles and see if any trouble (i'm using gdal from svn trubk)

from cesium-terrain-builder.

mrgloom avatar mrgloom commented on August 18, 2024

Any update on this?

Seems I have same problem here #45
Also similar problem here #6

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

I'm facing the same problem:

epinux@Ubuntu-1604-xenial-64-minimal:~/dev/cesium-terrain-builder/build$ make
Scanning dependencies of target ctb
[  5%] Building CXX object src/CMakeFiles/ctb.dir/GDALTile.cpp.o
[ 11%] Building CXX object src/CMakeFiles/ctb.dir/GDALTiler.cpp.o
/home/epinux/dev/cesium-terrain-builder/src/GDALTiler.cpp: In function ‘void* getOverviewDataset(GDALDatasetH, GDALTransformerFunc, void*)’:
/home/epinux/dev/cesium-terrain-builder/src/GDALTiler.cpp:249:87: error: too many arguments to function ‘GDALDataset* GDALCreateOverviewDataset(GDALDataset*, int, int)’
                   poSrcOvrDS = GDALCreateOverviewDataset( poSrcDS, iOvr, FALSE, FALSE );
                                                                                       ^
In file included from /home/epinux/dev/cesium-terrain-builder/src/GDALTiler.cpp:27:0:
/usr/local/include/gdal_priv.h:1566:14: note: declared here
 GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
              ^
src/CMakeFiles/ctb.dir/build.make:86: recipe for target 'src/CMakeFiles/ctb.dir/GDALTiler.cpp.o' failed
make[2]: *** [src/CMakeFiles/ctb.dir/GDALTiler.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/ctb.dir/all' failed
make[1]: *** [src/CMakeFiles/ctb.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

this happen with gdal trunk as well as with gdal installed from the ubuntu-gis repository:

/usr/bin/gdal-config --version
2.2.2

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

To fix the build, just remove the extra argument. Not sure it will affect the library behaviour... in GDALTiler.cpp:249

---  poSrcOvrDS = GDALCreateOverviewDataset( poSrcDS, iOvr, FALSE, FALSE );
+++ poSrcOvrDS = GDALCreateOverviewDataset( poSrcDS, iOvr, FALSE );

testing now.

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

Hi, I had the same problem, @epifanio is right, I removed the extra argument and CTB runs fine

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

Testing the change, ctb-tile produced correct tiles. I'm using geo-data/cesium-terrain-builder:master @ahuarte47 , now switching on your fork to test #55 (/me feelling excytied!)

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

Just now I am changing the code to create the Json metadata file when the tile set is created first time. It avoids to execute CTB twice.

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

@ahuarte47 thanks! Quick OT question: To test the quantized-mesh output before the PR will be merged, is https://github.com/ahuarte47/cesium-terrain-builder.git [branch:master-quantized-mesh] the right repo?

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

Yes, direct link here

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

Hi @epifanio, I updated the PR to can build with different versions of GDAL+GDALCreateOverviewDataset.

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

Thanks @ahuarte47 - Merged the PR on my fork. Tested, it builds with gdal maser and tiles are generated with no errors. I need to test this on underwater surfaces. How do you serve the tiles to cesium? Is cesium-terrain-server master what I need to use?

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

It is an option), but you can directly publish the directory in a Tomcat, Wildfly, IIS, or so on. Cesium can fetch the tiles via REST, you could read about it in TerrainCesiumProvider documentation.

from cesium-terrain-builder.

epifanio avatar epifanio commented on August 18, 2024

@ahuarte47 continuing the discussion on #55

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

ok

from cesium-terrain-builder.

ediebold avatar ediebold commented on August 18, 2024

@markerikson - moved here. I'm having trouble building since updating to GDAL 2.2.2, since it's not exporting the GDALCreateOverviewDataset function. Is there a fix?

from cesium-terrain-builder.

markerikson avatar markerikson commented on August 18, 2024

My workaround for now was to just build GDAL 2.1.4 myself, and compile CTB against that.

from cesium-terrain-builder.

mrgloom avatar mrgloom commented on August 18, 2024

I was using apt-get to install gdal on Ubuntu 14.04:

sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install -y gdal-bin python-gdal libgdal-dev

I get

../src/libctb.so: undefined reference to `GDALCreateOverviewDataset(GDALDataset*, int, int)'

with

ls /usr/lib/ | grep gdal
libgdal.a
libgdal.so
libgdal.so.20
libgdal.so.20.3.1
apt list --installed | grep gdal
gdal-bin/trusty,now 2.2.2+dfsg-1~trusty1 amd64 [installed]
gdal-data/trusty,now 2.2.2+dfsg-1~trusty1 all [installed,automatic]
libgdal-dev/trusty,now 2.2.2+dfsg-1~trusty1 amd64 [installed]
libgdal20/trusty,now 2.2.2+dfsg-1~trusty1 amd64 [installed,automatic]
python-gdal/trusty,now 2.2.2+dfsg-1~trusty1 amd64 [installed]
python3-gdal/trusty,now 2.2.2+dfsg-1~trusty1 amd64 [installed]
/usr/bin/gdal-config --version
2.2.2

Build log:

Cloning into 'cesium-terrain-builder'...
remote: Counting objects: 1071, done.
remote: Total 1071 (delta 0), reused 0 (delta 0), pack-reused 1071
Receiving objects: 100% (1071/1071), 260.28 KiB | 0 bytes/s, done.
Resolving deltas: 100% (763/763), done.
Checking connectivity... done.
HEAD is now at 8dd633c Fix building on Docker Hub.
-- The C compiler identification is GNU 4.9.4
-- The CXX compiler identification is GNU 4.9.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found GDAL: /usr/lib/libgdal.so  
-- Looking for GDALOpenEx in gdal
-- Looking for GDALOpenEx in gdal - found
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/temp/cesium-terrain-builder/build
Scanning dependencies of target ctb
[  9%] Building CXX object src/CMakeFiles/ctb.dir/GDALTile.cpp.o
[ 18%] Building CXX object src/CMakeFiles/ctb.dir/GDALTiler.cpp.o
[ 27%] Building CXX object src/CMakeFiles/ctb.dir/TerrainTiler.cpp.o
[ 36%] Building CXX object src/CMakeFiles/ctb.dir/TerrainTile.cpp.o
[ 45%] Building CXX object src/CMakeFiles/ctb.dir/GlobalMercator.cpp.o
[ 54%] Building CXX object src/CMakeFiles/ctb.dir/GlobalGeodetic.cpp.o
Linking CXX shared library libctb.so
[ 54%] Built target ctb
Scanning dependencies of target commander
[ 63%] Building C object deps/CMakeFiles/commander.dir/commander.c.o
Linking C static library libcommander.a
[ 63%] Built target commander
Scanning dependencies of target ctb-export
[ 72%] Building CXX object tools/CMakeFiles/ctb-export.dir/ctb-export.cpp.o
Linking CXX executable ctb-export
../src/libctb.so: undefined reference to `GDALCreateOverviewDataset(GDALDataset*, int, int)'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/ctb-export] Error 1
make[1]: *** [tools/CMakeFiles/ctb-export.dir/all] Error 2
make[1]: *** [tools/CMakeFiles/ctb-export.dir/all] Error 2
make: *** [all] Error 2

So, as I understand I need to install some 2.1.* gdal.

apt-cache show gdal-bin | grep Version
Version: 2.2.2+dfsg-1~trusty1
Version: 2.1.0+dfsg-1~trusty2
Version: 1.10.1+dfsg-5ubuntu1

I have tried 2.1.0:

sudo apt-get install libgdal20=2.1.0+dfsg-1~trusty2
sudo apt-get install gdal-bin=2.1.0+dfsg-1~trusty2
sudo apt-get install python-gdal=2.1.0+dfsg-1~trusty2
sudo apt-get install libgdal-dev=2.1.0+dfsg-1~trusty2

But it still give an error:

Cloning into 'cesium-terrain-builder'...
remote: Counting objects: 1071, done.
remote: Total 1071 (delta 0), reused 0 (delta 0), pack-reused 1071
Receiving objects: 100% (1071/1071), 260.28 KiB | 0 bytes/s, done.
Resolving deltas: 100% (763/763), done.
Checking connectivity... done.
HEAD is now at 8dd633c Fix building on Docker Hub.
-- The C compiler identification is GNU 4.9.4
-- The CXX compiler identification is GNU 4.9.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found GDAL: /usr/lib/libgdal.so  
-- Looking for GDALOpenEx in gdal
-- Looking for GDALOpenEx in gdal - found
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/temp/cesium-terrain-builder/build
Scanning dependencies of target ctb
[  9%] Building CXX object src/CMakeFiles/ctb.dir/GDALTile.cpp.o
[ 18%] Building CXX object src/CMakeFiles/ctb.dir/GDALTiler.cpp.o
/home/user/temp/cesium-terrain-builder/src/GDALTiler.cpp: In function \u2018void* getOverviewDataset(GDALDatasetH, GDALTransformerFunc, void*)\u2019:
/home/user/temp/cesium-terrain-builder/src/GDALTiler.cpp:249:79: error: too few arguments to function \u2018GDALDataset* GDALCreateOverviewDataset(GDALDataset*, int, int, int)\u2019
                   poSrcOvrDS = GDALCreateOverviewDataset( poSrcDS, iOvr, FALSE);
                                                                               ^
In file included from /home/user/temp/cesium-terrain-builder/src/GDALTiler.cpp:27:0:
/usr/include/gdal/gdal_priv.h:1396:22: note: declared here
 GDALDataset CPL_DLL* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
                      ^
make[2]: *** [src/CMakeFiles/ctb.dir/GDALTiler.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/ctb.dir/all] Error 2
make: *** [all] Error 2

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

This comment could help you

from cesium-terrain-builder.

mrgloom avatar mrgloom commented on August 18, 2024

Do you mean using using hack adding external .h .cpp files?

Does current master will compile with GDAL 2.2.*?
3b9394f

Also related #66

from cesium-terrain-builder.

ahuarte47 avatar ahuarte47 commented on August 18, 2024

Include #include "gdaloverviewdataset.cpp" just before of GDALCreateOverviewDataset call in GDALTiler.cpp

from cesium-terrain-builder.

meiyujack avatar meiyujack commented on August 18, 2024

Seems it works.
diff.txt

git clone https://github.com/geo-data/cesium-terrain-builder.git
cd cesium-terrain-builder
git reset --hard 8dd633c13582956a2bfdd9f447f62bde04682b9a
git apply diff.patch
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
make all

Thanks a lot!

from cesium-terrain-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.