w-geo 1.0.43 → 1.0.44

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/.jsdoc CHANGED
@@ -3,7 +3,7 @@
3
3
  "allowUnknownTags": false
4
4
  },
5
5
  "source": {
6
- "include": ["src/"],
6
+ "include": ["src/", "server/"],
7
7
  "includePattern": ".+\\.(js(doc|x)?|mjs|vue)$",
8
8
  "excludePattern": "(node_modules/|docs)"
9
9
  },
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 semisphere(呂昱達)
3
+ Copyright (c) 2022 semisphere(yu-da, lyu 呂昱達)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -23,5 +23,5 @@ npm i w-geo
23
23
 
24
24
  Add script for w-geo.
25
25
  ```alias
26
- <script src="https://cdn.jsdelivr.net/npm/w-geo@1.0.43/dist/w-geo.umd.js"></script>
26
+ <script src="https://cdn.jsdelivr.net/npm/w-geo@1.0.44/dist/w-geo.umd.js"></script>
27
27
  ```
package/dist/w-geo.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * w-geo v1.0.43
2
+ * w-geo v1.0.44
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -59,7 +59,7 @@
59
59
  <br class="clear">
60
60
 
61
61
  <footer>
62
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
62
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
63
63
  </footer>
64
64
 
65
65
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -322,7 +322,7 @@ export default calcDepthStartEndByConnect
322
322
  <br class="clear">
323
323
 
324
324
  <footer>
325
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
325
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
326
326
  </footer>
327
327
 
328
328
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -566,7 +566,7 @@ export default calcDepthStartEndByGroup
566
566
  <br class="clear">
567
567
 
568
568
  <footer>
569
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
569
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
570
570
  </footer>
571
571
 
572
572
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -346,7 +346,7 @@ export default calcDepthStartEndFromCenter
346
346
  <br class="clear">
347
347
 
348
348
  <footer>
349
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
349
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
350
350
  </footer>
351
351
 
352
352
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -4511,7 +4511,7 @@ export default calcLiquefaction
4511
4511
  <br class="clear">
4512
4512
 
4513
4513
  <footer>
4514
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
4514
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
4515
4515
  </footer>
4516
4516
 
4517
4517
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -593,7 +593,7 @@ export default calcVerticalStress
593
593
  <br class="clear">
594
594
 
595
595
  <footer>
596
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
596
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
597
597
  </footer>
598
598
 
599
599
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -211,7 +211,7 @@ export default checkDepth
211
211
  <br class="clear">
212
212
 
213
213
  <footer>
214
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
214
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
215
215
  </footer>
216
216
 
217
217
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -270,7 +270,7 @@ export default checkDepthStartEnd
270
270
  <br class="clear">
271
271
 
272
272
  <footer>
273
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
273
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
274
274
  </footer>
275
275
 
276
276
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -503,7 +503,7 @@ export default complementDepthData
503
503
  <br class="clear">
504
504
 
505
505
  <footer>
506
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
506
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
507
507
  </footer>
508
508
 
509
509
  <script>prettyPrint();</script>
@@ -0,0 +1,226 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>convertCoordinate.mjs - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+ </head>
19
+ <body>
20
+
21
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
22
+ <label for="nav-trigger" class="navicon-button x">
23
+ <div class="navicon"></div>
24
+ </label>
25
+
26
+ <label for="nav-trigger" class="overlay"></label>
27
+
28
+ <nav >
29
+
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
+ </nav>
32
+
33
+ <div id="main">
34
+
35
+ <h1 class="page-title">convertCoordinate.mjs</h1>
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ <section>
44
+ <article>
45
+ <pre class="prettyprint source linenums"><code>import size from 'lodash/size'
46
+ import isearr from 'wsemi/src/isearr.mjs'
47
+ import haskey from 'wsemi/src/haskey.mjs'
48
+ import proj4 from 'proj4'
49
+
50
+
51
+ //defs
52
+ proj4.defs([
53
+ [
54
+ 'EPSG:4326',
55
+ '+title=WGS84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees'],
56
+ [
57
+ 'EPSG:3826',
58
+ '+title=TWD97 TM2 +proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m +no_defs'
59
+ ],
60
+ [
61
+ 'EPSG:3828',
62
+ '+title=TWD67 TM2 +proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=aust_SA +towgs84=-752,-358,-179,-0.0000011698,0.0000018398,0.0000009822,0.00002329 +units=m +no_defs'
63
+ ]
64
+ ])
65
+
66
+ // function core() {
67
+
68
+ // //EPSG
69
+ // let EPSG3826 = new proj4.Proj('EPSG:3826') //TWD97 TM2(121分帶)
70
+ // let EPSG3828 = new proj4.Proj('EPSG:3828') //TWD67 TM2(121分帶)
71
+ // let EPSG4326 = new proj4.Proj('EPSG:4326') //WGS84
72
+
73
+ // function cvWGS84toTWD97TM2(ps) {
74
+ // //4326轉3826(WGS84經緯度轉TWD97 TM2)
75
+
76
+ // //check
77
+ // if (!isearr(ps) &amp;&amp; size(ps) !== 2) {
78
+ // throw new Error('ps is not an array(length=2)')
79
+ // }
80
+
81
+ // return proj4(EPSG4326, EPSG3826, ps)
82
+ // }
83
+
84
+ // function cvWGS84toTWD67TM2(ps) {
85
+ // //4326轉3828(WGS84經緯度轉TWD67 TM2)
86
+
87
+ // //check
88
+ // if (!isearr(ps) &amp;&amp; size(ps) !== 2) {
89
+ // throw new Error('ps is not an array(length=2)')
90
+ // }
91
+
92
+ // return proj4(EPSG4326, EPSG3828, ps)
93
+ // }
94
+
95
+ // function cvTWD97TM2toWGS84(ps) {
96
+ // //3826轉4326(TWD97 TM2轉WGS84經緯度)
97
+
98
+ // //check
99
+ // if (!isearr(ps) &amp;&amp; size(ps) !== 2) {
100
+ // throw new Error('ps is not an array(length=2)')
101
+ // }
102
+
103
+ // return proj4(EPSG3826, EPSG4326, ps)
104
+ // }
105
+
106
+ // function cvTWD67TM2toWGS84(ps) {
107
+ // //3828轉4326(TWD67 TM2轉WGS84經緯度)
108
+
109
+ // //check
110
+ // if (!isearr(ps) &amp;&amp; size(ps) !== 2) {
111
+ // throw new Error('ps is not an array(length=2)')
112
+ // }
113
+
114
+ // return proj4(EPSG3828, EPSG4326, ps)
115
+ // }
116
+
117
+ // return {
118
+ // proj4,
119
+ // cvWGS84toTWD97TM2,
120
+ // cvWGS84toTWD67TM2,
121
+ // cvTWD97TM2toWGS84,
122
+ // cvTWD67TM2toWGS84,
123
+ // }
124
+ // }
125
+
126
+
127
+ /**
128
+ * 座標轉換
129
+ *
130
+ * Unit Test: {@link https://github.com/yuda-lyu/w-geo/blob/master/test/convertCoordinate.test.js Github}
131
+ * @memberOf w-geo
132
+ * @param {String} cdFrom 輸入來源座標系統字串
133
+ * @param {String} cdTo 輸入轉出座標系統字串
134
+ * @param {Array} ps 輸入座標(x,y)陣列
135
+ * @returns {Array} 回傳轉出座標陣列
136
+ * @example
137
+ *
138
+ * let ps
139
+ * let r
140
+ *
141
+ * ps = [121, 24]
142
+ * r = convertCoordinate('WGS84', 'TWD97TM2', ps)
143
+ * console.log('WGS84', 'to', 'TWD97TM2', r)
144
+ * // => WGS84 to TWD97TM2 [ 250000, 2655023.124957118 ]
145
+ *
146
+ * ps = [121, 24]
147
+ * r = convertCoordinate('WGS84', 'TWD67TM2', ps)
148
+ * console.log('WGS84', 'to', 'TWD67TM2', r)
149
+ * // => WGS84 to TWD67TM2 [ 249171.1063953548, 2655228.969012536 ]
150
+ *
151
+ * ps = [250000, 2655023]
152
+ * r = convertCoordinate('TWD97TM2', 'TWD67TM2', ps)
153
+ * console.log('TWD97TM2', 'to', 'TWD67TM2', r)
154
+ * // => TWD97TM2 to TWD67TM2 [ 249171.10639535502, 2655228.8440549527 ]
155
+ *
156
+ */
157
+ function convertCoordinate(cdFrom, cdTo, ps) {
158
+
159
+ //check
160
+ if (!isearr(ps) &amp;&amp; size(ps) !== 2) {
161
+ throw new Error('ps is not an array(length=2)')
162
+ }
163
+
164
+ //core
165
+ // let cc = core()
166
+ // cvWGS84toTWD97TM2,
167
+ // cvWGS84toTWD67TM2,
168
+ // cvTWD97TM2toWGS84,
169
+ // cvTWD67TM2toWGS84,
170
+
171
+ //kp
172
+ let kp = {
173
+ 'TWD97TM2': 'EPSG:3826',
174
+ 'TWD67TM2': 'EPSG:3828',
175
+ 'WGS84': 'EPSG:4326',
176
+ }
177
+
178
+ //check cdFrom
179
+ if (haskey(kp, cdFrom)) {
180
+ cdFrom = kp[cdFrom]
181
+ }
182
+
183
+ //check cdTo
184
+ if (haskey(kp, cdTo)) {
185
+ cdTo = kp[cdTo]
186
+ }
187
+
188
+ //proj4
189
+ // let EPSG3826 = new proj4.Proj('EPSG:3826') //TWD97 TM2(121分帶)
190
+ // let EPSG3828 = new proj4.Proj('EPSG:3828') //TWD67 TM2(121分帶)
191
+ // let EPSG4326 = new proj4.Proj('EPSG:4326') //WGS84
192
+ // proj4(EPSG4326, EPSG3826, ps)
193
+ let pj4From = new proj4.Proj(cdFrom)
194
+ let pj4To = new proj4.Proj(cdTo)
195
+ let r = proj4(pj4From, pj4To, ps)
196
+
197
+ return r
198
+ }
199
+
200
+
201
+ export default convertCoordinate
202
+ </code></pre>
203
+ </article>
204
+ </section>
205
+
206
+
207
+
208
+
209
+
210
+
211
+ </div>
212
+
213
+ <br class="clear">
214
+
215
+ <footer>
216
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
217
+ </footer>
218
+
219
+ <script>prettyPrint();</script>
220
+ <script src="scripts/polyfill.js"></script>
221
+ <script src="scripts/linenumber.js"></script>
222
+
223
+
224
+
225
+ </body>
226
+ </html>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -489,7 +489,7 @@ export default groupByDepthStartEnd
489
489
  <br class="clear">
490
490
 
491
491
  <footer>
492
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
492
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
493
493
  </footer>
494
494
 
495
495
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -68,7 +68,7 @@
68
68
  <br class="clear">
69
69
 
70
70
  <footer>
71
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
71
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
72
72
  </footer>
73
73
 
74
74
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -519,7 +519,7 @@ export default relaPorousParams
519
519
  <br class="clear">
520
520
 
521
521
  <footer>
522
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
522
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
523
523
  </footer>
524
524
 
525
525
  <script>prettyPrint();</script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -315,7 +315,7 @@ export default sepDepthStartEndByDepth
315
315
  <br class="clear">
316
316
 
317
317
  <footer>
318
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
318
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
319
319
  </footer>
320
320
 
321
321
  <script>prettyPrint();</script>
package/docs/w-geo.html CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="w-geo.html">w-geo</a><ul class='methods'><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByConnect">calcDepthStartEndByConnect</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndByGroup">calcDepthStartEndByGroup</a></li><li data-type='method'><a href="w-geo.html#.calcDepthStartEndFromCenter">calcDepthStartEndFromCenter</a></li><li data-type='method'><a href="w-geo.html#.calcVerticalStress">calcVerticalStress</a></li><li data-type='method'><a href="w-geo.html#.checkDepth">checkDepth</a></li><li data-type='method'><a href="w-geo.html#.checkDepthStartEnd">checkDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.complementDepthData">complementDepthData</a></li><li data-type='method'><a href="w-geo.html#.convertCoordinate">convertCoordinate</a></li><li data-type='method'><a href="w-geo.html#.groupByDepthStartEnd">groupByDepthStartEnd</a></li><li data-type='method'><a href="w-geo.html#.relaPorousParams">relaPorousParams</a></li><li data-type='method'><a href="w-geo.html#.sepDepthStartEndByDepth">sepDepthStartEndByDepth</a></li><li data-type='method'><a href="w-geo.html#.sptHBF">sptHBF</a></li><li data-type='method'><a href="w-geo.html#.sptNCEER">sptNCEER</a></li><li data-type='method'><a href="w-geo.html#.sptNJRA">sptNJRA</a></li><li data-type='method'><a href="w-geo.html#.sptSeed">sptSeed</a></li><li data-type='method'><a href="w-geo.html#.sptTY">sptTY</a></li></ul></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -2903,6 +2903,216 @@
2903
2903
 
2904
2904
 
2905
2905
 
2906
+ <h4 class="name" id=".convertCoordinate"><span class="type-signature">(static) </span>convertCoordinate<span class="signature">(cdFrom, cdTo, ps)</span><span class="type-signature"> &rarr; {Array}</span></h4>
2907
+
2908
+
2909
+
2910
+
2911
+
2912
+
2913
+ <dl class="details">
2914
+
2915
+
2916
+ <dt class="tag-source">Source:</dt>
2917
+ <dd class="tag-source"><ul class="dummy"><li>
2918
+ <a href="convertCoordinate.mjs.html">convertCoordinate.mjs</a>, <a href="convertCoordinate.mjs.html#line113">line 113</a>
2919
+ </li></ul></dd>
2920
+
2921
+
2922
+
2923
+
2924
+
2925
+
2926
+
2927
+
2928
+
2929
+
2930
+
2931
+
2932
+
2933
+
2934
+
2935
+
2936
+
2937
+
2938
+
2939
+
2940
+
2941
+
2942
+
2943
+
2944
+
2945
+
2946
+
2947
+
2948
+
2949
+
2950
+
2951
+ </dl>
2952
+
2953
+
2954
+
2955
+
2956
+
2957
+ <div class="description usertext">
2958
+ <p>座標轉換</p>
2959
+ <p>Unit Test: <a href="https://github.com/yuda-lyu/w-geo/blob/master/test/convertCoordinate.test.js">Github</a></p>
2960
+ </div>
2961
+
2962
+
2963
+
2964
+
2965
+
2966
+
2967
+
2968
+
2969
+
2970
+ <h5>Example</h5>
2971
+
2972
+ <pre class="prettyprint"><code>let ps
2973
+
2974
+
2975
+
2976
+
2977
+ <h5>Parameters:</h5>
2978
+
2979
+
2980
+ <table class="params">
2981
+ <thead>
2982
+ <tr>
2983
+
2984
+ <th>Name</th>
2985
+
2986
+
2987
+ <th>Type</th>
2988
+
2989
+
2990
+
2991
+
2992
+
2993
+ <th class="last">Description</th>
2994
+ </tr>
2995
+ </thead>
2996
+
2997
+ <tbody>
2998
+
2999
+
3000
+ <tr>
3001
+
3002
+ <td class="name"><code>cdFrom</code></td>
3003
+
3004
+
3005
+ <td class="type">
3006
+
3007
+
3008
+ <span class="param-type">String</span>
3009
+
3010
+
3011
+
3012
+ </td>
3013
+
3014
+
3015
+
3016
+
3017
+
3018
+ <td class="description last"><p>輸入來源座標系統字串</p></td>
3019
+ </tr>
3020
+
3021
+
3022
+
3023
+ <tr>
3024
+
3025
+ <td class="name"><code>cdTo</code></td>
3026
+
3027
+
3028
+ <td class="type">
3029
+
3030
+
3031
+ <span class="param-type">String</span>
3032
+
3033
+
3034
+
3035
+ </td>
3036
+
3037
+
3038
+
3039
+
3040
+
3041
+ <td class="description last"><p>輸入轉出座標系統字串</p></td>
3042
+ </tr>
3043
+
3044
+
3045
+
3046
+ <tr>
3047
+
3048
+ <td class="name"><code>ps</code></td>
3049
+
3050
+
3051
+ <td class="type">
3052
+
3053
+
3054
+ <span class="param-type">Array</span>
3055
+
3056
+
3057
+
3058
+ </td>
3059
+
3060
+
3061
+
3062
+
3063
+
3064
+ <td class="description last"><p>輸入座標(x,y)陣列</p></td>
3065
+ </tr>
3066
+
3067
+
3068
+ </tbody>
3069
+ </table>
3070
+
3071
+
3072
+
3073
+
3074
+
3075
+
3076
+
3077
+
3078
+
3079
+
3080
+
3081
+
3082
+
3083
+
3084
+
3085
+
3086
+ <h5>Returns:</h5>
3087
+
3088
+
3089
+ <div class="param-desc">
3090
+ <p>回傳轉出座標陣列</p>
3091
+ </div>
3092
+
3093
+
3094
+
3095
+ <dl class="param-type">
3096
+ <dt>
3097
+ Type
3098
+ </dt>
3099
+ <dd>
3100
+
3101
+ <span class="param-type">Array</span>
3102
+
3103
+
3104
+ </dd>
3105
+ </dl>
3106
+
3107
+
3108
+
3109
+
3110
+
3111
+
3112
+
3113
+
3114
+
3115
+
2906
3116
  <h4 class="name" id=".groupByDepthStartEnd"><span class="type-signature">(static) </span>groupByDepthStartEnd<span class="signature">(rows, depthStartAndEnds, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array}</span></h4>
2907
3117
 
2908
3118
 
@@ -7469,7 +7679,7 @@
7469
7679
  <br class="clear">
7470
7680
 
7471
7681
  <footer>
7472
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 07 2022 15:41:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7682
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 12 2022 15:32:18 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7473
7683
  </footer>
7474
7684
 
7475
7685
  <script>prettyPrint();</script>
@@ -0,0 +1,22 @@
1
+ import convertCoordinate from './src/convertCoordinate.mjs'
2
+
3
+
4
+ let ps
5
+ let r
6
+
7
+ ps = [121, 24]
8
+ r = convertCoordinate('WGS84', 'TWD97TM2', ps)
9
+ console.log('WGS84', 'to', 'TWD97TM2', r)
10
+ // => WGS84 to TWD97TM2 [ 250000, 2655023.124957118 ]
11
+
12
+ ps = [121, 24]
13
+ r = convertCoordinate('WGS84', 'TWD67TM2', ps)
14
+ console.log('WGS84', 'to', 'TWD67TM2', r)
15
+ // => WGS84 to TWD67TM2 [ 249171.1063953548, 2655228.969012536 ]
16
+
17
+ ps = [250000, 2655023]
18
+ r = convertCoordinate('TWD97TM2', 'TWD67TM2', ps)
19
+ console.log('TWD97TM2', 'to', 'TWD67TM2', r)
20
+ // => TWD97TM2 to TWD67TM2 [ 249171.10639535502, 2655228.8440549527 ]
21
+
22
+ //node --experimental-modules --es-module-specifier-resolution=node g10-convertCoordinate.mjs
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "w-geo",
3
- "version": "1.0.43",
4
- "description": "A tool for geotech analysis.",
3
+ "version": "1.0.44",
5
4
  "main": "dist/w-geo.umd.js",
6
5
  "dependencies": {
7
6
  "decimal.js": "^10.3.1",
8
7
  "lodash": "^4.17.21",
9
- "wsemi": "^1.6.54"
8
+ "proj4": "^2.8.0",
9
+ "wsemi": "^1.6.62"
10
10
  },
11
11
  "devDependencies": {
12
12
  "w-package-tools": "^1.0.65"
@@ -27,9 +27,5 @@
27
27
  "browser"
28
28
  ],
29
29
  "author": "yuda-lyu(semisphere)",
30
- "license": "MIT",
31
- "bugs": {
32
- "url": "https://github.com/yuda-lyu/w-geo/issues"
33
- },
34
- "homepage": "https://github.com/yuda-lyu/w-geo#readme"
30
+ "license": "MIT"
35
31
  }
@@ -0,0 +1,157 @@
1
+ import size from 'lodash/size'
2
+ import isearr from 'wsemi/src/isearr.mjs'
3
+ import haskey from 'wsemi/src/haskey.mjs'
4
+ import proj4 from 'proj4'
5
+
6
+
7
+ //defs
8
+ proj4.defs([
9
+ [
10
+ 'EPSG:4326',
11
+ '+title=WGS84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees'],
12
+ [
13
+ 'EPSG:3826',
14
+ '+title=TWD97 TM2 +proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m +no_defs'
15
+ ],
16
+ [
17
+ 'EPSG:3828',
18
+ '+title=TWD67 TM2 +proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=aust_SA +towgs84=-752,-358,-179,-0.0000011698,0.0000018398,0.0000009822,0.00002329 +units=m +no_defs'
19
+ ]
20
+ ])
21
+
22
+ // function core() {
23
+
24
+ // //EPSG
25
+ // let EPSG3826 = new proj4.Proj('EPSG:3826') //TWD97 TM2(121分帶)
26
+ // let EPSG3828 = new proj4.Proj('EPSG:3828') //TWD67 TM2(121分帶)
27
+ // let EPSG4326 = new proj4.Proj('EPSG:4326') //WGS84
28
+
29
+ // function cvWGS84toTWD97TM2(ps) {
30
+ // //4326轉3826(WGS84經緯度轉TWD97 TM2)
31
+
32
+ // //check
33
+ // if (!isearr(ps) && size(ps) !== 2) {
34
+ // throw new Error('ps is not an array(length=2)')
35
+ // }
36
+
37
+ // return proj4(EPSG4326, EPSG3826, ps)
38
+ // }
39
+
40
+ // function cvWGS84toTWD67TM2(ps) {
41
+ // //4326轉3828(WGS84經緯度轉TWD67 TM2)
42
+
43
+ // //check
44
+ // if (!isearr(ps) && size(ps) !== 2) {
45
+ // throw new Error('ps is not an array(length=2)')
46
+ // }
47
+
48
+ // return proj4(EPSG4326, EPSG3828, ps)
49
+ // }
50
+
51
+ // function cvTWD97TM2toWGS84(ps) {
52
+ // //3826轉4326(TWD97 TM2轉WGS84經緯度)
53
+
54
+ // //check
55
+ // if (!isearr(ps) && size(ps) !== 2) {
56
+ // throw new Error('ps is not an array(length=2)')
57
+ // }
58
+
59
+ // return proj4(EPSG3826, EPSG4326, ps)
60
+ // }
61
+
62
+ // function cvTWD67TM2toWGS84(ps) {
63
+ // //3828轉4326(TWD67 TM2轉WGS84經緯度)
64
+
65
+ // //check
66
+ // if (!isearr(ps) && size(ps) !== 2) {
67
+ // throw new Error('ps is not an array(length=2)')
68
+ // }
69
+
70
+ // return proj4(EPSG3828, EPSG4326, ps)
71
+ // }
72
+
73
+ // return {
74
+ // proj4,
75
+ // cvWGS84toTWD97TM2,
76
+ // cvWGS84toTWD67TM2,
77
+ // cvTWD97TM2toWGS84,
78
+ // cvTWD67TM2toWGS84,
79
+ // }
80
+ // }
81
+
82
+
83
+ /**
84
+ * 座標轉換
85
+ *
86
+ * Unit Test: {@link https://github.com/yuda-lyu/w-geo/blob/master/test/convertCoordinate.test.js Github}
87
+ * @memberOf w-geo
88
+ * @param {String} cdFrom 輸入來源座標系統字串
89
+ * @param {String} cdTo 輸入轉出座標系統字串
90
+ * @param {Array} ps 輸入座標(x,y)陣列
91
+ * @returns {Array} 回傳轉出座標陣列
92
+ * @example
93
+ *
94
+ * let ps
95
+ * let r
96
+ *
97
+ * ps = [121, 24]
98
+ * r = convertCoordinate('WGS84', 'TWD97TM2', ps)
99
+ * console.log('WGS84', 'to', 'TWD97TM2', r)
100
+ * // => WGS84 to TWD97TM2 [ 250000, 2655023.124957118 ]
101
+ *
102
+ * ps = [121, 24]
103
+ * r = convertCoordinate('WGS84', 'TWD67TM2', ps)
104
+ * console.log('WGS84', 'to', 'TWD67TM2', r)
105
+ * // => WGS84 to TWD67TM2 [ 249171.1063953548, 2655228.969012536 ]
106
+ *
107
+ * ps = [250000, 2655023]
108
+ * r = convertCoordinate('TWD97TM2', 'TWD67TM2', ps)
109
+ * console.log('TWD97TM2', 'to', 'TWD67TM2', r)
110
+ * // => TWD97TM2 to TWD67TM2 [ 249171.10639535502, 2655228.8440549527 ]
111
+ *
112
+ */
113
+ function convertCoordinate(cdFrom, cdTo, ps) {
114
+
115
+ //check
116
+ if (!isearr(ps) && size(ps) !== 2) {
117
+ throw new Error('ps is not an array(length=2)')
118
+ }
119
+
120
+ //core
121
+ // let cc = core()
122
+ // cvWGS84toTWD97TM2,
123
+ // cvWGS84toTWD67TM2,
124
+ // cvTWD97TM2toWGS84,
125
+ // cvTWD67TM2toWGS84,
126
+
127
+ //kp
128
+ let kp = {
129
+ 'TWD97TM2': 'EPSG:3826',
130
+ 'TWD67TM2': 'EPSG:3828',
131
+ 'WGS84': 'EPSG:4326',
132
+ }
133
+
134
+ //check cdFrom
135
+ if (haskey(kp, cdFrom)) {
136
+ cdFrom = kp[cdFrom]
137
+ }
138
+
139
+ //check cdTo
140
+ if (haskey(kp, cdTo)) {
141
+ cdTo = kp[cdTo]
142
+ }
143
+
144
+ //proj4
145
+ // let EPSG3826 = new proj4.Proj('EPSG:3826') //TWD97 TM2(121分帶)
146
+ // let EPSG3828 = new proj4.Proj('EPSG:3828') //TWD67 TM2(121分帶)
147
+ // let EPSG4326 = new proj4.Proj('EPSG:4326') //WGS84
148
+ // proj4(EPSG4326, EPSG3826, ps)
149
+ let pj4From = new proj4.Proj(cdFrom)
150
+ let pj4To = new proj4.Proj(cdTo)
151
+ let r = proj4(pj4From, pj4To, ps)
152
+
153
+ return r
154
+ }
155
+
156
+
157
+ export default convertCoordinate
@@ -0,0 +1,46 @@
1
+ import assert from 'assert'
2
+ import convertCoordinate from '../src/convertCoordinate.mjs'
3
+
4
+
5
+ describe(`convertCoordinate`, function() {
6
+
7
+ // ps = [121, 24]
8
+ // r = convertCoordinate('WGS84', 'TWD97TM2', ps)
9
+ // console.log('WGS84', 'to', 'TWD97TM2', r)
10
+ // => WGS84 to TWD97TM2 [ 250000, 2655023.124957118 ]
11
+ let c1ps = [121, 24]
12
+ let c1in = `'WGS84', 'TWD97TM2', ${c1ps}`
13
+ let c1out = [250000, 2655023.124957118]
14
+ it(`should return ${c1out} when convertCoordinate(${c1in})`, function() {
15
+ let r = convertCoordinate('WGS84', 'TWD97TM2', c1ps)
16
+ let rr = c1out
17
+ assert.strict.deepStrictEqual(r, rr)
18
+ })
19
+
20
+ // ps = [121, 24]
21
+ // r = convertCoordinate('WGS84', 'TWD67TM2', ps)
22
+ // console.log('WGS84', 'to', 'TWD67TM2', r)
23
+ // // => WGS84 to TWD67TM2 [ 249171.1063953548, 2655228.969012536 ]
24
+ let c2ps = [121, 24]
25
+ let c2in = `'WGS84', 'TWD67TM2', ${c2ps}`
26
+ let c2out = [249171.1063953548, 2655228.969012536]
27
+ it(`should return ${c2out} when convertCoordinate(${c2in})`, function() {
28
+ let r = convertCoordinate('WGS84', 'TWD67TM2', c2ps)
29
+ let rr = c2out
30
+ assert.strict.deepStrictEqual(r, rr)
31
+ })
32
+
33
+ // ps = [250000, 2655023]
34
+ // r = convertCoordinate('TWD97TM2', 'TWD67TM2', ps)
35
+ // console.log('TWD97TM2', 'to', 'TWD67TM2', r)
36
+ // // => TWD97TM2 to TWD67TM2 [ 249171.10639535502, 2655228.8440549527 ]
37
+ let c3ps = [250000, 2655023]
38
+ let c3in = `'TWD97TM2', 'TWD67TM2', ${c3ps}`
39
+ let c3out = [249171.10639535502, 2655228.8440549527]
40
+ it(`should return ${c3out} when convertCoordinate(${c3in})`, function() {
41
+ let r = convertCoordinate('TWD97TM2', 'TWD67TM2', c3ps)
42
+ let rr = c3out
43
+ assert.strict.deepStrictEqual(r, rr)
44
+ })
45
+
46
+ })