Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] update projections files for docker and tests #72

Merged
merged 3 commits into from
May 9, 2023
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

CHANGED:
- GET /admin/1.0.0/services/{service}/projections/{projection} renvoit aussi les paramétres de la projection
- Projections were added for France and a file was created to separate them from the world wide projections

## 2.1.1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"projectionsList": [
{
"id": "EPSG:4326",
"parameters": "+proj=longlat +datum=WGS84 +no_defs"
},
{
"id": "EPSG:2154",
"parameters": "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
Expand All @@ -27,6 +23,14 @@
{
"id": "EPSG:3857",
"parameters": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"
},
{
"id": "EPSG:32620",
"parameters": "+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs +type=crs"
},
{
"id": "EPSG:4467",
"parameters": "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs"
}
]
}
8 changes: 8 additions & 0 deletions docker/config/projections/world.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"projectionsList": [
{
"id": "EPSG:4326",
"parameters": "+proj=longlat +datum=WGS84 +no_defs"
}
]
}
2 changes: 1 addition & 1 deletion documentation/configuration/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ On peut trouver un [exemple](../../docker/config/cors.json) de ce fichier au for

Le fichier *service.json* indique un dossier de projections. Ce dossier peut contenir plusieurs fichiers JSON. Ces fichiers seront lus, indépendamment de leur extension, pour obtenir les informations nécessaires permettant à [PROJ4](http://proj4js.org/) d'effectuer des reprojections.

On peut trouver un [exemple](../../docker/config/projections/projection.json) de ce fichier et le [modèle](./projections/projection_model.yaml) au format YAML.
On peut trouver un [exemple](../../docker/config/projections/world.json) de ce fichier et le [modèle](./projections/projection_model.yaml) au format YAML.

## Les sources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,97 +14,91 @@ Feature: Road2 configuration

Scenario: [projection.json] JSON vide
Given a valid configuration
And without attribute "projectionsList" in "projection.json" projection
And without attribute "projectionsList" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La fichier des projections ne contient pas de liste"

Scenario: [projection.json] projectionsList absent
Given a valid configuration
And without attribute "projectionsList" in "projection.json" projection
And with parameter "test" for attribute "projections" in "projection.json" projection
And without attribute "projectionsList" in "world.json" projection
And with parameter "test" for attribute "projections" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La fichier des projections ne contient pas de liste"

Scenario: [projection.json] projectionsList different
Given a valid configuration
And with parameter "test" for attribute "projectionsList" in "projection.json" projection
And with parameter "test" for attribute "projectionsList" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "L'attribut projectionsList de la configuration n'est pas un tableau"

Scenario: [projection.json] projectionsList est un tableau vide
Given a valid configuration
And without attribute "projectionsList.[6]" in "projection.json" projection
And without attribute "projectionsList.[5]" in "projection.json" projection
And without attribute "projectionsList.[4]" in "projection.json" projection
And without attribute "projectionsList.[3]" in "projection.json" projection
And without attribute "projectionsList.[2]" in "projection.json" projection
And without attribute "projectionsList.[1]" in "projection.json" projection
And without attribute "projectionsList.[0]" in "projection.json" projection
And without attribute "projectionsList.[0]" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "L'attribut projectionsList de la configuration est un tableau vide"

Scenario: [projection.json] une configuration de projection vide
Given a valid configuration
And without attribute "projectionsList.[0].id" in "projection.json" projection
And without attribute "projectionsList.[0].parameters" in "projection.json" projection
And without attribute "projectionsList.[0].id" in "world.json" projection
And without attribute "projectionsList.[0].parameters" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La configuration de la projection n'a pas d'id"

Scenario: [projection.json] une configuration de projection sans id
Given a valid configuration
And without attribute "projectionsList.[0].id" in "projection.json" projection
And without attribute "projectionsList.[0].id" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La configuration de la projection n'a pas d'id"

Scenario: [projection.json] une configuration de projection sans parametre
Given a valid configuration
And without attribute "projectionsList.[0].parameters" in "projection.json" projection
And without attribute "projectionsList.[0].parameters" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La configuration de la projection n'a pas de parametres"

Scenario: [projection.json] une configuration de projection différentes
Given a valid configuration
And with parameter "test" for attribute "projectionsList.[0]" in "projection.json" projection
And with parameter "test" for attribute "projectionsList.[0]" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La configuration de la projection n'a pas d'id"

Scenario: [projection.json] projection.id différent pour une projection inutilisée dans les topologies
Given a valid configuration
And with parameter "test" for attribute "projectionsList.[2].id" in "projection.json" projection
And with parameter "test" for attribute "projectionsList.[2].id" in "france.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 0

Scenario: [projection.json] projection.id différent pour une projection utilisée dans les topologies
Given a valid configuration
And with parameter "test" for attribute "projectionsList.[0].id" in "projection.json" projection
And with parameter "test" for attribute "projectionsList.[0].id" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1

Scenario: [projection.json] projection.id vide
Given a valid configuration
And with parameter "" for attribute "projectionsList.[2].id" in "projection.json" projection
And with parameter "" for attribute "projectionsList.[2].id" in "france.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La configuration de la projection n'a pas d'id"

#TODO : Voir si on peut mieux vérifier
Scenario: [projection.json] projection.parameters différent
Given a valid configuration
And with parameter "test" for attribute "projectionsList.[0].parameters" in "projection.json" projection
And with parameter "test" for attribute "projectionsList.[0].parameters" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 0

Scenario: [projection.json] projection.parameters vide
Given a valid configuration
And with parameter "" for attribute "projectionsList.[0].parameters" in "projection.json" projection
And with parameter "" for attribute "projectionsList.[0].parameters" in "world.json" projection
When I test the configuration
Then the configuration analysis should give an exit code 1
Then the server log should contain "La configuration de la projection n'a pas de parametres"
4 changes: 2 additions & 2 deletions test/unit/mocha/geography/testsProjectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Test de la classe ProjectionManager', function() {
describe('Vérification d\'un fichier de projections', function() {

let projManager = new ProjectionManager();
let file = "/home/docker/app/test/unit/mocha/config/projections/projection.json";
let file = "/home/docker/app/test/unit/mocha/config/projections/france.json";

it('checkProjectionFile()', function() {
assert.equal(projManager.checkProjectionFile(file), true);
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('Test de la classe ProjectionManager', function() {
describe('Chargement d\'un fichier de projections', function() {

let projManager = new ProjectionManager();
let file = "/home/docker/app/test/unit/mocha/config/projections/projection.json";
let file = "/home/docker/app/test/unit/mocha/config/projections/france.json";

it('loadProjectionFile()', function() {
assert.equal(projManager.loadProjectionFile(file), true);
Expand Down
Loading