开源cesium加载cgcs2000

proj4js 坐标转换

  1. import { default as proj4 } from 'proj4'
  2. Cesium.GeoJsonDataSource.crsNames['urn:ogc:def:crs:EPSG::4490'] =
  3. Cesium.GeoJsonDataSource.crsNames['EPSG:4490'] = function (coordinates) {
  4. const fromProjection = `GEOGCS["China Geodetic Coordinate System 2000",
  5. DATUM["China 2000",
  6. SPHEROID["CGCS2000", 6378137.0, 298.257222101, AUTHORITY["EPSG","1024"]],
  7. AUTHORITY["EPSG","1043"]],
  8. PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
  9. UNIT["degree", 0.017453292519943295],
  10. AXIS["Geodetic longitude", EAST],
  11. AXIS["Geodetic latitude", NORTH],
  12. AUTHORITY["EPSG","4490"]]`
  13. const toProjection = `GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],
  14. AUTHORITY["EPSG", "6326"]], PRIMEM["Greenwich", 0, AUTHORITY["EPSG", "8901"]],
  15. UNIT["degree", 0.0174532925199433, AUTHORITY["EPSG", "9122"]], AUTHORITY["EPSG", "4326"]]`
  16. const x = coordinates[0]
  17. const y = coordinates[1]
  18. const newCoordinates = proj4(fromProjection, toProjection, [x, y])
  19. return Cesium.Cartesian3.fromDegrees(
  20. newCoordinates[0],
  21. newCoordinates[1],
  22. 0
  23. )
  24. }

`

https://www.cnblogs.com/dog2016/p/14960186.html)

关于加载CGCS2000切片

cesium加载cgcs2000\wgs84坐标系解决方式