Skip to content

Commit

Permalink
proj4 base cases working; tests rearranged; tests added for all geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr Martian committed Sep 16, 2024
1 parent 9f4c24f commit c54afbc
Show file tree
Hide file tree
Showing 327 changed files with 42,297 additions and 921 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.26
bun-version: 1.1.27

- name: Install dependencies
run: bun install
Expand Down
2 changes: 0 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
[ ] - - INPUTS: all S2JSON types as `s2jsonld` files
[ ] - - Store: folders/files, PMTiles
[ ] - - FORMATS: ZXY, FZXY
[ ] - readers
[ ] - - OSM pbfs
[ ] - Point Cluster (S2 and WM)
[ ] - Point Index
[ ] - polylabel
Expand Down
Binary file modified bun.lockb
Binary file not shown.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,23 @@
"url": "https://github.com/Open-S2/s2-tools.git"
},
"author": "Craig OConnor",
"license": "MIT",
"license": "See LICENSE file.",
"bugs": {
"url": "https://github.com/Open-S2/s2-tools/issues"
},
"homepage": "https://github.com/Open-S2/s2-tools#readme",
"devDependencies": {
"@skypack/package-check": "^0.2.2",
"@types/bun": "^1.1.9",
"@types/node": "^22.5.4",
"@types/node": "^22.5.5",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^50.2.2",
"eslint-plugin-jsdoc": "^50.2.3",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-tsdoc": "^0.3.0",
"nextafter": "^1.0.0",
"prettier": "^3.3.3",
"robust-orientation": "^1.2.1",
"typedoc": "^0.26.7",
"typedoc-plugin-coverage": "^3.3.0",
"typescript": "^5.6.2",
Expand Down
31 changes: 31 additions & 0 deletions proj4js-master/.github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
7 changes: 7 additions & 0 deletions proj4js-master/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*~
node_modules
.c9revisions
coverage
projs.js
.DS_STORE
dist
12 changes: 12 additions & 0 deletions proj4js-master/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"esversion": 6,
"curly": true,
"eqeqeq": true,
"latedef": "nofunc",
"undef": true,
"unused": true,
"trailing": true,
"indent": 2,
"browser": true,
"node": true
}
3 changes: 3 additions & 0 deletions proj4js-master/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*~
.c9revisions
coverage
25 changes: 25 additions & 0 deletions proj4js-master/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Mike Adair <[email protected]>
Richard Greenwood <[email protected]>
Calvin Metcalf <[email protected]>
Richard Marsden (http://www.winwaed.com)
#credit for
#src/projCode/gnom.js
#src/projCode/cea.js
T. Mittan
#credit for
#src/projCode/eqdc.js
#src/projCode/equi.js
#src/projCode/merc.js
#src/projCode/mill.js
#src/projCode/omerc.js
#src/projCode/ortho.js
#src/projCode/poly.js
#src/projCode/poly.js
D. Steinwand
#credit for
#src/projCode/merc.js
#src/projCode/laea.js
#src/projCode/moll.js
S. Nelson
#credit for
#src/projCode/moll.js
128 changes: 128 additions & 0 deletions proj4js-master/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
var json = require('rollup-plugin-json');
var nodeResolve = require('rollup-plugin-node-resolve');
var replace = require('rollup-plugin-replace');
var pkg = require('./package.json');

var projs = [
'tmerc',
'etmerc',
'utm',
'sterea',
'stere',
'somerc',
'omerc',
'lcc',
'krovak',
'cass',
'laea',
'aea',
'gnom',
'cea',
'eqc',
'poly',
'nzmg',
'mill',
'sinu',
'moll',
'eqdc',
'vandg',
'aeqd',
'ortho',
'qsc',
'robin',
'geocent',
'tpers',
'geos',
'eqearth',
'bonne'
];
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: process.env.PORT || 8080,
base: '.'
}
}
},
mocha_phantomjs: {
all: {
options: {
reporter: "dot",
urls: [ //my ide requries process.env.IP and PORT
"http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/amd.html",
"http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/opt.html"
]
}
}
},
jshint: {
options: {
jshintrc: "./.jshintrc"
},
all: ['./lib/*.js', './lib/*/*.js']
},
rollup: {
options: {
format: "umd",
moduleName: "proj4",
plugins: [
replace({
__VERSION__: pkg.version
}),
json(),
nodeResolve()
]
},
files: {
dest: './dist/proj4-src.js',
src: './lib/index.js',
},
},
uglify: {
options: {
report: 'gzip',
mangle:{
reserved: ['proj4','Projection','Point']
},
},
all: {
src: 'dist/proj4-src.js',
dest: 'dist/proj4.js'
}
}
});
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.registerTask('custom',function(){
grunt.task.run('rollup', 'uglify');
var projections = this.args;
if(projections[0]==='default'){
grunt.file.write('./projs.js','export default function(){}');
return;
}
if(projections[0]==='all'){
projections = projs;
}
grunt.file.write('./projs.js',[
projections.map(function(proj) {
return "import " + proj + " from './lib/projections/" + proj + "';";
}).join("\n"),
"export default function(proj4){",
projections.map(function(proj) {
return " proj4.Proj.projections.add(" + proj + ");"
}).join("\n"),
"}"
].join("\n"));
});
grunt.registerTask('build',function(){
var args = this.args.length?this.args[0].split(','):['default'];
grunt.task.run('jshint', 'custom:'+args.join(':'));
});
grunt.registerTask('default', ['build:all', 'connect','mocha_phantomjs']);
};
29 changes: 29 additions & 0 deletions proj4js-master/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Proj4js -- Javascript reprojection library.

Authors:
- Mike Adair madairATdmsolutions.ca
- Richard Greenwood richATgreenwoodmap.com
- Didier Richard didier.richardATign.fr
- Stephen Irons stephen.ironsATclear.net.nz
- Olivier Terral oterralATgmail.com
- Calvin Metcalf cmetcalfATappgeo.com

Copyright (c) 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

_THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
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._
22 changes: 22 additions & 0 deletions proj4js-master/PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Publishing
===

Make sure you have the latest from the main branch:

git pull origin master

Use `tin` to update the version number in the `package.json`, `component.json` & `bower.json`.

tin -v x.y.z

Then run the publish script

./publish.sh

afterwards don't forget to update the versions to be a prerelease of the next version, so if you just published 1.1.1 then:

tin -v 1.1.2-alpha
npm install
git add package.json package-lock.json component.json bower.json
git commit -m 'update version to 1.1.2-alpha'
git push origin master
Loading

0 comments on commit c54afbc

Please sign in to comment.