Select to view content in your preferred language

JSON Geometry - GetSamples

1085
3
12-07-2017 06:37 AM
MichaelRutkowski
Regular Contributor

I'm running a REST query and it is not working for one geometry, but is for another. Is there a mechanism for determining if  a geometry is valid or not? I found GeoJSONLint - Validate your GeoJSON , but couldn't find something for ESRI's APIs.

I know the rest of the parameters I enter are valid, because I tested the function by swapping out a geometry I know that works.

I'm getting the following error:

{  "error": {   "code": 400,   "message": "Invalid or missing input parameters.",   "details": []  } }

Bad Geometry (not working in my service):

{"rings": [[[-7949872.332327881,5251978.743232549],[-7949868.499244263,5251978.1339145275],[-7949865.041371125,5251976.365604301],[-7949862.297191506,5251973.611397049],[-7949860.535324938,5251970.140896959],[-7949859.928231544,5251966.293823039],[-7949860.535334537,5251962.446752237],[-7949862.297207038,5251958.97626031],[-7949865.041386656,5251956.22206315],[-7949868.499253862,5251954.45376109],[-7949872.332327881,5251953.844446186],[-7949876.179384461,5251954.45376109],[-7949879.649865517,5251956.22206315],[-7949882.404055541,5251958.97626031],[-7949884.17235512,5251962.446752237],[-7949884.781672734,5251966.293823039],[-7949884.172364719,5251970.140896959],[-7949882.404071072,5251973.611397051],[-7949879.649881047,5251976.3656043],[-7949876.17939406,5251978.1339145275],[-7949872.332327881,5251978.743232549]]], "spatialReference":{"wkid":102100}}

It's weird, because I use the following geometry and it works perfectly:

{"rings": [[[-7963957.049118099,5227422.1263048],[-7963953.225959912,5227421.518553044],[-7963949.777040598,5227419.754788266],[-7963947.03996673,5227417.007660669],[-7963945.282662304,5227413.546081402],[-7963949.777056001,5227399.663025433],[-7963953.225969432,5227397.899268757],[-7963957.049118099,5227397.291520092],[-7963960.886285824,5227397.899268757],[-7963964.347846032,5227399.663025433],[-7963967.09495644,5227402.410143024],[-7963968.858710604,5227405.871714194],[-7963969.4664619425,5227409.708896252],[-7963968.858720122,5227413.546081402],[-7963967.094971841,5227417.007660669],[-7963964.347861435,5227419.754788266],[-7963960.886295345,5227421.518553044],[-7963957.049118099,5227422.1263048]]], "spatialReference":{"wkid":102100}}

The whole form data is as follows:

https://SERVERNAME/arcgis/rest/services/EstimatedFloodDepth/ImageServer/getSamples

  1. geometry:
    {"rings": [[[-7949872.332327881,5251978.743232549],[-7949868.499244263,5251978.1339145275],[-7949865.041371125,5251976.365604301],[-7949862.297191506,5251973.611397049],[-7949860.535324938,5251970.140896959],[-7949859.928231544,5251966.293823039],[-7949860.535334537,5251962.446752237],[-7949862.297207038,5251958.97626031],[-7949865.041386656,5251956.22206315],[-7949868.499253862,5251954.45376109],[-7949872.332327881,5251953.844446186],[-7949876.179384461,5251954.45376109],[-7949879.649865517,5251956.22206315],[-7949882.404055541,5251958.97626031],[-7949884.17235512,5251962.446752237],[-7949884.781672734,5251966.293823039],[-7949884.172364719,5251970.140896959],[-7949882.404071072,5251973.611397051],[-7949879.649881047,5251976.3656043],[-7949876.17939406,5251978.1339145275],[-7949872.332327881,5251978.743232549]]], "spatialReference":{"wkid":102100}}
  2. geometryType:
    esriGeometryPolygon
  3. sampleDistance:
  4. sampleCount:
    1000
  5. mosaicRule:
  6. pixelSize:
  7. returnFirstValueOnly:
    false
  8. f:
    pjson
0 Kudos
3 Replies
ThomasSolow
Frequent Contributor

Both of your geometries are valid as far as the JS API is concerned.  I was able to create graphics from each one and add it to a map.

I would take a look at server logs to get a more complete picture of what's going wrong here.

MichaelRutkowski
Regular Contributor

I'm not seeing anything odd with the geometries either. The logs aren't telling me anything informative either.

0 Kudos
Jack_Zhang
Frequent Contributor

that's an example of poor error message that doesn't really help at all. I've tried many ways couldn't work it out. Here's a sample image service at from ESRI, I'm wondering if ESRI could provide a working example with this service. The code snippet provided in the help doc refers to fake server which could be tested. Get Samples: (CharlotteLAS) 

0 Kudos