zoukankan      html  css  js  c++  java
  • ArcGIS REST API(Services Reference)

    ArcGIS Server从入门到精通

    生产环境的部署

    测试环境的部署

    开发环境的部署

    ArcGIS Server类似于一个Tomcat服务器或者是Jetty服务器,它可以和它们同时运行 发布服务接口 如REST服务 Feature Service服务 WMS服务 Mapping服务。。矢量服务 栅格服务 等等。

    如何获取Fields?:

    MapService:https://developers.arcgis.com/rest/services-reference/map-service.htm

    REST Domain查询&REST Fields查询

    2.查询图层属性字段:/arcgis/rest/services/LightweightProduct/轻量级管网产品/MapServer/layers?f=pjson

    https://developers.arcgis.com/rest/services-reference/all-layers-and-tables.htm

    https://developers.arcgis.com/labs/rest/search-for-an-address/

    Search for an address

    Overview

    You will learn: how to find addresses and places with the ArcGIS World Geocoding Service.

    The ArcGIS World Geocoding Service can find addresses, places, convert addresses to coordinates, and perform batch geocoding. If you would like to create an application that can find the coordinates (latitude and longitude) for one or more addresses, you can use the ArcGIS REST API to call the findAddressCandidates operation. All you need to do is pass in an address e.g. "380 New York St., Redlands, CA" and the service will return a set of candidates. Once you have candidates, you can add them to a map, create a route, or integrate them further into your application. You can also geocode many addresses at once with the geocodeAddresses operation. To learn more about the capabilities of the geocoding service, please visit the documentation.

    In this tutorial you will use the ArcGIS REST API to access the ArcGIS World Geocoding Service to find the coordinates for an address.

    Before you begin

    Install Postman to execute HTTP requests. Go to this tutorial if you need an access token.

    Steps

    Create a request to access the geocoding service

    1. Open Postman and click [+] in the tab bar to create a new request.

    2. In the new tab, set the following:

      • HTTP Method: GET
      • Request URL: https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates

    Add parameters to define the address and data fields to return

    1. Click on Params next to the URL and the following:

       
      • fjson
      • singleLine4730 Crystal Springs Dr, Los Angeles, CA 90027
      • outFieldsMatch_addr,Addr_type

    Execute the request to geocode the address and get the coordinate candidates

    1. Click Send to run the request.

    2. In the response window, click Pretty > JSON and it should look something like this:

      {
          "spatialReference": {
              "wkid": 4326,
              "latestWkid": 4326
          },
          "candidates": [
              {
                  "address": "4730 Crystal Springs Dr, Los Angeles, California, 90027",
                  "location": {
                      "x": -118.27393677823306,
                      "y": 34.123473000000004
                  },
                  "score": 100,
                  "attributes": {
                      "Match_addr": "4730 Crystal Springs Dr, Los Angeles, California, 90027",
                      "Addr_type": "PointAddress"
                  },
                  "extent": {
                      "xmin": -118.27486,
                      "ymin": 34.122473000000006,
                      "xmax": -118.27285999999999,
                      "ymax": 34.124473000000002
                  }
              },
              {
                  "address": "4730 Crystal Springs Rd, Los Angeles, California, 90027",
                  "location": {
                      "x": -118.29234632205821,
                      "y": 34.140621986664307
                  },
                  "score": 98.040000000000006,
                  "attributes": {
                      "Match_addr": "4730 Crystal Springs Rd, Los Angeles, California, 90027",
                      "Addr_type": "StreetAddress"
                  },
                  "extent": {
                      "xmin": -118.29334632205821,
                      "ymin": 34.139621986664309,
                      "xmax": -118.2913463220582,
                      "ymax": 34.141621986664305
                  }
              }
          ]
      }
      
    3. Go to the top of the response and find the spatialReference and candidates properties. The spatialReference is 4326 and tells you that the coordinates given in candidates will be latitude/longitude coordinates (y/x). This is the default spatial reference.

       
      {
          "spatialReference": {
              "wkid": 4326,
              "latestWkid": 4326
          },
      ...
      
    4. Find the candidates property. This is an array of possible matches for the address. Each match consists of:

       
      • address: The address of this match.
      • location: The x/y coordinates of this match. Note that x is longitude and y is latitude.
      • score: The confidence level of the geocoder in this match, on a scale of 1-100.
      • attributes: Any additional fields requested by the outFields parameter.
      • extent: a rectangular bounding box around the location given as a pair of x/y coordinates.
       "candidates": [
           {
               "address": "4730 Crystal Springs Dr, Los Angeles, California, 90027",
               "location": {
                   "x": -118.27393677823306,
                   "y": 34.123473000000004
               },
               "score": 100,
               "attributes": {
                   "Match_addr": "4730 Crystal Springs Dr, Los Angeles, California, 90027",
                   "Addr_type": "PointAddress"
               },
               "extent": {
                   "xmin": -118.27486,
                   "ymin": 34.122473000000006,
                   "xmax": -118.27285999999999,
                   "ymax": 34.124473000000002
               }
           },
         ...
      
    1. In Postman click Code below the Send button. Select a programming language and use Postman to generate sample code for your application to run this request.

    Congratulations, you're done!

    You have successfully found a set of candidates with coordinates for an address.

    Challenge

    Use geocoding suggestions

    You can use the Esri World Geocoding Service to build an auto-completing, suggestion-based UX by adding a special parameter called magicKey to findAddressCandidates instead of an address. To obtain a value for magicKey, refer to the documentation for the suggest endpoint.

    Try bulk geocoding

    If you need to geocode many addresses in bulk, you can use the geocode addresses endpoint.

    Find latitude/longitude of intersections

    findAddressCandidates can also return the coordinates of intersections if the address is in the proper format. For more information, see searching for intersections and try changing the value of singleLine to "Grasswood Ave & Cliffside Dr, Malibu, CA, 90265, USA"

  • 相关阅读:
    Largest Rectangle in Histogram
    Valid Sudoku
    Set Matrix Zeroes
    Unique Paths
    Binary Tree Level Order Traversal II
    Binary Tree Level Order Traversal
    Path Sum II
    Path Sum
    Validate Binary Search Tree
    新手程序员 e
  • 原文地址:https://www.cnblogs.com/2008nmj/p/13800910.html
Copyright © 2011-2022 走看看