基于openlayer 与geoserver的 空间分析 获取图层属性
2021/5/12 18:26:14
本文主要是介绍基于openlayer 与geoserver的 空间分析 获取图层属性,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
var point = new ol.geom.Point(ol.proj.fromLonLat([87.646 ,40.309], 'EPSG:4326')); var lineT = new ol.geom.LineString([[87.646 ,40.309], [87.646 ,40.323],[87.6506 ,40.324]]); var circleFeature = new ol.geom.Circle([87.646 ,40.309], 0.05); var polygon = new ol.geom.Polygon.fromCircle(circleFeature); //圆转为多边形后才能进行分析 //多边形分析 var polygon = new ol.geom.Polygon([[ [84.03,40.74], [87.37,40.72], [86.24,39.78], [84.03,40.74] ]]);
var featureRequest = new ol.format.WFS().writeGetFeature({ srsName: 'EPSG:4326',//坐标系统 featureNS: 'pg',//命名空间 URI featurePrefix: 'pg',//工作区名称 featureTypes: ['pol_salt_v'],//查询图层,可以是同一个工作区下多个图层,逗号隔开 outputFormat: 'application/json', //filter: ol.format.filter.intersects("geom",polygon)//前者是属性名,后者是对应值 单条件过滤 filter: ol.format.filter.and( //多条件过率 ol.format.filter.equalTo('at', '2020'), ol.format.filter.intersects("geom", 点线面的要素) ) }); fetch('http://192.168.0.164:5081/geoserver/' + 'wfs', {//geoserver wfs地址如localhost:8080/geoserver/wfs, method: 'POST', body: new XMLSerializer().serializeToString(featureRequest) }).then(function(response) { console.info(response); console.info(response.json); return response.json(); }).then(function(json) { console.info(json); var pro=json.features[0].properties; console.info(pro); }
这篇关于基于openlayer 与geoserver的 空间分析 获取图层属性的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-01基于Python+Vue开发的医院门诊预约挂号系统
- 2024-10-01基于Python+Vue开发的旅游景区管理系统
- 2024-10-01RestfulAPI入门指南:打造简单易懂的API接口
- 2024-10-01初学者指南:了解和使用Server Action
- 2024-10-01Server Component入门指南:搭建与配置详解
- 2024-10-01React 中使用 useRequest 实现数据请求
- 2024-10-01使用 golang 将ETH账户的资产平均分散到其他账户
- 2024-10-01JWT用户校验课程:从入门到实践
- 2024-10-01Server Component课程入门指南
- 2024-09-30Dnd-Kit学习:新手快速入门指南