当前位置:网站首页>查找Proj4js地图投影参数
查找Proj4js地图投影参数
2022-07-30 05:45:00 【Nashomon】
在Openlayers中使用非内置的坐标系时,需要设置投影参数并注册该投影。如下代码给出了怎样使用EPSG:21781 。示例代码出处
import Map from 'ol/Map';
import View from 'ol/View';
import proj4 from 'proj4';
import {
register} from 'ol/proj/proj4';
import {
get as getProjection} from 'ol/proj';
// To use other projections, you have to register the projection in OpenLayers.
// This can easily be done with [http://proj4js.org/](proj4)
//
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
// So we create a projection instance for EPSG:21781 and pass it to
// register to make it available to the library for lookup by its
// code.
proj4.defs('EPSG:21781',
'+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 ' +
'+x_0=600000 +y_0=200000 +ellps=bessel ' +
'+towgs84=660.077,13.551,369.344,2.484,1.783,2.939,5.66 +units=m +no_defs');
register(proj4);
const swissProjection = getProjection('EPSG:21781');
// we can now use the projection:
const map = new Map({
view: new View({
projection: swissProjection
// other view properties like map center etc.
})
// other properties for your map like layers etc.
});
如果只知道epsg代码,proj4.defs中的投影参数怎么确定?所有EPSG代码的信息都可在epsg.io网站查到。
下面给出查询EPSG:21781定义的过程。
第一步:进入EPSG.io网站,搜索EPSG代码
在查到的结果下方,点击Transform coordinates。
第二步:进入详情
点击More details.
第三步:查看proj4js定义
在新进入的页面中向下滚动,找到Export,Proj4js是用于Openlayers的投影语句。
边栏推荐
- 联影医疗二面
- 2021-09-16 集成学习上--task1机器学习数学基础
- 基于R语言地理加权回归、主成分分析、判别分析等空间异质性数据分析
- 工厂模式(Swift 实现)
- 函数的信息传递(C语言实践)
- Map making of environmental impact assessment based on remote sensing interpretation and GIS technology (the latest guidelines)
- 电子工程师怎么才能规范设计标准、提高设计效率?
- R语言 生态环境领域应用
- [Punctuality Atom] Simple application of sys.c, sys.h bit-band operations
- 2021年软考中级过关
猜你喜欢
随机推荐
对于国内数据交换平台的分析
2021 soft exam intermediate pass
Receive emails from gmail with pop3
UAV ecological environment monitoring, image processing and GIS data analysis
通过位运算进行字符大小写转换
常用损失函数(二):Dice Loss
昆仑通态屏幕制作(连载4)---基础篇(图形设定与显示,按钮灯)
QT连载2:基于QT和STM32H750的LORA试验平台(1)
基于R语言地理加权回归、主成分分析、判别分析等空间异质性数据分析
配置MMdetection环境并训练
The application of Meta analysis in the field of ecological environment
R language application in the field of ecological environment
Rsync实现Win系统间的文件夹或数据同步
C语言实战小项目(传统卡牌游戏)
Meta分析在生态环境领域里的应用
为什么会出现梯度爆炸和梯度消失现象?怎么缓解这种现象的发生?
Flink-stream/batch/OLAP integrated to get Flink engine
CPU的三种工作模式:实模式、保护模式、长模式
边境的悍匪—机器学习实战:第九章 无监督学习任务
Pytorch(三):可视化工具(Tensorboard、Visdom)









