Skip to content
Permalink
Browse files
update proj4; ignore projection if it throws error
  • Loading branch information
potree committed Jun 28, 2020
1 parent 24e9d08 commit 2ef8bd37ce260c406926b85fe3f38b8a61bd25ea
Showing 9 changed files with 6,234 additions and 45 deletions.
@@ -30,3 +30,4 @@ libs/CesiumUnminified
/pointclouds/sjl2
/pointclouds/morro_bay_converted
/pointclouds/helimap_epalinges
pointclouds/F
@@ -1,4 +1,4 @@
##Proj4js -- Javascript reprojection library.
## Proj4js -- Javascript reprojection library.

Authors:
- Mike Adair madairATdmsolutions.ca
@@ -26,4 +26,4 @@ Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE._
DEALINGS IN THE SOFTWARE._
@@ -1,8 +1,8 @@
# PROJ4JS [![Build Status](https://travis-ci.org/proj4js/proj4js.svg)](https://travis-ci.org/proj4js/proj4js)

Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.
Originally a port of [PROJ.4](http://trac.osgeo.org/proj/) and [GCTCP C](http://edcftp.cr.usgs.gov/pub//software/gctpc) it is
a part of the [MetaCRS](http://wiki.osgeo.org/wiki/MetaCRS) group of projects.
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
a part of the [MetaCRS](https://trac.osgeo.org/metacrs/wiki) group of projects.

## Installing

@@ -11,17 +11,16 @@ Depending on your preferences
```bash
npm install proj4
bower install proj4
jam install proj4
component install proj4js/proj4js
```

or just manually grab the file `proj4.js` from the [latest release](https://github.com/proj4js/proj4js/releases).
or just manually grab the file `proj4.js` from the [latest release](https://github.com/proj4js/proj4js/releases)'s `dist/` folder.

if you do not want to download anything, Proj4js is also hosted on [cdnjs](http://www.cdnjs.com/libraries/proj4js) for direct use in your browser applications.
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.

## Using

the basic signature is:
The basic signature is:

```javascript
proj4(fromProjection[, toProjection, coordinates])
@@ -57,7 +56,7 @@ proj4(secondProjection,firstProjection).inverse([2,5]);
// [-2690666.2977344505, 3662659.885459918]
```

and as above if only one projection is given, it's assumed to be coming from wgs84
And as above if only one projection is given, it's assumed to be coming from wgs84:

```javascript
proj4(firstProjection).forward([-71,41]);
@@ -89,7 +88,7 @@ proj4.defs([
]);
```

you can then do
you can then do

```js
proj4('EPSG:4326');
@@ -106,48 +105,56 @@ instead of writing out the whole proj definition, by default proj4 has the follo
- 'EPSG:900913'
- 'EPSG:102113'

defined projections can also be accessed through the proj4.defs function (`proj4.defs('EPSG:4326')`).
Defined projections can also be accessed through the proj4.defs function (`proj4.defs('EPSG:4326')`).

proj4.defs can also be used to define a named alias:

```javascript
proj4.defs('urn:x-ogc:def:crs:EPSG:4326', proj4.defs('EPSG:4326'));
```
```

## TypeScript

TypeScript implementation was added to the [DefinitelyTyped repository](https://github.com/DefinitelyTyped/DefinitelyTyped).

```bash
$ npm install --save @types/proj4
```

## Developing
to set up build tools make sure you have node and grunt-cli installed and then run `npm install`
To set up build tools make sure you have node and grunt-cli installed and then run `npm install`.

to do the complete build and browser tests run
To do the complete build and browser tests run:

```bash
grunt
node_modules/.bin/grunt
```

to run node tests run
To run node tests run:

```bash
npm test
```

to run node tests with coverage run
To run node tests with coverage run:

```bash
node test --coverage
npm test --coverage
```

to create a build with only default projections (latlon and Mercator) run
To create a build with only default projections (latlon and Mercator) run:

```bash
grunt build
node_modules/.bin/grunt build
```

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.
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.:

```bash
grunt build:tmerc
node_modules/.bin/grunt build:tmerc
#includes transverse Mercator
grunt build:lcc
node_modules/.bin/grunt build:lcc
#includes lambert conformal conic
grunt build:omerc,moll
node_modules/.bin/grunt build:omerc,moll
#includes oblique Mercator and Mollweide
```

0 comments on commit 2ef8bd3

Please sign in to comment.