-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
16,432 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: GH Pages Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build Docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
- uses: actions/checkout@v1 | ||
- name: Build gh-pages | ||
run: npm run gh-pages-build | ||
- name: Deploy To gh-pages branch | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_branch: gh-pages | ||
publish_dir: ./api-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and Run Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: npm install, build, and test | ||
run: | | ||
npm install | ||
npm run build --if-present | ||
npm test | ||
env: | ||
CI: true | ||
- name: Dump job context | ||
env: | ||
JOB_CONTEXT: ${{ toJson(matrix) }} | ||
run: echo "$JOB_CONTEXT" | ||
- name: Coveralls | ||
if: matrix.node-version == '14.x' | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ./docs/coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage/ | ||
.reports | ||
.test_run | ||
!docs/coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git | ||
node_modules | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Mac OSX Files | ||
.DS_Store | ||
|
||
# Editor files | ||
.vscode | ||
|
||
mochawesome-reports | ||
|
||
.tern-project | ||
|
||
bower_components | ||
|
||
test/private | ||
test/fixtures/private | ||
**/*/tmp | ||
|
||
dist | ||
**/*/package-lock.json | ||
|
||
built | ||
api-docs | ||
tmp | ||
bundle | ||
test/bundle | ||
test/sql-wasm.wasm | ||
docs/coverage | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2022 National Geospatial-Intelligence Agency | ||
|
||
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,78 @@ | ||
simple-features-proj-js | ||
# Simple Features Projection Javascript | ||
|
||
#### Simple Features Projection Lib #### | ||
|
||
The Simple Features Libraries were developed at the [National Geospatial-Intelligence Agency (NGA)](http://www.nga.mil/) in collaboration with [BIT Systems](https://www.caci.com/bit-systems/). The government has "unlimited rights" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the [MIT license](http://choosealicense.com/licenses/mit/). | ||
|
||
### Pull Requests ### | ||
If you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license. | ||
|
||
Software source code previously released under an open source license and then modified by NGA staff is considered a "joint work" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license. | ||
|
||
### About ### | ||
|
||
[Simple Features Projection](http://ngageoint.github.io/simple-features-proj-js/) is a Java library for performing projection conversions between [Simple Feature](https://github.com/ngageoint/simple-features-js) Geometries. | ||
|
||
### Usage ### | ||
|
||
View the latest [JS Docs](http://ngageoint.github.io/simple-features-js) | ||
|
||
#### Browser Usage #### | ||
```html | ||
<script src="/path/to/simple-features-js/dist/sf.min.js"></script> | ||
<script src="/path/to/simple-features-proj-js/dist/sf-proj.min.js"></script> | ||
``` | ||
```javascript | ||
|
||
const { Point } = window.SimpleFeatures; | ||
const { ProjectionConstants, Projections } = window.Projections; | ||
const { ProjectionFactory, GeometryTransform } = window.SimpleFeaturesProj; | ||
|
||
|
||
// Geometry geometry = ... | ||
|
||
const projection1 = Projections.getProjection(ProjectionConstants.AUTHORITY_EPSG, ProjectionConstants.EPSG_WEB_MERCATOR); | ||
const projection2 = Projections.getProjection(ProjectionConstants.AUTHORITY_EPSG, ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM); | ||
|
||
const transform = GeometryTransform.create(projection1, projection2); | ||
|
||
const transformed = transform.transformGeometry(geometry); | ||
|
||
return transformed; | ||
``` | ||
|
||
#### Node Usage #### | ||
[![NPM](https://img.shields.io/npm/v/@ngageoint/simple-features-proj-js.svg)](https://www.npmjs.com/package/@ngageoint/simple-features-proj-js) | ||
|
||
Pull from [NPM](https://www.npmjs.com/package/@ngageoint/simple-features-proj-js) | ||
|
||
```install | ||
npm install --save simple-features-proj-js | ||
``` | ||
```javascript | ||
|
||
const { Point } = require("@ngageoint/simple-features-js"); | ||
import { ProjectionConstants, Projections } from '@ngageoint/projections-js' | ||
const { ProjectionFactory, GeometryTransform } = require("@ngageoint/simple-features-proj-js"); | ||
|
||
// Geometry geometry = ... | ||
|
||
const projection1 = Projections.getProjection(ProjectionConstants.AUTHORITY_EPSG, ProjectionConstants.EPSG_WEB_MERCATOR); | ||
const projection2 = Projections.getProjection(ProjectionConstants.AUTHORITY_EPSG, ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM); | ||
|
||
const transform = GeometryTransform.create(projection1, projection2); | ||
|
||
const transformed = transform.transformGeometry(geometry); | ||
|
||
return transformed; | ||
|
||
``` | ||
|
||
### Build ### | ||
|
||
![Build & Test](https://github.com/ngageoint/simple-features-proj-js/actions/workflows/run-tests.yml/badge.svg) | ||
|
||
Build this repository using Node.js: | ||
|
||
npm install | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const path = require('path'); | ||
const CopyPlugin = require('copy-webpack-plugin'); | ||
const NodePolyfillWebpackPlugin = require('node-polyfill-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: './test/browserTests.js', | ||
plugins: [ | ||
new NodePolyfillWebpackPlugin(), | ||
new CopyPlugin({ | ||
patterns: [ | ||
{ | ||
from: 'node_modules/mocha/*', | ||
to: '..', | ||
}, | ||
], | ||
}), | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
use: 'ts-loader', | ||
exclude: [ | ||
/node_modules/, | ||
], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.tsx', '.ts', '.js'], | ||
fallback: { | ||
'fs': false, | ||
} | ||
}, | ||
output: { | ||
filename: 'browser.test.bundle.js', | ||
path: path.resolve(__dirname, 'test', 'bundle'), | ||
library: { | ||
name: 'simple-features-proj', | ||
type: 'umd', | ||
}, | ||
}, | ||
devtool: 'source-map', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { GeometryTransform } from "./lib/GeometryTransform"; | ||
|
||
export { | ||
GeometryTransform | ||
}; |
Oops, something went wrong.