# vtkIOGDAL and vtkIOGeoJSON

**URL:** https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103
**Category:** Support
**Created:** [January 23, 2019, 3:45pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103 "2019-01-23T15:45:38Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 23, 2019, 3:45pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/1 "2019-01-23T15:45:38Z")

</div>

Hi,

I’m trying to build this project [GitHub - OpenGeoscience/vtkMap: vtkMap](https://github.com/OpenGeoscience/vtkMap) with all options (GDAL and GeoJSON extensions) under Centos 7.

The CMake configuration failed :

> /usr/lib64/cmake/vtk/vtkModuleAPI.cmake:120: error: Requested modules not available: vtkIOGDAL vtkIOGeoJSON /usr/lib64/cmake/vtk/VTKConfig.cmake:89 (vtk\_module\_config) CMakeLists.txt:76 (find\_package)

Where can I find vtkIOGDAL and vtkIOGeoJSON ? is it possible to to add them to the VTK “package” ?

Thanks.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 23, 2019, 6:26pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/2 "2019-01-23T18:26:13Z")

</div>

You’ll need to enable them in the VTK build. They are disabled by default. Passing `-DModule_vtkIOGDAL=ON` and `-DModule_vtkIOGeoJSON=ON` when configuring VTK should enable them.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 24, 2019, 11:28am UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/3 "2019-01-24T11:28:50Z")

</div>

Thank you for your reply. Unfortunately, I’m using the VTK installed by “yum” (CentOS packages).

BTW, can you please tell me what is the utility of of vtkIOGDAL and vtkIOGeoJSON classes ? Are these classes readers ?

Thanks.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 24, 2019, 1:16pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/4 "2019-01-24T13:16:43Z")

</div>

Then that VTK doesn’t provide GDAL or GeoJSON support. The names listed are called “modules” and contain various classes used to read and write (the `IO` part) GDAL and GeoJSON formatted files. You’ll have to compile VTK yourself if you need those modules since it seems that the EPEL package doesn’t build them. I would suggest either 8.1.2 or one of the 8.2.0 rc releases rather than `master` since big changes have landed there that `vtkMap` is unlikely to have been updated to support yet.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 24, 2019, 2:14pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/5 "2019-01-24T14:14:54Z")

</div>

OK understood. Thanks.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 29, 2019, 5:29pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/6 "2019-01-29T17:29:49Z")

</div>

Right now, I’m building VTK with GDAL and GeoJSON modules.

Do you know please how to hint CMake of my new VTK build path ?

Thanks

---

<div class="post-metadata">

### Author: ![John\_Tourtellott](https://discourse.vtk.org/user_avatar/discourse.vtk.org/john_tourtellott/32/8391_2.png) [@John\_Tourtellott](https://discourse.vtk.org/u/John_Tourtellott)
#### Post date: [January 29, 2019, 5:55pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/7 "2019-01-29T17:55:22Z")

</div>

When configuring vtkMap, set the variable `VTK_DIR` to the VTK build path. You can do that from the command-line using the -D command. Or when you first try configuring, cmake will create that variable and you can then set it using ccmake or cmake-gui.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 29, 2019, 6:10pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/8 "2019-01-29T18:10:45Z")

</div>

Thanks, I will try that. If it doesn’t work, I will try to modify the CMakeLists.txt of the vtkMap project to use the VTK installed with “yum” and the vtkIOGDAL and vtkIOGeoJSON that I built manually.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 29, 2019, 6:48pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/9 "2019-01-29T18:48:45Z")

</div>

> [@embeddedmz](#):
>
> I will try to modify the CMakeLists.txt of the vtkMap project to use the VTK installed with “yum” and the vtkIOGDAL and vtkIOGeoJSON that I built manually.

That is unlikely to work. You’d need to match the version and compiler and a variety of other options used by the system VTK. All of VTK really should come from a single place.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 30, 2019, 8:46am UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/10 "2019-01-30T08:46:23Z")

</div>

You’re right.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 30, 2019, 9:30am UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/11 "2019-01-30T09:30:59Z")

</div>

Thanks, it works !

However, with that change, it created a little problem with Qt in vtkMap : Compiler can’t find QMainWindow.

I fixed it with using include\_directories and adding Qt libs (because in Release mode, I don’t need to add Qt libs, however in Debug, QMainWindow is still not found except if I add Qt libs in target\_link\_libraries CMake is crazy !)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 30, 2019, 7:51pm UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/12 "2019-01-30T19:51:56Z")

</div>

> except if I add Qt libs in target\_link\_libraries CMake is crazy !)

Qt5 provides its targets with “usage requirements”. These can include things like include directories, compile definitions, C++ standard requirements, etc. Instead of having to call a bunch of different `target_do_something` functions, CMake offers it all through `target_link_libraries` (the name is unchanged for historical reasons and general compatibility). [CMake documentation for usage requirements](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements).

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [January 31, 2019, 11:17am UTC](https://discourse.vtk.org/t/vtkiogdal-and-vtkiogeojson/103/13 "2019-01-31T11:17:37Z")

</div>

Thanks for the explanation !
