REST Query: input ring selecting points

188
7
Jump to solution
10-18-2019 11:30 AM
JamesCrandall
MVP Frequent Contributor

I'm getting odd result attempting to select points by an input ring geometry.  It's actually selecting all of the points that fall outside of the input ring!

I'm missing the obvious here.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

James,

   That sounds like your point order for the ring is counter-clockwise then.

View solution in original post

0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

James,

   That sounds like your point order for the ring is counter-clockwise then.

0 Kudos
JamesCrandall
MVP Frequent Contributor

Yes that sounds like the issue.  I will look to see if there's any sorting problems I am having.

0 Kudos
JamesCrandall
MVP Frequent Contributor

I'm not sure how best to handle this.  If I query an existing map service and get a ring, is there any way to guarantee its point order?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

James,

   that is strange that you are querying a ring that is counter-clockwise. In the JS API you can use the Polygon class to test for clockwise and then use Geometry service simplify to ensure it is. But the easier way then the Geometry service is to just use the JS Array reverse method.

JamesCrandall
MVP Frequent Contributor

Ah.  Maybe I can just run the ring thru the Geometry service after I get it.  This is a python implementation but it's just another REST request.

0 Kudos
JamesCrandall
MVP Frequent Contributor

I tried running the ring into the Geometry service simplify task and it didn't seem to format the point order correctly.

0 Kudos
JamesCrandall
MVP Frequent Contributor

Robert -- I think I will take this over to the Python forum section.  You've identified the issue and I've marked your post correct answer.

Thanks!

0 Kudos