zoukankan      html  css  js  c++  java
  • geoserver 常见问题笔记

    1、cql查询示例,根据点查询返回code的空间查询示例

    http://192.168.0.226:8080/geoserver/lgum/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=lgum:jd&cql_filter=CONTAINS(geom%2cPOINT(114.23859+22.68015))&maxFeatures=1&propertyName=JDCODE&outputFormat=json

     根据坐标查询单元网格编码

    http://192.168.0.226:8080/geoserver/lgum/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=lgum:grid&cql_filter=CONTAINS(geom%2cPOINT(114.23859+22.68015))&maxFeatures=1&propertyName=GRIDCODE&outputFormat=json

     2、根据WFS更新图层属性

    请求的URL:

    http://192.168.0.228:8080/geoserver/wfs

    POST XML参数值

     <!--       YOU PROBABLY DO NOT WANT TO RUN THIS QUERY SINCE 
           IT WILL MODIFY YOUR SOURCE DATA FILES
    
          This will update the type field for the tasmania_roads dataset.
          
       -->
    
    
    <wfs:Transaction service="WFS" version="1.0.0"
      xmlns:topp="http://www.openplans.org/topp"
      xmlns:ogc="http://www.opengis.net/ogc"
      xmlns:wfs="http://www.opengis.net/wfs">
      <wfs:Update typeName="baum:sq_baidu">
        <wfs:Property>
          <wfs:Name>MC</wfs:Name>
          <wfs:Value>罗田社区_new</wfs:Value>
        </wfs:Property>
        <ogc:Filter>
             <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>TYDZBM</ogc:PropertyName>
          <ogc:Literal>440306004009</ogc:Literal>
          </ogc:PropertyIsEqualTo>
        </ogc:Filter>
      </wfs:Update>
    </wfs:Transaction>

    更新图层时,遇到is read-only的解决方法:

    打开geoserver管理界面,点击左侧的“”Security“”中的“”Data“”栏,点击“Rule path”中的“..w”,勾选“Grant access to any role”下面的单选框,点击保存,清理缓存,再是修改后点击提交,保存成功。

  • 相关阅读:
    类似吸顶功能解决ios不能实时监听onscroll的触发问题
    js 移动端识别手机号码
    H5输入框实时记录文字个数
    C语言指针和数组
    PHP变量
    PHP 的引用计数基础知识
    PHP提高效率的经验
    JS内置Function对象详解
    Javascript小细节总结
    浅析C++中内存分配的方式
  • 原文地址:https://www.cnblogs.com/weiweictgu/p/6883031.html
Copyright © 2011-2022 走看看