Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extractBounds method gives erroneous output #3

Closed
imranazad opened this issue May 5, 2012 · 11 comments
Closed

extractBounds method gives erroneous output #3

imranazad opened this issue May 5, 2012 · 11 comments

Comments

@imranazad
Copy link

Consider the following data set [2,16,20,23,10,29], calling getJenks(5) returns [2,10,16,20,29,29]. Notice the duplicate 29, is this the correct behavior? Also what is the purpose of the extractBounds method?

@simogeo
Copy link
Owner

simogeo commented May 6, 2012

The duplicate entry is not that strange on a such small serie.
By the way, I haven't coded myself the jenks algorithm. The work has been done by a group of students of Toulouse University (France). I just integrated it (as it is) to my class.

the extractBounds() method returns array of bounds values.
I did a jenks classification on the serie [2,16,20,23,10,29] with QGIS. It returns classes 2-2, 2-2, 2-16, 16-23, 23-29.

I don't think the jenks method used in geostats is incorrect but I'll inquire.
Each algorithm has its own specificity (it's true for mapinfo, esri and qgis world).

Thanks for submitting your remark

@imranazad
Copy link
Author

Hi Simon,

Many thanks for all the info. That's interesting I didn't know that each algorithm has it's own specificity which explains why the ranges weren't matching the values of another implementation I have. :-)

On another note the following data set:

[8,9,9,8,9,9,8,8,8,25,12,8,12,8,8,8,9,8,8,11,8,8,8,8,8,8,9,9,8,8,8,8,8,9,8,8,9,8,8,8,8,8,8,9,8,9,12,8,9,8,8,11,10,8,12,9,12,8,8,
8,11,9,9,9,8,8,12,8,8,8,12,8,11,10,9,8,8,8,9,8,11,8,11,8,8,10,8,9,8,8,8,8,8,8,10,10,8,9,8,9,8,8,8,8,8,8,8,8,8,9,8,8,8,8,8,8,8
,8,8,8]

returns these ranges:

[8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 8,8 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 9,9 - 10,10 - 10,10 - 10,10 - 10,10 - 10,10 - 11,11 - 11,11 - 11,11 - 11,11 - 11,11 - 11,11 - 12,12 - 12,12 - 12,12 - 12,12 - 12,12 - 12,12 - 12,12 - 25]

The alternative web based implementation I have returns the following ranges which seem to be more sensible:

[8,9,10 - 11,12,13 - 25]

On the whole geostats is great, thank you so much for all the hard work.

@simogeo
Copy link
Owner

simogeo commented May 7, 2012

Do you have an online implementation of that?

(By the way, the jenks algorithm was also used by the mapfish framework geo-statistics extension)

@imranazad
Copy link
Author

The implementation I have is used in an online service for retrieving the University of Kentucky's engagement activities. To get to the Choropleth map click on "Engagement Map", to see the ranges in my previous comment select the year "2010" and the college "Student Affairs".

Thanks, I've just been browsing mapfish's website and reading through it, it looks really interesting!

@simogeo
Copy link
Owner

simogeo commented May 7, 2012

I see. it seems Daniel J Lewis work (in python) is a very good one.
Have you done the Jenks algorithm transcription from python to javascript yourself? If not, do you know the JS version author? I'd like to know about the license and maybe integrate it to the geostats library after some tests and comparisons with the current one.

@imranazad
Copy link
Author

I've not had a chance to rewrite Daniel's Python implementation to JavaScript myself, however the author of the application has :-) I have been in communication with him and do have his contact details. I can provide you his email address, is there a discrete way of doing this here?

He has published the source code for the application online, there's also some information regarding its usage - he is happy for the code to be reused but the map service, data, and the ArcGIS Server services used in the application are copyright.

@imranazad
Copy link
Author

Sorry Simon, I forgot to include the link to the source code in my previous comment. I've updated my comment with the link.

@simogeo
Copy link
Owner

simogeo commented May 7, 2012

Thanks for the link.
Regarding the email, you can send private message through github.

@imranazad
Copy link
Author

Simon, I've looked everywhere on github and I'm unable to find the private messaging facility. Could you please point me in the right direction :-)

Thanks

@simogeo
Copy link
Owner

simogeo commented May 7, 2012

indeed, it was possible before. I'm not sure it is anymore ....

@simogeo
Copy link
Owner

simogeo commented Feb 2, 2013

imranazad,

indeed, the Jenks algorithm implementation was buggy. I integrated the Doug Curl implementation you mentioned. Thanks to him the Jenks classification should now work properly.

@simogeo simogeo closed this as completed Feb 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants