Skip to content

Commit

Permalink
Merge pull request #51 from IGNF/v2.4.3
Browse files Browse the repository at this point in the history
V2.4.3
  • Loading branch information
vinsag authored Nov 19, 2021
2 parents c3a6fcb + a90f22d commit 7f8cbfe
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 375 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pour faire fonctionner API Carto, vous avez besoin de :

* [Node.js](https://nodejs.org) v6+ (utilisation de [nvm](https://github.com/creationix/nvm) recommandée)
* [Node.js](https://nodejs.org) v14+ (utilisation de [nvm](https://github.com/creationix/nvm) recommandée)
* PostgreSQL v9.4+
* PostGIS v2.1+
* [ogr2ogr](http://www.gdal.org/ogr2ogr.html) v1.11+
Expand Down Expand Up @@ -72,7 +72,7 @@ Remarque : Vous n'êtes pas obligé de créer une clé protégée par referer, v
| bdparcellaire | Base de données cadastrale | http://professionnels.ign.fr/bdparcellaire |
| adminexpress | Découpage administratif du territoire métropolitain et ultra-marin | http://professionnels.ign.fr/adminexpress |
| osm-commune | Découpage administratif issu de openstreetmap | https://www.data.gouv.fr/fr/datasets/decoupage-administratif-communal-francais-issu-d-openstreetmap/# |
| codes-postaux | Codes postaux associés aux communes | Voir https://github.com/etalab/codes-postaux#sources |
| codes-postaux | Codes postaux associés aux communes | Voir https://github.com/BaseAdresseNationale/codes-postaux |



Expand Down
4 changes: 2 additions & 2 deletions controllers/cadastre/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ function createCadastreProxy(featureTypeName){
var featureTypeNameFinal = featureTypeName;

if ((params.source_ign) && (featureTypeName != 'BDPARCELLAIRE-VECTEUR_WLD_BDD_WGS84G:divcad') && (featureTypeName != 'CADASTRALPARCELS.PARCELLAIRE_EXPRESSG:feuille')) {
if(params.source_ign.toUpperCase() == "PCI") {
if(params.source_ign.toUpperCase() == 'PCI') {
featureTypeNameFinal = featureTypeName.replace('BDPARCELLAIRE-VECTEUR_WLD_BDD_WGS84G', 'CADASTRALPARCELS.PARCELLAIRE_EXPRESS');
} else if(params.source_ign.toUpperCase() == "BDP") {
} else if(params.source_ign.toUpperCase() == 'BDP') {
featureTypeNameFinal = featureTypeName;
} else {
return res.status(400).send({
Expand Down
14 changes: 7 additions & 7 deletions controllers/er/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function createErProxy(featureTypeName,typeSearch){
}
}

//For _propertyNames, we need to transform the string in Array
//For _propertyNames, we need to transform the string in Array
if(params._propertyNames) {
params._propertyNames = params._propertyNames.split(';');
}
Expand Down Expand Up @@ -179,8 +179,8 @@ var productValidators = erValidators.concat([

]);

router.get('/product', cors(corsOptionsGlobal),productValidators, createErProxy('PLAGE_ER_WFS:product_view','product'));
router.post('/product',cors(corsOptionsGlobal),productValidators, createErProxy('PLAGE_ER_WFS:product_view','product'));
router.get('/product', cors(corsOptionsGlobal),productValidators, createErProxy('ESPACEREVENDEUR:product_view','product'));
router.post('/product',cors(corsOptionsGlobal),productValidators, createErProxy('ESPACEREVENDEUR:product_view','product'));

/**
* Récupération des information sur les category dans le flux product_view
Expand All @@ -194,8 +194,8 @@ var categoryValidators = erValidators.concat([
check('admin').optional().isAlphanumeric().isLength({min:1,max:1}).withMessage('Le champ admin doit être Y ou N')
]);

router.get('/category', cors(corsOptionsGlobal),categoryValidators, createErProxy('PLAGE_ER_WFS:product_view' ,'category'));
router.post('/category', cors(corsOptionsGlobal),categoryValidators, createErProxy('PLAGE_ER_WFS:product_view','category'));
router.get('/category', cors(corsOptionsGlobal),categoryValidators, createErProxy('ESPACEREVENDEUR:product_view' ,'category'));
router.post('/category', cors(corsOptionsGlobal),categoryValidators, createErProxy('ESPACEREVENDEUR:product_view','category'));


/**
Expand All @@ -210,8 +210,8 @@ var gridValidators = erValidators.concat([
check('zip_codes').optional().isString()
]);

router.get('/grid', cors(corsOptionsGlobal),gridValidators, createErProxy('PLAGE_ER_WFS:grid_view','grid'));
router.post('/grid', cors(corsOptionsGlobal),gridValidators, createErProxy('PLAGE_ER_WFS:grid_view','grid'));
router.get('/grid', cors(corsOptionsGlobal),gridValidators, createErProxy('ESPACEREVENDEUR:grid_view','grid'));
router.post('/grid', cors(corsOptionsGlobal),gridValidators, createErProxy('ESPACEREVENDEUR:grid_view','grid'));


module.exports=router;
2 changes: 1 addition & 1 deletion controllers/wfs-geoportail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { check } = require('express-validator/check');
const { matchedData } = require('express-validator/filter');

const validateParams = require('../../middlewares/validateParams');
const {isGeometry,isCodeInsee} = require('../../checker');
const {isGeometry} = require('../../checker');

const gppWfsClient = require('../../middlewares/gppWfsClient');

Expand Down
8 changes: 4 additions & 4 deletions datasets/codes-postaux/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
homepage: 'https://github.com/etalab/codes-postaux#codes-postaux',
homepage: 'https://github.com/BaseAdresseNationale/codes-postaux',
type: 'git',
description: "Table de correspondance entre les codes postaux et codes INSEE générée par ETALAB",
version: 'v3.3.0',
url: 'https://github.com/etalab/codes-postaux'
description: "Table de correspondance entre les codes postaux et codes INSEE générée par Base Adresse Nationale",
version: 'v3.4.0',
url: 'https://github.com/BaseAdresseNationale/codes-postaux'
};
2 changes: 1 addition & 1 deletion doc/codes-postaux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ swagger: '2.0'
info:
title: API Carto - codes-postaux
description: >
API de récupération des communes associées à un code postal donné. Voir https://github.com/etalab/codes-postaux#codes-postaux pour plus d'information sur les sources de données.
API de récupération des communes associées à un code postal donné. Voir https://github.com/BaseAdresseNationale/codes-postaux pour plus d'information sur les sources de données.
Consultez la [documentation utilisateur](https://apicarto.ign.fr/api/doc/pdf/docUser_moduleCodesPostaux.pdf) pour plus d’informations sur les paramètres d’appel disponibles et le format des résultats.
Expand Down
4 changes: 2 additions & 2 deletions doc/er.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ info:
Lors de votre demande de clé IGN, vous devez commander les flux ci dessous :
* PLAGE_ER_WFS:product_view
* PLAGE_ER_WFS:grid_view
* ESPACEREVENDEUR:product_view
* ESPACEREVENDEUR:grid_view
contact:
Expand Down
6 changes: 3 additions & 3 deletions lib/buildErCqlFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function bboxToFilter(bbox){
* @param {string} [geomDefaultCRS=constants.defaultCRS="urn:ogc:def:crs:EPSG::4326"] default data CRS (required in cql_filter)
* @returns {string}
*/
function buildErCqlFilter(params) {
function buildErCqlFilter(params) {

var parts = [] ;
for ( var name in params ){
Expand Down Expand Up @@ -77,7 +77,7 @@ function bboxToFilter(bbox){
var chaineCategoryId = '';
var chaineConnector = '';
for (let i = 0; i < valueCat.length; i++) {
if(i == 0) { chaineConnector =''; } else { chaineConnector = ' OR '}
if(i == 0) { chaineConnector =''; } else { chaineConnector = ' OR ';}
chaineCategoryId = chaineCategoryId + chaineConnector + ' category_id='+valueCat[i];
}
parts.push(chaineCategoryId);
Expand All @@ -90,5 +90,5 @@ function bboxToFilter(bbox){
return null;
}
return parts.join(' and ') ;
};
}
module.exports = buildErCqlFilter;
18 changes: 9 additions & 9 deletions lib/httpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const axiosGlobalConfig = {};
* (fixes https://github.com/IGNF/geoportal-wfs-client/issues/5)
*/
if (typeof window === 'undefined' ){
const HttpProxyAgent = require('http-proxy-agent');
if ( process.env.HTTP_PROXY ){
axiosGlobalConfig.httpAgent = new HttpProxyAgent(process.env.HTTP_PROXY);
}
const HttpsProxyAgent = require('https-proxy-agent');
if ( process.env.HTTPS_PROXY ){
axiosGlobalConfig.httpsAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
}
axiosGlobalConfig.proxy = false;
const HttpProxyAgent = require('http-proxy-agent');
if ( process.env.HTTP_PROXY ){
axiosGlobalConfig.httpAgent = new HttpProxyAgent(process.env.HTTP_PROXY);
}
const HttpsProxyAgent = require('https-proxy-agent');
if ( process.env.HTTPS_PROXY ){
axiosGlobalConfig.httpsAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
}
axiosGlobalConfig.proxy = false;
}

const httpClient = axios.create(axiosGlobalConfig);
Expand Down
Loading

0 comments on commit 7f8cbfe

Please sign in to comment.