skyline二次开发:sfs或sgs的模型图层查询服务

在TE中连接sfs或者sgs发布的3dml模型图层,单选每个模型会弹出相应的属性信息,或者点击图层右键,可以查询模型图层的属性信息。

单个模型属性信息:
单个属性信息
模型属性信息列表:

模型属性列表
其实,在数据发布的过程中,这些数据查询的服务是可以用代码就调用进行查询的,只要查询的形式符合sfs或者sgs的数据服务要求,即可返回查询的结果。

例如,单个模型的属性信息查询,通过网络抓包,发现查询是通过post的方式,发送给服务器一个xml格式的字符串,之后返回一个xml格式的属性信息字符串;

具体的查询网络地址为:http://localhost/SG/streamer.ashx

查询方式为:POST

传入的数据:<?xml version="1.0" encoding="utf-8"?><wfs:GetFeature version=‘1.0.0’ service=‘WFS’ username=’’ password=’’ maxFeatures=‘1’ xmlns:sfs=“http://www.skylineglobe.com/sfs-schema” xmlns:ogc=“http://www.opengis.net/ogc” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:wfs=‘http://www.opengis.net/wfs’ xmlns:gml=‘http://www.opengis.net/gml’><wfs:Query typeName=‘meshfl_0_397334’><ogc:Filter xmlns:sfs=“http://www.skylineglobe.com/sfs-schema” xmlns:ogc=“http://www.opengis.net/ogc” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:wfs=‘http://www.opengis.net/wfs’ xmlns:gml=‘http://www.opengis.net/gml’>ogc:PropertyIsEqualToogc:PropertyNamefid</ogc:PropertyName>ogc:Literal21</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter></wfs:Query></wfs:GetFeature>

其中typeName在sfs或者sgs的发布图层里能找到,如下图:

__fid__和对象的标号,通过二次开发可以获得,具体参见API;

返回的数据:

<wfs:FeatureCollection xmlns=‘http://www.skylineglobe.com/sfs-schema’ xmlns:sfs=‘http://www.skylineglobe.com/sfs-schema’ xmlns:gml=‘http://www.opengis.net/gml’ xmlns:wfs=‘http://www.opengis.net/wfs’ xmlns:xsi=‘http://www.w3.org/2001/XMLSchema-instance’ xsi:schemaLocation=‘http://www.skylineglobe.com/sfs-schema http://localhost/SG/streamer.ashx?service=wfs&request=describefeaturetype&typename=meshfl_0_397334 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd’>gml:boundedBygml:Boxgml:coordinates</gml:coordinates></gml:Box></gml:boundedBy>gml:featureMember<meshfl_0_397334 fid=“meshfl_0_397334.21”>gml:Polygongml:outerBoundaryIsgml:LinearRinggml:coordinates106.712475632682,26.5755894852759 106.712756127271,26.5760308712863 106.713418738278,26.5756940678533 106.713138241961,26.5752526831408 106.712475632682,26.5755894852759</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon><TE_TYPE>MODEL</TE_TYPE><TE_DESC>SPRINGMALL</TE_DESC><TE_FNAME>SPRINGMALL.xpl2</TE_FNAME><TE_YAW>0</TE_YAW><TE_PITCH>0</TE_PITCH><TE_ROLL>0</TE_ROLL><TE_WIDTH>0</TE_WIDTH><TE_LENGTH>0</TE_LENGTH><TE_HEIGHT>0</TE_HEIGHT><TE_SCALE>1</TE_SCALE><TE_FLIP>0</TE_FLIP><TE_BESTLOD>1000</TE_BESTLOD></meshfl_0_397334></gml:featureMember></wfs:FeatureCollection>
确定了服务的请求地址,请求内容和返回内容,在C#开发中,使用WebClient,在js开发中,使用jquery或其他ajax方式都能进行数据请求和返回。

关注公众号,多多支持!
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值