GDAL中的地理坐标系、投影坐标系及其相互转换

news2024/11/13 15:05:00

目录

地理坐标系

国内常用地理坐标系

投影坐标系

国内常用投影坐标系(不推荐使用)

坐标转换

地理坐标转为投影坐标

投影坐标转为地理坐标


地理坐标系

原理参考这篇文章:
地理坐标系与投影坐标系区别与联系
https://yunxingluoyun.blog.csdn.net/article/details/123970678

国内常用地理坐标系

#include <cstdio>
#include "gdal_priv.h"
#include <iostream>

int main()
{
	OGRSpatialReference oSRS1;
	oSRS1.SetGeogCS("自定义地理坐标系",// 定义地理坐标系名称
		"WGS_1984",// 基准面
		"WGS84 椭球",// 椭球体名称
		SRS_WGS84_SEMIMAJOR, SRS_WGS84_INVFLATTENING,// WGS84椭球体的长半轴,WGS84椭球体扁率的倒数
		"Greenwich", 0.0,// 格林尼治子午线
		"degree", 0.0174532925199433);// 角度度量单位
	char* WGS84_WTK = NULL;
	oSRS1.exportToPrettyWkt(&WGS84_WTK);// 以规整的WTK格式输出地理坐标系的信息
	std::cout << WGS84_WTK << std::endl;
	// CGCS2000
	OGRSpatialReference oSRS2;
	oSRS2.SetWellKnownGeogCS("EPSG:4490");
	char* CGCS2000_WTK = NULL;
	oSRS2.exportToPrettyWkt(&CGCS2000_WTK);
	std::cout << CGCS2000_WTK << std::endl;
	// Beijing_1954
	OGRSpatialReference oSRS3;
	oSRS3.SetWellKnownGeogCS("EPSG:4214");
	char* Beijing_1954_WTK = NULL;
	oSRS3.exportToPrettyWkt(&Beijing_1954_WTK);
	std::cout << Beijing_1954_WTK << std::endl;
	// Xian_1980
	OGRSpatialReference oSRS4;
	oSRS4.SetWellKnownGeogCS("EPSG:4610");
	char* Xian_1980_WTK = NULL;
	oSRS4.exportToPrettyWkt(&Xian_1980_WTK);
	std::cout << Xian_1980_WTK << std::endl;

}

结果:

GEOGCS["自定义地理坐标系",
    DATUM["WGS_1984",
        SPHEROID["WGS84 椭球",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST]]
    
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"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST],
    AUTHORITY["EPSG","4490"]]
    
GEOGCS["Beijing 1954",
    DATUM["Beijing_1954",
        SPHEROID["Krassowsky 1940",6378245,298.3,
            AUTHORITY["EPSG","7024"]],
        AUTHORITY["EPSG","6214"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST],
    AUTHORITY["EPSG","4214"]]
   
GEOGCS["Xian 1980",
    DATUM["Xian_1980",
        SPHEROID["IAG 1975",6378140,298.257,
            AUTHORITY["EPSG","7049"]],
        AUTHORITY["EPSG","6610"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST],
    AUTHORITY["EPSG","4610"]]

投影坐标系

设置横轴墨卡托投影的函数SetTM()有六个参数:

国内常用投影坐标系(不推荐使用)

推荐使用例3中的方式使用坐标系,EPSG请查看网址:

EPSG.io: Coordinate Systems Worldwide
注意:这种方式定义的坐标轴与例3相反,如果使用这样方法,后面的poCT->Transform(1, &x, &y)影改为poCT->Transform(1, &y, &x)。

#include <cstdio>
#include "gdal_priv.h"
#include <iostream>

int main()
{
	OGRSpatialReference oSRS1;
	oSRS1.SetProjCS("UTM 17(WGS84) in northern hemisphere.");// 设置投影坐标系名称
	oSRS1.SetWellKnownGeogCS("EPSG:4326");// 设置地理坐标系
	oSRS1.SetUTM(17, TRUE);//设置UTM投影的投影参数
	char* UTM17_WTK = NULL;
	oSRS1.exportToPrettyWkt(&UTM17_WTK);
	std::cout << UTM17_WTK << std::endl;

	OGRSpatialReference oSRS2;
	oSRS2.SetProjCS("CGCS2000 / Gauss-Kruger CM 117E");
	oSRS2.SetWellKnownGeogCS("EPSG:4490");
	oSRS2.SetTM(0,117,1,500000,0);//起始纬度,中央经线,比例因子,东偏移量,北偏移量
	char* CGCS2000_GK_117E_WTK = NULL;
	oSRS2.exportToPrettyWkt(&CGCS2000_GK_117E_WTK);
	std::cout << "CGCS2000 / Gauss-Kruger CM 117E" << std::endl;
	std::cout <<"是否为投影坐标系:" << oSRS2.IsProjected() << std::endl;
	std::cout << CGCS2000_GK_117E_WTK << std::endl;

	OGRSpatialReference oSRS3;
	oSRS3.SetProjCS("CGCS2000 3 Degree GK Zone 39");
	oSRS3.SetWellKnownGeogCS("EPSG:4490");
	oSRS3.SetTM(0, 117, 1, 39500000, 0);//起始纬度,中央经线,比例因子,东偏移量,北偏移量
	char* CGCS2000_GK_Zone39_WTK = NULL;
	oSRS3.exportToPrettyWkt(&CGCS2000_GK_Zone39_WTK);
	std::cout << "CGCS2000 3 Degree GK Zone 39" << std::endl;
	std::cout << "是否为投影坐标系:" << oSRS3.IsProjected() << std::endl;
	std::cout << CGCS2000_GK_Zone39_WTK << std::endl;

	OGRSpatialReference oSRS4;
	oSRS4.SetProjCS("Beijing 1954 3 Degree GK CM 117E");
	oSRS4.SetWellKnownGeogCS("EPSG:4214");
	oSRS4.SetTM(0, 117, 1, 500000, 0);//起始纬度,中央经线,比例因子,东偏移量,北偏移量
	char* Beijing1954_GK_117E_WTK = NULL;
	oSRS4.exportToPrettyWkt(&Beijing1954_GK_117E_WTK);
	std::cout << "Beijing 1954 3 Degree GK CM 117E" << std::endl;
	std::cout << "是否为投影坐标系:" << oSRS4.IsProjected() << std::endl;
	std::cout << Beijing1954_GK_117E_WTK << std::endl;

	OGRSpatialReference oSRS5;
	oSRS5.SetProjCS("Xian 1980 3 Degree GK Zone 39");
	oSRS5.SetWellKnownGeogCS("EPSG:4610");
	oSRS5.SetTM(0, 117, 1, 39500000, 0);//起始纬度,中央经线,比例因子,东偏移量,北偏移量
	char* Xian_1980_GK_Zone39_WTK = NULL;
	oSRS5.exportToPrettyWkt(&Xian_1980_GK_Zone39_WTK);
	std::cout << "Xian 1980 3 Degree GK Zone 39" << std::endl;
	std::cout << "是否为投影坐标系:" << oSRS5.IsProjected() << std::endl;
	std::cout << Xian_1980_GK_Zone39_WTK << std::endl;
}

 结果:

PROJCS["UTM 17(WGS84) in northern hemisphere.",
    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"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-81],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]
    
CGCS2000 / Gauss-Kruger CM 117E
是否为投影坐标系:1
PROJCS["CGCS2000 / Gauss-Kruger CM 117E",
    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"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",117],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]
    
CGCS2000 3 Degree GK Zone 39
是否为投影坐标系:1
PROJCS["CGCS2000 3 Degree GK Zone 39",
    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"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",117],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",39500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]
    
Beijing 1954 3 Degree GK CM 117E
是否为投影坐标系:1
PROJCS["Beijing 1954 3 Degree GK CM 117E",
    GEOGCS["Beijing 1954",
        DATUM["Beijing_1954",
            SPHEROID["Krassowsky 1940",6378245,298.3,
                AUTHORITY["EPSG","7024"]],
            AUTHORITY["EPSG","6214"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4214"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",117],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]
    
Xian 1980 3 Degree GK Zone 39
是否为投影坐标系:1
PROJCS["Xian 1980 3 Degree GK Zone 39",
    GEOGCS["Xian 1980",
        DATUM["Xian_1980",
            SPHEROID["IAG 1975",6378140,298.257,
                AUTHORITY["EPSG","7049"]],
            AUTHORITY["EPSG","6610"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4610"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",117],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",39500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]

坐标转换

地理坐标转为投影坐标

#include <cstdio>
#include "gdal_priv.h"

int main()
{
    OGRSpatialReference oSourceSRS, oTargetSRS;
    OGRCoordinateTransformation* poCT;
    oSourceSRS.importFromEPSG(4610); // 地理坐标系:Xian 1980
    oTargetSRS.importFromEPSG(2383); // 投影坐标系:Xian 1980 / 3-degree Gauss-Kruger CM 114E
    
    char* Xian_1980 = NULL;
    oSourceSRS.exportToPrettyWkt(&Xian_1980);
    char* Xian_1980_GK_114E_WTK = NULL;
    oTargetSRS.exportToPrettyWkt(&Xian_1980_GK_114E_WTK);
    printf("%s,%s\n", "oSourceSRS:\n", Xian_1980);
    printf("%s,%s\n", "oTargetSRS:\n", Xian_1980_GK_114E_WTK);


    poCT = OGRCreateCoordinateTransformation(&oSourceSRS, &oTargetSRS);
    double x, y;
    x = 38.8; //纬度
    y = 113.6; //经度
    printf("经纬度坐标:%.9lf	%.9lf", x, y);
    if (poCT == NULL || !poCT->Transform(1, &x, &y))
    {
        printf("Transformation failed.\n");
    }
    else
    {
        printf("\n平面坐标:%.9lf	%.9lf", x, y);
    }
    
}

 结果:

oSourceSRS:
,GEOGCS["Xian 1980",
    DATUM["Xian_1980",
        SPHEROID["IAG 1975",6378140,298.257,
            AUTHORITY["EPSG","7049"]],
        AUTHORITY["EPSG","6610"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST],
    AUTHORITY["EPSG","4610"]]
oTargetSRS:
,PROJCS["Xian 1980 / 3-degree Gauss-Kruger CM 114E",
    GEOGCS["Xian 1980",
        DATUM["Xian_1980",
            SPHEROID["IAG 1975",6378140,298.257,
                AUTHORITY["EPSG","7049"]],
            AUTHORITY["EPSG","6610"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4610"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",114],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Northing",NORTH],
    AXIS["Easting",EAST],
    AUTHORITY["EPSG","2383"]]
经纬度坐标:38.800000000        113.600000000
平面坐标:4296379.277209882     465252.023887851

投影坐标转为地理坐标

#include <cstdio>
#include "gdal_priv.h"

int main()
{
    OGRSpatialReference oSourceSRS, oTargetSRS;
    OGRCoordinateTransformation* poCT;
    oSourceSRS.importFromEPSG(2383); // Xian 1980 / 3-degree Gauss-Kruger CM 114E
    oTargetSRS.importFromEPSG(4610); // Xian 1980 

    char* Xian_1980_GK_114E_WTK = NULL;
    oSourceSRS.exportToPrettyWkt(&Xian_1980_GK_114E_WTK);
    char* Xian_1980 = NULL;
    oTargetSRS.exportToPrettyWkt(&Xian_1980);

    printf("%s,%s\n", "oSourceSRS:\n", Xian_1980);
    printf("%s,%s\n", "oTargetSRS:\n", Xian_1980_GK_114E_WTK);


    poCT = OGRCreateCoordinateTransformation(&oSourceSRS, &oTargetSRS);
    double x, y;  
    x = 4296379.277209882; //纬度
    y = 465252.023887851; //经度
    printf("\n平面坐标:%.9lf	%.9lf", x, y);
    
    if (poCT == NULL || !poCT->Transform(1, &x, &y))
    {
        printf("Transformation failed.\n");
    }
    else
    {
        printf("\n经纬度坐标:%.9lf  %.9lf", x, y);
    }
    
}

结果:

oSourceSRS:
,GEOGCS["Xian 1980",
    DATUM["Xian_1980",
        SPHEROID["IAG 1975",6378140,298.257,
            AUTHORITY["EPSG","7049"]],
        AUTHORITY["EPSG","6610"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST],
    AUTHORITY["EPSG","4610"]]
oTargetSRS:
,PROJCS["Xian 1980 / 3-degree Gauss-Kruger CM 114E",
    GEOGCS["Xian 1980",
        DATUM["Xian_1980",
            SPHEROID["IAG 1975",6378140,298.257,
                AUTHORITY["EPSG","7049"]],
            AUTHORITY["EPSG","6610"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4610"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",114],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Northing",NORTH],
    AXIS["Easting",EAST],
    AUTHORITY["EPSG","2383"]]

平面坐标:4296379.277209882     465252.023887851
经纬度坐标:38.800000000  113.600000000

参考资料:

《GDAL源码剖析与开发指南》
ogr_srs_api.h:空间参考系C api — GDAL 文档

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1543760.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

极智项目 | 基于YOLOv5+DeepSort实现的车流量统计算法

欢迎关注我的公众号「极智视界」&#xff0c;获取我的更多技术分享 大家好&#xff0c;我是极智视界&#xff0c;本文分享一下 基于YOLOv5DeepSort实现的车流量统计算法。 车流量统计的实现一般原理是跟踪画面上检测出来的车辆&#xff0c;并给每个框标上了序号&#xff0c;当…

轨迹预测后处理之非极大值抑制(NMS)

非极大值抑制是图像处理里面的一种算法&#xff08;比如边缘检测会使用到&#xff09; 轨迹预测这里借鉴了其思想&#xff0c;比如说对于某个场景中的某辆车&#xff0c;我们使用模型预测 64 条轨迹或者更多&#xff0c;以很好地捕获多模态性&#xff0c;同时每条轨迹对应一个…

JavaScript 基础、内置对象、BOM 和 DOM 常用英文单词总结

一提到编程、软件、代码。对于英语不是很熟悉的同学望而却步。其实没有想像中的难么难&#xff0c;反复练习加上自己的思考、总结&#xff0c;会形成肌肉记忆。整理一下&#xff0c;初学者每天30遍。 1、JavaScript 基础语法 break&#xff1a;中断循环或 switch 语句的执行。…

蔚来JAVA面试(收集)

先叠加&#xff0c;这个是自己找的答案不一定对&#xff0c;只是给我参考看看而已。 一、项目 这个没有&#xff0c;根据实际项目情况来。蔚来比较喜欢拷打项目&#xff0c;所以要对项目非常熟悉&#xff08;慌&#xff09; 二、JAVA基础 2.1 Java中的IO模型有用到过吗&#…

YOLOv9改进策略:卷积魔改 | SCConv:空间和通道重建卷积,即插即用,助力检测 | CVPR2023

&#x1f4a1;&#x1f4a1;&#x1f4a1;本文改进内容&#xff1a; CVPR2023 SCConv 由两个单元组成&#xff1a;空间重建单元&#xff08;SRU&#xff09;和通道重建单元&#xff08;CRU&#xff09;。 SRU利用分离重建方法来抑制空间冗余&#xff0c;而CRU使用分割-变换-融…

每秒批量插入10000条数据到MySQL中,资源消耗(带宽、IOPS)有多少?

文章目录 &#x1f50a;博主介绍&#x1f964;本文内容起因代码资源情况改造 &#x1f4e2;文章总结&#x1f4e5;博主目标 &#x1f50a;博主介绍 &#x1f31f;我是廖志伟&#xff0c;一名Java开发工程师、Java领域优质创作者、CSDN博客专家、51CTO专家博主、阿里云专家博主、…

http和socks5代理哪个隐蔽性更强?

HTTP代理和SOCKS5代理各有其优缺点&#xff0c;但就隐蔽性而言&#xff0c;SOCKS5代理通常比HTTP代理更隐蔽。以下是它们的比较&#xff1a; HTTP代理&#xff1a; 透明性较高&#xff1a;HTTP代理在HTTP头中会透露原始客户端的IP地址&#xff0c;这使得它相对不太隐蔽。…

算法打卡day28|贪心算法篇02|Leetcode 122.买卖股票的最佳时机 II、55. 跳跃游戏、45.跳跃游戏 II

算法题 Leetcode 122.买卖股票的最佳时机 II 题目链接:122.买卖股票的最佳时机 II 大佬视频讲解&#xff1a;买卖股票的最佳时机 II视频讲解 个人思路 因为只有一只股票&#xff0c;且两天作一个交易单元&#xff0c;那每次只收集正利润就可以最终最多可以获取的利润&#xf…

docker--Dockerfile (三)

1&#xff0c;Dcockerfile是什么 docker推荐使用dockerfile的定义文件和docker build命令来构建镜像。dockerfile使用基本的基于DSL&#xff08;面向领域语言&#xff09;语法的指令来构建Docker镜像。另一种创建Docker镜像的方式是使用docker commit&#xff0c;不推荐使用。 …

深入解析Mybatis-Plus框架:简化Java持久层开发(十三)

&#x1f340; 前言 博客地址&#xff1a; CSDN&#xff1a;https://blog.csdn.net/powerbiubiu &#x1f44b; 简介 本章节介绍下Mybatis-Plus框架的逻辑删除功能。 &#x1f4d6; 正文 1 逻辑删除介绍 1.1 什么是逻辑删除&#xff1f; 首先我们先来了解下与逻辑删除对应…

手把手教集成环信新版UIKit组件,快速构建Android应用

前言 环信新版UIKit已重磅发布&#xff01;目前包含单群聊UIKit、聊天室ChatroomUIKit&#xff0c;本文详细讲解Android端单群聊UIKit的集成教程。 环信单群聊 UIKit 是基于环信即时通讯云 IM SDK 开发的一款即时通讯 UI 组件库&#xff0c;提供各种组件实现会话列表、聊天界…

redis实战-黑马点评-短信登录

实现登录功能&#xff1a; 发送手机验证码&#xff1a; public Result sendCode(String phone, HttpSession session) {//获取手机号&#xff0c;校验手机号//如果不符合&#xff0c;返回错误信息if (!RegexUtils.isPhoneInvalid(phone)){//判断手机号是否有效return Result.fa…

MCGS学习——运行策略与脚本程序

语法讲解 运行策略&#xff1a;脚本的编程环境启动策略&#xff1a;在进入运行环境后首先运行的策略&#xff0c;只运行一次&#xff0c;一般完成系统初始化的处理循环策略&#xff1a;按照用户指定的周期时间&#xff0c;循环执行策略块内的内容&#xff0c;通常用来完成流程…

pytorch中tensor类型转换的几个函数

目录 IntTensor转FloatTensor FloatTensor转IntTensor Tensor类型变为python的常规类型 IntTensor转FloatTensor .float函数&#xff1a; FloatTensor转IntTensor .int函数 Tensor类型变为python的常规类型 item函数

业务问题:分析最近1周的用户行为转化

1.数据集 2.问题分析 数据部分截图样例&#xff1a; 其中&#xff0c;“行为类型”列中的值有4种&#xff0c;对应4种用户行为&#xff0c;分别是&#xff1a;用户对商品进行浏览、收藏、加购、购买行为。 业务场景&#xff1a; 地点是&#xff1a;公司淘宝店铺 时间范围是&a…

利泰大健康邀您莅临2024第七届燕窝及天然滋补品博览会

2024第七届世界燕窝及天然滋补品博览会 2024年8月7-9日| 上海新国际博览中心 同期举办&#xff1a;第三届世界滋补产业生态大会暨交流晚宴/颁奖典礼 2024第九届酵素、益生产品博览会 2024上海国际月子健康博览会 展会介绍 世界燕窝及天然滋补品展览会暨世界滋补产业生态发…

必备基础01-TypeScript

一、TypeScript W3C、菜鸟、b站都有教程 这里不多说&#xff0c;只是写一下基础&#xff0c;能看懂即可 内容来源于W3Cschool&#xff0c;本章整合只为以后更好查询 1.概述 TypeScript是用于应用程序规模开发的JavaScript。 TypeScript是强类型&#xff0c;面向对象的编译…

JavaWeb后端——HTTP协议/Tomcat

HTTP HTTP协议&#xff1a;无状态&#xff0c;对事务处理没有记忆能力。每次请求-响应都是独立的。后一次请求不会记录前一次请求数据。缺点&#xff1a;多次请求之间不能共享数据&#xff0c;优点&#xff1a;速度快。 HTTP协议请求报文&#xff1a; HTTP协议响应报文&#x…

防火墙是什么?谈谈部署Web防火墙重要性

如今&#xff0c;多云环境、API安全功能扩展、合作伙伴集成即时可用、可用性和可视化增强以及提高自动化程度已经成为基本要求。伴随企业应用架构的迁移&#xff0c;在用户端&#xff0c;需要在部署环境不断扩展但人员技能有限的情况下&#xff0c;保护数量日益增长的应用安全。…

python能做什么

python能做什么 Web开发&#xff1a;Python具有许多流行的Web框架&#xff0c;如Django和Flask&#xff0c;使得它成为Web开发的首选语言。它简洁、易于学习、且拥有丰富的生态系统&#xff0c;能够快速构建高性能的Web应用。 数据科学和机器学习&#xff1a;Python在数据科学…