angular - 将坐标转换为点、角度、openlayers
问题描述
我的数据;坐标X: 4833590.9447487565 坐标Y: 3395367.0520476755 这样。当我单击地图上的一个点时,getCoord() 函数运行并为我提供上述数据。但我需要以 geomwkt 形式保存它。因为我被提示在以下结构中调用它。
以下函数 getCoord()
getCoord(event: any){
var coordinate = this.map.getEventCoordinate(event);
this.xCoordinate=transform(coordinate, 'EPSG:3857', 'EPSG:4326')[0];
this.yCoordinate=transform(coordinate, 'EPSG:3857', 'EPSG:4326')[1];
console.log(this.xCoordinate);
console.log(this.yCoordinate);
}
public async Task<List<KadastroParselModel>> ListParselAsync(string geomWkt)
{
List<KadastroParselModel> result = new List<KadastroParselModel>();
try
{
IGeometry tempGeom = geomWkt.ToGeometry();
if(!tempGeom.IsValid){
tempGeom= tempGeom.Centroid;
}
using (IntegrationTestContext context = new IntegrationTestContext())
{
try
{
//var xx=await context.ST_InterSects(geomWkt);
result = (await context.ST_InterSects(geomWkt)).ToKadastroParselModel();
// var rresult = await context.KadastroParsel.
}
catch (Exception e)
{
throw new Exception("Veritabanına ulaşım sırasında hata oluştu.. :" + e.Message);
}
}
}
catch (Exception e)
{
return result;
}
return result;
}
解决方案
推荐阅读
- javascript - 如何使用 ```v-model``` 添加 Object.values
- apache-spark-sql - Spark数据框 - 如何将列值除以最大列值
- javascript - if/else 提取英国邮政编码的一部分
- c - 如何编写一个运行程序的 bash 脚本,直到它检测到信号 SIGSEGV、分段错误?
- sql-server - 有没有办法在 SQL Server 中查找公共列的值?
- powershell - Powershell 函数返回一个无效对象
- java - 需要一个微服务框架
- javascript - 打字稿可以推断出一个参数已经过验证吗?
- python - 在更新值时扩展 numpy 数组
- discord.js - Discord.js 中的变量开关定义?