Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
fail-fast: true
matrix:
include:
- os: ubuntu-22.04
- os: [ubuntu-22.04, ubuntu-24.04]

runs-on: ${{ matrix.os }}

Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/) et ce pr

## [Unreleased]

## [3.1.0] - 2026-06-25

### Added

- Compilation des artefacts sous ubuntu 24.04 (compatible debian 13 / trixie)
- `Colorize` : Ajout d'un style colorize permettant de remplacer une couleur en une autre avec une possibilité de transparence.

### Fixed

- `Boundingbox` : Mise en place de valeur maximale et minimale pour les bbox en wms-r.
- `Style` : Ajout des préfix ogc pour le title et l'abstract sur le wmts

## [3.0.0] - 2026-03-12

### Added
Expand Down Expand Up @@ -213,6 +225,7 @@ Les librairies sont gérées de manière indépendantes, conditionnées pour êt

[1.0.3]: https://github.com/rok4/core-cpp/releases/tag/1.0.3

[Unreleased]: https://github.com/rok4/core-cpp/compare/3.0.0...HEAD
[Unreleased]: https://github.com/rok4/core-cpp/compare/3.1.0...HEAD
[3.1.0]: https://github.com/rok4/core-cpp/compare/3.0.0...3.1.0

[3.0.0]: https://github.com/rok4/core-cpp/compare/2.0.6...3.0.0
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ if(CEPH_ENABLED)
else(CEPH_ENABLED)
set(CPACK_PACKAGE_FILE_NAME "librok4-base-${VERSION}-${CPACK_SYSTEM_NAME}-${BUILD_ARCHITECTURE}")
endif(CEPH_ENABLED)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGING_INSTALL_PREFIX "/")

set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_PACKAGE_VENDOR "IGN")
set(CPACK_PACKAGE_CONTACT "IGN - Géoportail (<tout_rdev@ign.fr>)")

if(CPACK_SYSTEM_NAME AND CPACK_SYSTEM_NAME STREQUAL "ubuntu-20.04" OR CPACK_SYSTEM_NAME STREQUAL "ubuntu-22.04")
if(CPACK_SYSTEM_NAME AND CPACK_SYSTEM_NAME STREQUAL "ubuntu-20.04" OR CPACK_SYSTEM_NAME STREQUAL "ubuntu-22.04" OR CPACK_SYSTEM_NAME STREQUAL "ubuntu-24.04")
set(CPACK_GENERATOR "DEB;TGZ")

# Debian
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Installations système requises (listées dans le paquet debian, installées ave

Depuis [GitHub](https://github.com/rok4/core-cpp/releases/) :
```
curl -o librok4-dev.deb https://github.com/rok4/core-cpp/releases/download/x.y.z/librok4-base-x.y.z-ubuntu-20.04-amd64.deb
curl -o librok4-dev.deb https://github.com/rok4/core-cpp/releases/download/x.y.z/librok4-base-x.y.z-ubuntu-24.04-amd64.deb
# or, with ceph driver
curl -o librok4-dev.deb https://github.com/rok4/core-cpp/releases/download/x.y.z/librok4-ceph-x.y.z-ubuntu-20.04-amd64.deb
curl -o librok4-dev.deb https://github.com/rok4/core-cpp/releases/download/x.y.z/librok4-ceph-x.y.z-ubuntu-24.04-amd64.deb

apt install ./librok4-dev.deb
```
Expand Down
109 changes: 109 additions & 0 deletions include/rok4/style/Colorize.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* Copyright © (2011) Institut national de l'information
* géographique et forestière
*
* Géoportail SAV <contact.geoservices@ign.fr>
*
* This software is a computer program whose purpose is to publish geographic
* data using OGC WMS and WMTS protocol.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
*
* knowledge of the CeCILL-C license and that you accept its terms.
*/

/**
* \file Colorize.h
** \~french
* \brief D�finition de la classe Colorize
** \~english
* \brief Define class Colorize
*/


#pragma once

#include "rok4/utils/Configuration.h"

#include <stdint.h>
#include <vector>
#include <map>
#include <stddef.h>

class Colorize : public Configuration
{
public:
/** \~french
* \brief tolerance : seuil de tolérance pour gérer les teintes de blanc plus larges
** \~english
* \brief tolerance : tolerance threshold for managing wider shades of white
*/
int tolerance;

/** \~french
* \brief source : valeur visée en entrée
** \~english
* \brief source : input target value
*/
std::vector<int> source;

/** \~french
* \brief destination : valeur visée en sortie
** \~english
* \brief destination : output target value
*/
std::vector<int> destination;

/** \~french
* \brief noData : valeur de nodata pour l'image source
** \~english
* \brief noData : value of nodata for the source image
*/
std::vector<int> input_nodata_value;

/** \~french
* \brief noData : valeur de nodata pour le colorize
** \~english
* \brief noData : value of nodata for the colorize
*/
float colorize_nodata_value;

/**
* \~french
* \brief Constructeurs avec des arguments
* \~english
* \brief Constructor with arguments
*/
Colorize(json11::Json doc);

/**
* \~french
* \brief Destructeur
* \~english
* \brief Destructor
*/
virtual ~Colorize();
};
48 changes: 45 additions & 3 deletions include/rok4/style/Style.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Style;
#include "rok4/style/Estompage.h"
#include "rok4/style/Aspect.h"
#include "rok4/style/Terrainrgb.h"
#include "rok4/style/Colorize.h"
#include "rok4/enums/Interpolation.h"
#include "rok4/utils/Configuration.h"
#include "rok4/utils/StoragePool.h"
Expand Down Expand Up @@ -169,6 +170,11 @@ private :
* \~english \brief Define wether the server must compute a RGB terrain
*/
Terrainrgb* terrainrgb;
/**
* \~french \brief Définit si un calcul de white to alpha doit être appliqué
* \~english \brief Define wether the server must compute a white to alpha
*/
Colorize* colorize;

/**
* \~french \brief Valeur de nodata attendue dans les données en entrée
Expand Down Expand Up @@ -226,9 +232,16 @@ private :
* \~english \brief Style is allowed ?
*/
bool handle (int spp) {
if (estompage_defined() || pente_defined() || aspect_defined() || terrainrgb_defined()) {
if (estompage_defined() || pente_defined() || aspect_defined() || terrainrgb_defined() ) {
return (spp == 1);
}
else if (colorize_defined()) {
return (spp == colorize->source.size());
}
else if (palette && ! palette->is_empty()) {
return (spp == 1);
} else {
// identité
return true;
}
}
Expand Down Expand Up @@ -258,6 +271,14 @@ private :
return orig_channels;
}
}
else if (colorize_defined()){
if (orig_channels ==3 || orig_channels ==4){
return colorize->destination.size();
}
else {
return orig_channels;
}
}
else {
if (estompage_defined() || pente_defined() || aspect_defined()) {
return 1;
Expand All @@ -274,7 +295,7 @@ private :
* \~english \brief Which sample format after style
*/
SampleFormat::eSampleFormat get_sample_format (SampleFormat::eSampleFormat sf) {
if ((palette && ! palette->is_empty()) || terrainrgb_defined()) {
if ((palette && ! palette->is_empty()) || terrainrgb_defined() || colorize_defined()) {
return SampleFormat::UINT8;
} else {
return sf;
Expand Down Expand Up @@ -314,7 +335,7 @@ private :
return false;
}

if (estompage_defined() || pente_defined() || aspect_defined() || terrainrgb_defined()) {
if (estompage_defined() || pente_defined() || aspect_defined() || terrainrgb_defined() || colorize_defined()) {
return false;
} else {
return true;
Expand Down Expand Up @@ -475,6 +496,27 @@ private :
inline Terrainrgb* get_terrainrgb() {
return terrainrgb;
}

/**
* \~french
* \brief Return vrai si le style est un white to alpha
* \return bool
* \~english
* \brief Return true if the style is an white to alpha
* \return bool
*/
inline bool colorize_defined() {
return (colorize != 0);
}
/**
* \~french
* \brief Retourne le white to alpha
* \~english
* \brief Return white to alpha
*/
inline Colorize* get_colorize() {
return colorize;
}


/**
Expand Down
8 changes: 4 additions & 4 deletions include/rok4/utils/BoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ class BoundingBox {

if (geographical) {
ptree& node = parent.add("EX_GeographicBoundingBox", "");
node.add("westBoundLongitude", xmin);
node.add("eastBoundLongitude", xmax);
node.add("southBoundLatitude", ymin);
node.add("northBoundLatitude", ymax);
node.add("westBoundLongitude", std::max(xmin,-180.0));
node.add("eastBoundLongitude", std::min(xmax,180.0));
node.add("southBoundLatitude", std::max(ymin,-90.0));
node.add("northBoundLatitude", std::min(ymax,90.0));
} else {
ptree& node = parent.add("BoundingBox", "");
node.add("<xmlattr>.CRS", crs);
Expand Down
Loading
Loading