Breaks rendering issues with decimal fields

931
4
Jump to solution
12-16-2013 12:08 PM
AZendel
Occasional Contributor III
I've got an otherwise functional version of this sample: http://jsbin.com/ILAYUNeK.   But I'm also seeing this issue in the ArcGIS.com maps, including this one.  In this map, the counties are rendered based on the single precision PercentVacantHousingUnits field.   According to ArcMap, the value in this field for Loudon County (the county that's not displayed) is 8.741081.  The legend in the map shows the bottom cut off value for lowest class is 8.7411.  I'm not sure if that degree of rounding is just in the legend display or if it's the actual minimum value of the class.  I'm guessing the latter is the case since it's not displaying.  This same problem is occurring in my 'from scratch' JS map as well that's based on the sample above.

Is this a know issue?  Is there a work around?  Is the code in this post a 'patch' to this problem? 

This seems to be a bug.  If it is, has anybody submitted a ticket for it?  I imagine that many other people could be impacted by this problem - thematic mapping is a common use of web maps.

Thanks in advance for any insight.
0 Kudos
1 Solution

Accepted Solutions
AZendel
Occasional Contributor III
This problem seems to be caused by sending a float (aka single) field to the class breaks renderer.  I created a feature class with double fields and re-uploaded the feature service to AGO.  The problem was no longer occurring. 

Hopefully this post will prevent others from spending a considerable amount of time trying to debug their code.

View solution in original post

0 Kudos
4 Replies
derekswingley1
Frequent Contributor
How are you creating your breaks?
0 Kudos
AZendel
Occasional Contributor III
I'm creating my breaks in the exact same way as this demo that I based my code on: http://jsbin.com/ILAYUNeK.  I've also attached a complete version of my code as a txt file.

I haven't changed much other than styling the dropdown / legend, adding the Stamen 'toner' layer and substituting my own AGO polygon feature service.  Initially, I uploaded all of the counties in TN to my feature service in case we later wanted to show counties outside of our 8-county focus area.  I was using setDefinitionExpression on the layer and using the 'where' parameter on  GenerateRendererTask.execute.  I suspected that this definition query was causing some of the issues, so I deleted all but the eight focus counties in ArcMap and then created a new feature service with only the 8 counties.  Then I commented out all of the places where I had applied the definition query.  These commented lines are still in the attached code.  I still ran into the same problem: counties that are in the highest and lowest class breaks sometimes don't display.

Thanks for another quick response.  You've been very helpful.
0 Kudos
AZendel
Occasional Contributor III
This problem seems to be caused by sending a float (aka single) field to the class breaks renderer.  I created a feature class with double fields and re-uploaded the feature service to AGO.  The problem was no longer occurring. 

Hopefully this post will prevent others from spending a considerable amount of time trying to debug their code.
0 Kudos
KenBuja
MVP Esteemed Contributor
Alex,

I'm glad to hear you were able to find a solution. To help those who are looking for an answer to this question in the future, you should click the check in your post to mark it as having answered the question.
0 Kudos