#
# Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

otb_module_test()

set(OTBKMZWriterTests
otbKMZWriterTestDriver.cxx
otbKmzProductWriter.cxx
)

add_executable(otbKMZWriterTestDriver ${OTBKMZWriterTests})
target_link_libraries(otbKMZWriterTestDriver ${OTBKMZWriter-Test_LIBRARIES})
otb_module_target_label(otbKMZWriterTestDriver)

# Tests Declaration

otb_add_test(NAME ioTvKmzProductWriterWithGCP COMMAND otbKMZWriterTestDriver
  otbKmzProductWriter
  ${INPUTDATA}/Haiti1.jpeg
  ${INPUTDATA}/DEM/srtm_directory
  ${TEMP}/ioTuHaitiKmzProduct.kmz
  1980.000000 1986.000000 -72.351257 18.555075 0.000000
  1963.000000 1944.000000 -72.352051 18.556946 0.000000
  2078.000000 1566.000000 -72.346130 18.574358 0.000000
  2154.000000 1430.000000 -72.342377 18.580441 0.000000
  2432.000000 1408.000000 -72.328964 18.581335 0.000000
  2558.000000 934.000000 -72.322571 18.602974 0.000000
  3492.000000 1397.000000 -72.278343 18.580887 0.000000
  2890.000000 1439.000000 -72.306908 18.579464 0.000000
  2098.000000 2469.000000 -72.345741 18.532839 0.000000
  1941.000000 2473.000000 -72.353317 18.532595 0.00000
  1644.000000 2409.000000 -72.367691 18.535810 0.000000
  1440.000000 2448.000000 -72.377457 18.534243 0.000000
  687.000000 2005.000000 -72.413315 18.554974 0.000000
  741.000000 2366.000000 -72.410934 18.538496 0.000000
  855.000000 2802.000000 -72.405739 18.518456 0.000000
  1936.000000 2855.000000 -72.353920 18.515240 0.000000
  3338.000000 2824.000000 -72.286240 18.515160 0.000000
  3715.000000 1772.000000 -72.267570 18.563681 0.000000
  3676.000000 1580.000000 -72.269203 18.572529 0.000000
  3395.000000 931.000000 -72.282402 18.602425 0.000000
  3426.000000 856.000000 -72.280792 18.605862 0.000000
  2822.000000 707.000000 -72.309692 18.613203 0.000000
  1891.000000 360.000000 -72.354301 18.629776 0.000000
  3989.000000 2639.000000 -72.255020 18.523664 0.000000
  417.000000 2317.000000 -72.426552 18.540876 0.000000
  )


otb_add_test(NAME ioTvKmzProductWriterWithGCP_Logo_Legend COMMAND otbKMZWriterTestDriver
  otbKmzProductWriterWithLogoAndLegend
  ${INPUTDATA}/Haiti1.jpeg
  ${INPUTDATA}/cnes.png
  ${INPUTDATA}/otb_big.png
  ${INPUTDATA}/DEM/srtm_directory
  ${TEMP}/ioTuHaitiKmzProductWithLogoAndLegend.kmz
  1980.000000 1986.000000 -72.351257 18.555075 0.000000
  1963.000000 1944.000000 -72.352051 18.556946 0.000000
  2078.000000 1566.000000 -72.346130 18.574358 0.000000
  2154.000000 1430.000000 -72.342377 18.580441 0.000000
  2432.000000 1408.000000 -72.328964 18.581335 0.000000
  2558.000000 934.000000 -72.322571 18.602974 0.000000
  3492.000000 1397.000000 -72.278343 18.580887 0.000000
  2890.000000 1439.000000 -72.306908 18.579464 0.000000
  2098.000000 2469.000000 -72.345741 18.532839 0.000000
  1941.000000 2473.000000 -72.353317 18.532595 0.00000
  1644.000000 2409.000000 -72.367691 18.535810 0.000000
  1440.000000 2448.000000 -72.377457 18.534243 0.000000
  687.000000 2005.000000 -72.413315 18.554974 0.000000
  741.000000 2366.000000 -72.410934 18.538496 0.000000
  855.000000 2802.000000 -72.405739 18.518456 0.000000
  1936.000000 2855.000000 -72.353920 18.515240 0.000000
  3338.000000 2824.000000 -72.286240 18.515160 0.000000
  3715.000000 1772.000000 -72.267570 18.563681 0.000000
  3676.000000 1580.000000 -72.269203 18.572529 0.000000
  3395.000000 931.000000 -72.282402 18.602425 0.000000
  3426.000000 856.000000 -72.280792 18.605862 0.000000
  2822.000000 707.000000 -72.309692 18.613203 0.000000
  1891.000000 360.000000 -72.354301 18.629776 0.000000
  3989.000000 2639.000000 -72.255020 18.523664 0.000000
  417.000000 2317.000000 -72.426552 18.540876 0.000000
  )
set_property(TEST ioTvKmzProductWriterWithGCP_Logo_Legend PROPERTY DEPENDS ioTvKmzProductWriterWithGCP)

