0
点赞
收藏
分享

微信扫一扫

使用sfs或sgs的模型图层查询服务

鱼满舱 2022-09-27 阅读 155

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

单个模型属性信息:

使用sfs或sgs的模型图层查询服务_xml

模型属性信息列表:

使用sfs或sgs的模型图层查询服务_数据_02

       其实,在数据发布的过程中,这些数据查询的服务是可以用代码就调用进行查询的,只要查询的形式符合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:PropertyIsEqualTo><ogc:PropertyName>__fid__</ogc:PropertyName><ogc:Literal>21</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter></wfs:Query></wfs:GetFeature>

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

使用sfs或sgs的模型图层查询服务_xml_03

 __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&amp;request=describefeaturetype&amp;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:boundedBy><gml:Box><gml:coordinates></gml:coordinates></gml:Box></gml:boundedBy><gml:featureMember><meshfl_0_397334 fid="meshfl_0_397334.21"><Geom><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>106.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></Geom><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>

这数据和使用sqlite打开3dml工具,具体参见文章《关于3dml数据格式说明》,返回数据和下图表中内容一致:


使用sfs或sgs的模型图层查询服务_.net_04


确定了服务的请求地址,请求内容和返回内容,在C#开发中,使用WebClient,在js开发中,使用jquery或其他ajax方式都能进行数据请求和返回。



举报

相关推荐

0 条评论