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”下面的单选框,点击保存,清理缓存,再是修改后点击提交,保存成功。

  • 相关阅读:
    angular js 自定义指令
    web api 解决跨域的问题
    angular 监听ngrepeat结束时间
    redis关闭和启动
    intellij idea快捷键
    mysql连接字符串
    crontab命令格式
    maven中scope属性的
    maven pom文件元素说明
    引入maven以外的jar包
  • 原文地址:https://www.cnblogs.com/weiweictgu/p/6883031.html
Copyright © 2011-2022 走看看