假设我有一个Geoserver,运行WFS暴露的两层(带属性):
StreetLayer (geom, StreetName, Lanes, Length)
HouseLayer (geom, Address)
现在,如果我想查询所有街道的StreetLayer,但只获取StreetName和Lanes属性,我会向此发送一个GET请求:
http://geoserver/wfs?REQUEST=GetFeature&VERSION=1.1.0&typename=StreetLayer&propertyname=StreetName,Lanes
但如果我现在想查询HouseLayer和StreetLayer怎么办?这不起作用:
http://geoserver/wfs?REQUEST=GetFeature&VERSION=1.1.0&typename=StreetLayer,HouseLayer&propertyname=StreetName,Lanes,Address
我得到一个例外,说StreetName和Lanes不在HouseLayer中,反之亦然。我需要提出多个请求吗?
修改
所以我想做的是这样的事情:
http://geoserver/wfs?REQUEST=GetFeature&VERSION=1.1.0&typename=StreetLayer,HouseLayer&propertyname=(StreetName,Lanes),(Address)
答案 0 :(得分:9)
几乎在那里,你只需要在propertyName中有一个额外的逗号。这个对抗vanilla GeoServer安装:
http://localhost:8087/gswps/topp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:tasmania_cities,topp:tasmania_roads&propertyName=(ADMIN_NAME,CITY_NAME)(TYPE)
请参阅?之间没有命令)和(