3

ジオサーバーで WFS GetFeature を使用して GML 形式の日付でフィルター処理されたデータを取得しようとしていますが、操作は時間パラメーターを無視し、すべてのデータを含む巨大な GML ファイルを返すだけです。これは私が使用しているクエリです:

http://localhost:8082/geoserver/it.geosolutions/ows?service=WFS&version=1.2.0&request=GetFeature&typeName=it.geosolutions:tsige&time=2011-07-25T00:00:00.0Z/2011-07-25T23:59:59.999Z

これによると、WFSのGetFeature操作で時間パラメータがサポートされているはずなので、何が悪いのかわかりません。また、XML や JSON 形式、またはその他の解析しやすい形式で時間によってフィルター処理されたデータを取得するための代替手段は何ですか?

4

1 に答える 1

6

すべてのベンダー実装がすべてのパラメーターをサポートしているわけではありません。これは、OGC サービスを使用する喜びの 1 つです。また、GeoServer は WFS 1.0.0、1.1.0、および 2.0.0 を実装していることにも注意してください (上記のサンプルでは 1.2.0 ではありません)。

OGC フィルターを使用して (比較的冗長な) POST 要求で必要なことを行うことができます。これは GET で機能する可能性がありますが、読者の演習として残します...

<wfs:GetFeature 
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:ows="http://www.opengis.net/ows"
  xmlns:wfs="http://www.opengis.net/wfs"
  xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
service="WFS" version="1.1.0" outputFormat="JSON">
  <wfs:Query typeName="it.geosolutions:tsige" srsName="EPSG:4326">
    <ogc:Filter>
      <ogc:And>
        <ogc:PropertyIsGreaterThanOrEqualTo>
          <ogc:PropertyName>your-time-variabe-here</ogc:PropertyName>
          <ogc:Function name="dateParse">
            <ogc:Literal>yyyy-MM-dd</ogc:Literal>
            <ogc:Literal>2011-07-25</ogc:Literal>
          </ogc:Function>
        </ogc:PropertyIsGreaterThanOrEqualTo>
        <ogc:PropertyIsLessThan>
          <ogc:PropertyName>your-time-variable-here</ogc:PropertyName>
          <ogc:Function name="dateParse">
            <ogc:Literal>yyyy-MM-dd</ogc:Literal>
            <ogc:Literal>2011-07-26</ogc:Literal>
          </ogc:Function>
        </ogc:PropertyIsLessThan>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

として保存されたリクエストでcurlを使用してこれをテストできますwfs.xml

curl -d @wfs.xml -H "Content-Type: application/xml" "http://localhost:8082/geoserver/it.geosolutions/ows"
于 2014-08-29T05:14:25.103 に答える