Skip to content

Commit

Permalink
Add custom fr EPSG definition
Browse files Browse the repository at this point in the history
* EPSG:2154: official national projection in FR
* EPSG27572: previous national projection (DEPRECATED) in FR
* EPSG:3947: local projection in the new official projection in FR
  • Loading branch information
yjacolin committed Sep 27, 2017
1 parent faf3a99 commit 50bf4f9
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/proj/epsg2154.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
goog.module('ngeo.proj.EPSG2154');
goog.module.declareLegacyNamespace();

goog.require('ol.proj');
goog.require('ol.proj.proj4');

if (typeof ol.proj.proj4.get() !== 'function' && typeof proj4 === 'function') {
ol.proj.setProj4(proj4);
}

if (typeof proj4 == 'function') {
const epsg2154def = [
'+proj=lcc',
'+lat_0=46.5',
'+lon_0=3',
'+lat_1=49',
'+lat_2=44',
'+x_0=700000',
'+y_0=6600000',
'+ellps=GRS80',
'+towgs84=0,0,0,0,0,0,0',
'+units=m',
'+no_defs'
].join(' ');
const epsg2154extent = [-378305.81, 6093283.21, 1212610.74, 7186901.68];

ol.proj.proj4.defs('EPSG:2154', epsg2154def);
ol.proj.get('EPSG:2154').setExtent(epsg2154extent);
}

exports = 'EPSG:2154';
34 changes: 34 additions & 0 deletions src/proj/epsg27572.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
goog.provide('ngeo.proj.EPSG27572');
goog.module.declareLegacyNamespace();

goog.require('ol.proj');
goog.require('ol.proj.proj4');

if (typeof ol.proj.proj4.get() !== 'function' && typeof proj4 === 'function') {
ol.proj.setProj4(proj4);
}

if (typeof proj4 == 'function') {
const epsg27572def = [
'+proj=lcc',
'+lat_0=46.8',
'+lon_0=0',
'+lat_1=46.8',
'+k_0=0.99987742',
'+x_0=600000',
'+y_0=2200000',
'+ellps=GRS80',
'+a=6378249.2',
'+b=6356515',
'+towgs84=-168,-60,320,0,0,0,0',
'+pm=paris',
'+units=m',
'+no_defs'
].join(' ');
const epsg27572extent = [5168.43, 1730142.53,1013247.20, 2698564.20];

ol.proj.proj4.defs('EPSG:27572', epsg27572def);
ol.proj.get('EPSG:27572').setExtent(epsg27572extent);
}

exports = 'EPSG:27572';
31 changes: 31 additions & 0 deletions src/proj/epsg3947.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
goog.provide('ngeo.proj.EPSG3947');
goog.module.declareLegacyNamespace();

goog.require('ol.proj');
goog.require('ol.proj.proj4');

if (typeof ol.proj.proj4.get() !== 'function' && typeof proj4 === 'function') {
ol.proj.setProj4(proj4);
}

if (typeof proj4 == 'function') {
const epsg3947def = [
'+proj=lcc',
'+lat_1=46.25',
'+lon_0=3',
'+lat_0=47',
'+lat_2=47.75',
'+x_0=1700000',
'+y_0=6200000',
'+ellps=GRS80',
'+towgs84=0,0,0,0,0,0,0',
'+units=m',
'+no_defs'
].join(' ');
const epsg3947extent = [619993.48, 5637784.91, 2212663.72, 6731809.22];

ol.proj.proj4.defs('EPSG:3947', epsg3947def);
ol.proj.get('EPSG:3947').setExtent(epsg3947extent);
}

exports = 'EPSG:3947';

0 comments on commit 50bf4f9

Please sign in to comment.