@mapcatch/util 2.0.2 → 2.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcatch/util",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "main": "./dist/catchUtil.min.esm.js",
5
5
  "repository": "",
6
6
  "author": "wanyanyan",
@@ -1,17 +1,24 @@
1
1
  export default [
2
2
  {
3
- 'type': 'GEOGCS',
4
- 'title': 'WGS 84',
5
- 'authName': 'EPSG',
6
- 'authCode': 4326,
7
- 'wkt': 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]'
8
- },
9
- {
10
- 'type': 'GEOGCS',
11
- 'title': 'China Geodetic Coordinate System 2000',
12
- 'authName': 'EPSG',
13
- 'authCode': 4490,
14
- 'wkt': 'GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101,AUTHORITY["EPSG","1024"]],AUTHORITY["EPSG","1043"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4490"]]'
3
+ 'type': 'COMMON',
4
+ 'alias': 'Common',
5
+ 'title': '常用坐标系',
6
+ 'children': [
7
+ {
8
+ 'type': 'GEOGCS',
9
+ 'title': 'WGS 84',
10
+ 'authName': 'EPSG',
11
+ 'authCode': 4326,
12
+ 'wkt': 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]'
13
+ },
14
+ {
15
+ 'type': 'GEOGCS',
16
+ 'title': 'China Geodetic Coordinate System 2000',
17
+ 'authName': 'EPSG',
18
+ 'authCode': 4490,
19
+ 'wkt': 'GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101,AUTHORITY["EPSG","1024"]],AUTHORITY["EPSG","1043"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4490"]]'
20
+ }
21
+ ]
15
22
  },
16
23
  {
17
24
  'type': 'PROJCS',
@@ -163,11 +163,16 @@ class Measurement {
163
163
  flatCoordinates.pop() // 去掉最后一个重复的点
164
164
  let edges = []
165
165
  flatCoordinates.forEach((coord, index) => {
166
+ let edge = null
166
167
  if (index === flatCoordinates.length - 1) {
167
- edges.push([index, 0])
168
+ edge = [index, 0]
168
169
  } else {
169
- edges.push([index, index + 1])
170
+ edge = [index, index + 1]
170
171
  }
172
+ if (_.isEqual(flatCoordinates[edge[0]], flatCoordinates[edge[1]])) {
173
+ return
174
+ }
175
+ edges.push(edge)
171
176
  })
172
177
  triangles = cdt2d(flatCoordinates, edges, { exterior: false })
173
178
  }