Select to view content in your preferred language

Odd Circle Result - Oval

2583
8
01-24-2014 05:10 AM
BrianRassier
Deactivated User
Hello -

I was testing out the new Circle API and noticed an odd result, which created an oval-like circle.  A JSFiddle showing the issue is below. 

Is this result expected due to the center spatial reference and geodesic values for the circle?  I do get different results if I use different values for these items - I was still surprised to see an oval though.

http://jsfiddle.net/Z25cU/3/

Thanks
-Brian
0 Kudos
8 Replies
michaelcollins1
Frequent Contributor
It might have to do with the projection, perhaps?
0 Kudos
BrianRassier
Deactivated User
That was my initial guess too.  I believe if I make the center point use a webmercator projection it is no longer an oval.  Changing the circle to set geodesic to true also creates a circle.

Either way I was surprised and wanted to confirm this is expected.  My initial thought was if the projection was off the center would not be located where I was expecting it.
0 Kudos
AnthonyGiles
Honored Contributor
Brian,

My guess it is because you are creating a circle in a geographic projection. The distances will be corrected but the shape will be distorted in that projection.

Have a look at the help section on projections:

http://resources.arcgis.com/en/help/main/10.1/index.html#//003r0000000q000000

Regards

Anthony
0 Kudos
BrianRassier
Deactivated User
Any idea how this differs from doing the same via the buffer method of the geometry service?  We have an app that creates circles via buffer, and we haven't seen this problem.  I believe the jsfiddle below shows a same setup as the odd oval result, but the buffer example does not create ovals.  The input/output spatial reference here is also 4326, and geodesic is false.

http://jsfiddle.net/3AS5r/2/
0 Kudos
AnthonyGiles
Honored Contributor
I guess the buffer always returns a geodesic circle where the create circle needs to be set to true for it to create a geodesic one.

Regards

Anthony
0 Kudos
BrianRassier
Deactivated User
That could be - I'm not well versed in these types of projection issues.  I do know the buffer example I attached has the BufferParameters.geodesic value set to false, similar to the oval example.  Are you thinking the Buffer is smart enough to override that and the new JS API isn't?
0 Kudos
AnthonyGiles
Honored Contributor
Yes, I'm with you Brian it seems like the buffer service handles things slightly different, the help does mention something about setting geodesic to true when using a geographic coordinate, but it still doesn't make it obvious:

http://resources.arcgis.com/en/help/rest/apiref/buffer.html

Regards

Anthony
0 Kudos
JianHuang
Deactivated User
First of all, using non-geodesic option on web mercator or geographic coordinate system generates meaningless circle. The radius would be a non-fixed value depending on the angle. Technically, it's not a circle even though it may look like a circle.
Secondly, the spatial reference of the circle is the same as the center point. If you know the map is under web mercator, the center point should be specified under the same SR.
The reason you are seeing an oval by passing a lat/lon center point under a web mercator map is the generated circle is under geographic CS, and it should look like a perfect circle under GCS. But the map is under Web Mercator, which would make the x axis shorter and result in an oval.
0 Kudos