proj4 2.4.4 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +1 -1
- package/Gruntfile.js +10 -3
- package/LICENSE.md +2 -2
- package/README.md +12 -12
- package/bower.json +1 -1
- package/component.json +1 -1
- package/dist/proj4-src.js +6597 -6322
- package/dist/proj4.js +1 -3
- package/lib/adjust_axis.js +12 -9
- package/lib/core.js +27 -16
- package/lib/datumUtils.js +5 -2
- package/lib/includedProjections.js +8 -4
- package/lib/index.js +1 -2
- package/lib/parseCode.js +28 -2
- package/lib/projections/aeqd.js +4 -3
- package/lib/projections/geocent.js +27 -0
- package/lib/projections/gstmerc.js +1 -1
- package/lib/projections/laea.js +6 -6
- package/lib/projections/robin.js +161 -0
- package/lib/projections/stere.js +1 -1
- package/lib/projections/sterea.js +1 -1
- package/lib/transform.js +14 -7
- package/package.json +17 -15
- package/projs.js +4 -0
- package/test/test.js +84 -23
- package/test/testData.js +121 -10
- package/.npmignore +0 -3
- package/dist/.npmignore +0 -0
- package/lib/version.js +0 -1
package/.travis.yml
CHANGED
package/Gruntfile.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var json = require('rollup-plugin-json');
|
|
2
2
|
var nodeResolve = require('rollup-plugin-node-resolve');
|
|
3
|
+
var replace = require('rollup-plugin-replace');
|
|
4
|
+
var pkg = require('./package.json');
|
|
3
5
|
|
|
4
6
|
var projs = [
|
|
5
7
|
'tmerc',
|
|
@@ -26,9 +28,11 @@ var projs = [
|
|
|
26
28
|
'vandg',
|
|
27
29
|
'aeqd',
|
|
28
30
|
'ortho',
|
|
29
|
-
'qsc'
|
|
31
|
+
'qsc',
|
|
32
|
+
'robin',
|
|
33
|
+
'geocent'
|
|
30
34
|
];
|
|
31
|
-
module.exports = function(grunt) {
|
|
35
|
+
module.exports = function (grunt) {
|
|
32
36
|
grunt.initConfig({
|
|
33
37
|
pkg: grunt.file.readJSON('package.json'),
|
|
34
38
|
connect: {
|
|
@@ -61,6 +65,9 @@ module.exports = function(grunt) {
|
|
|
61
65
|
format: "umd",
|
|
62
66
|
moduleName: "proj4",
|
|
63
67
|
plugins: [
|
|
68
|
+
replace({
|
|
69
|
+
__VERSION__: pkg.version
|
|
70
|
+
}),
|
|
64
71
|
json(),
|
|
65
72
|
nodeResolve()
|
|
66
73
|
]
|
|
@@ -74,7 +81,7 @@ module.exports = function(grunt) {
|
|
|
74
81
|
options: {
|
|
75
82
|
report: 'gzip',
|
|
76
83
|
mangle:{
|
|
77
|
-
|
|
84
|
+
reserved: ['proj4','Projection','Point']
|
|
78
85
|
},
|
|
79
86
|
},
|
|
80
87
|
all: {
|
package/LICENSE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
##Proj4js -- Javascript reprojection library.
|
|
1
|
+
## Proj4js -- Javascript reprojection library.
|
|
2
2
|
|
|
3
3
|
Authors:
|
|
4
4
|
- Mike Adair madairATdmsolutions.ca
|
|
@@ -26,4 +26,4 @@ Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons
|
|
|
26
26
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
27
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
28
28
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
29
|
-
DEALINGS IN THE SOFTWARE._
|
|
29
|
+
DEALINGS IN THE SOFTWARE._
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# PROJ4JS [](https://travis-ci.org/proj4js/proj4js)
|
|
2
2
|
|
|
3
3
|
Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.
|
|
4
|
-
Originally a port of [PROJ.4](
|
|
5
|
-
a part of the [MetaCRS](
|
|
4
|
+
Originally a port of [PROJ](https://proj.org/) ([then known as PROJ.4](https://proj.org/faq.html#what-happened-to-proj-4)) and GCTCP C ([Archive](https://web.archive.org/web/20130523091752/http://edcftp.cr.usgs.gov/pub/software/gctpc/)) it is
|
|
5
|
+
a part of the [MetaCRS](https://trac.osgeo.org/metacrs/wiki) group of projects.
|
|
6
6
|
|
|
7
7
|
## Installing
|
|
8
8
|
|
|
@@ -16,11 +16,11 @@ component install proj4js/proj4js
|
|
|
16
16
|
|
|
17
17
|
or just manually grab the file `proj4.js` from the [latest release](https://github.com/proj4js/proj4js/releases)'s `dist/` folder.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
If you do not want to download anything, Proj4js is also hosted on [cdnjs](https://www.cdnjs.com/libraries/proj4js) for direct use in your browser applications.
|
|
20
20
|
|
|
21
21
|
## Using
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The basic signature is:
|
|
24
24
|
|
|
25
25
|
```javascript
|
|
26
26
|
proj4(fromProjection[, toProjection, coordinates])
|
|
@@ -56,7 +56,7 @@ proj4(secondProjection,firstProjection).inverse([2,5]);
|
|
|
56
56
|
// [-2690666.2977344505, 3662659.885459918]
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
And as above if only one projection is given, it's assumed to be coming from wgs84:
|
|
60
60
|
|
|
61
61
|
```javascript
|
|
62
62
|
proj4(firstProjection).forward([-71,41]);
|
|
@@ -105,7 +105,7 @@ instead of writing out the whole proj definition, by default proj4 has the follo
|
|
|
105
105
|
- 'EPSG:900913'
|
|
106
106
|
- 'EPSG:102113'
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
Defined projections can also be accessed through the proj4.defs function (`proj4.defs('EPSG:4326')`).
|
|
109
109
|
|
|
110
110
|
proj4.defs can also be used to define a named alias:
|
|
111
111
|
|
|
@@ -122,33 +122,33 @@ $ npm install --save @types/proj4
|
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
## Developing
|
|
125
|
-
|
|
125
|
+
To set up build tools make sure you have node and grunt-cli installed and then run `npm install`.
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
To do the complete build and browser tests run:
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
130
|
node_modules/.bin/grunt
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
To run node tests run:
|
|
134
134
|
|
|
135
135
|
```bash
|
|
136
136
|
npm test
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
To run node tests with coverage run:
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
142
|
npm test --coverage
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
To create a build with only default projections (latlon and Mercator) run:
|
|
146
146
|
|
|
147
147
|
```bash
|
|
148
148
|
node_modules/.bin/grunt build
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
To create a build with only custom projections include a comma separated list of projections codes (the file name in 'lib/projections' without the '.js') after a colon, e.g.:
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
154
|
node_modules/.bin/grunt build:tmerc
|
package/bower.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proj4",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",
|
|
5
5
|
"homepage": "https://github.com/proj4js/proj4js",
|
|
6
6
|
"main": "dist/proj4.js",
|
package/component.json
CHANGED