Get a list of layers in GeoServer using the rest interface _php Tutorial

Source: Internet
Author: User
Recently, in the process of working, there is a need to manage the geoserver in an external program and find out that GeoServer's rest interface can meet the requirements by looking up data. The rest interface uses HTTP calls so that GeoServer can be simply invoked and configured without having to log on to the Web management interface.

GeoServer's website provides an introduction to rest's configuration APIs and examples at the address: http://docs.geoserver.org/stable/en/user/rest/index.html

The following program requests a list of layers in GeoServer by using the rest interface.

 = "http://localhost:8180/geoserver/rest/layers/"= Curl_init (, Curlopt_returntransfer,);curl_setopt (, Curlopt_verbose,);curl_setopt (, Curlopt_get,= "Admin:geoserver";curl_setopt (, Curlopt_userpwd,, Curlopt_httpheader,("Accept:application/json")); = 200= Curl_exec (= Curl_getinfo (< span="">< span="">< span="">< span="">< span="">(< span="">[' Http_code  < span="">  < span="">  < span=""> ']! = = "Request failed !" < span="">< span=""> < span="">< span="">< span="">< /c28>< span="">   < span="">= Json_decode (  , < span="">  < span=""> < span=""> < span="">  < span=""> = [' layers '] [' layer '   < span="">   < span="">   (< span="">  = =  < span="">   < span=""> < span=""> < span=""> < span="">  < span="">  [] < span=""> =  [' name '  < span=""> Json_encode (< span="">?>< span="">

Blog statement:

All the articles in this blog, in addition to the title "reproduced" In the words, all the rest of the articles are my original or in the review of the information after the completion of the reference to non-reproduced articles please indicate this statement. --Blog Park-pallee

http://www.bkjia.com/PHPjc/440337.html www.bkjia.com true http://www.bkjia.com/PHPjc/440337.html techarticle recently, in the process of working, there is a need to manage the geoserver in an external program and find out that GeoServer's rest interface can meet the requirements by looking up data. Rest interface uses ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.