zoukankan      html  css  js  c++  java
  • 常用的坐标系定义方法

    import proj4 from "proj4";
    import {register} from "ol/proj/proj4";
    import {Projection} from "ol/proj";
    
    
    function  definedProjection  (_epsg) {
      let projection;
      switch (_epsg) {
        case 'EPSG:4528':
          proj4.defs("EPSG:4528", "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:4528',
            extent: [37520456.55526686, 1773540.5950746932, 43213597.20383039, 5379752.8534023315],
            units: 'm'
          });
          break;
        case 'EPSG:4490':
          proj4.defs("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:4490',
            extent: [-180, -90, 180, 90],
            units: 'degree'
          });
          break;
        case 'EPSG:4326':
          proj4.defs("EPSG:4326", "+proj=longlat +datum=WGS84 +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:4326',
            extent: [-180, -90, 180, 90],
            units: 'degree'
          });
          break;
        case 'EPSG:3857':
          proj4.defs("EPSG:3857", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs");
          register(proj4);
          projection = new Projection({
            code: 'EPSG:3857',
            extent: [-20026376.39 - 20048966.10, 20026376.39, 20048966.10],
            units: 'm'
          });
          break;
      }
      return projection;
    }
  • 相关阅读:
    python--DAY7面向对象进阶
    python--socket实例
    Python---day5-各类模块的使用
    python--day4--迭代器、生成器
    Python--三元运算与lambda表达式
    python--函数式登录程序
    Python--变量作用域
    Python--函数
    Python----文件的IO操作
    swagger2文档的步骤
  • 原文地址:https://www.cnblogs.com/yangzhengier/p/14336512.html
Copyright © 2011-2022 走看看