简体   繁体   中英

How to create extent from featureset using arcgis rest api only?

Is there any way to get extent from featureset (contains Feature objects)?

Featureset is obtained by performing query operation on feature service layer in esri rest api.

Esri rest api 10.3 introduced new parameter (returnExtentOnly) to retrieve extent but it is not available in previous versions. Client is in plain java and do not want to introduce any esri client API.

1) Is there any way to get extent using rest services only? (where input = geometries of polygons)

2) Any java util available to calculate extent based on polygon geometries (featureset)?

Eg in 10.3 http://api.imb.org/arcgis/rest/services/LIVE/Urban/MapServer/0/query?where=GENC1%3D%27US-CA%27&returnExtentOnly=true&f=pjson

It sounds like you are looking for Statistics from your feature set, Selecting all then returning your coordinate fields with something like:

[
{
    "statisticType": "min",
    "onStatisticField": ,"Your Longitude Field",
    "outStatisticFieldName": "Min_LNG_NR"
  },
{
    "statisticType": "max",
    "onStatisticField": "Your Longitude Field",
    "outStatisticFieldName": "Max_LNG_NR"
  },
{
    "statisticType": "min",
    "onStatisticField": "Your Latitude Field",
    "outStatisticFieldName": "Min_LAT_NR"
  },
{
    "statisticType": "max",
    "onStatisticField": "Your Latiitude Field",
    "outStatisticFieldName": "Max_LAT_NR"
  }
]

in the out put Statistics section.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM