Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've been hunting around ArcGIS 9.3 and having no success at finding a tool/function that can give me the median (not the mean/avg) tabular value of a spatial database. For example, if I have a data layer of mountain peaks, I would like to be able to determine the elevation of #35 of 70 mountain peaks that exist within a county.

Conceptually it should be pretty easy. Count the total records, sort by elevation ascending, get the value from the elevation field for record # (count/2). Would I need to script this out in Python, or am I missing something obvious that would allow me get this more quickly? I find it hard to believe no one else has had a need for this function and created a solution.

To add some complexity to the matter, what if I wanted the median elev value for peaks in every county within the state in a single table? Basically the same output format as Frequency or Summary Statistics tools when using the Case Field option.

UPDATE: Thank you for your suggestions! I was able to adapt the script linked by @VietThanh Le to meet my needs. I have posted the updated script and ArcToolbox at: http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=A0CD1751-1422-2418-882E-001EE0DC0D35

share|improve this question
    
would you consider updating your tool for use in 10.1? –  Pat Johnson Jul 2 '13 at 20:29
add comment

1 Answer 1

up vote 1 down vote accepted

I found a python script here in arcscripts, but haven't tried it. Hope it works for your need.

share|improve this answer
    
That's a great start, thanks. It doesn't quite have all the functions I am looking for (write to a standalone table, Case Field, etc) but the Python code to generate the median is what I really need, and should be able to code around that to make it fit my needs. I will repost the code and solution once I get it complete. –  RyanDalton Jan 21 '11 at 17:25
    
resources.arcgis.com/gallery/file/geoprocessing/… contains other def's for various other stats which you might find useful –  Dan Patterson Jan 21 '11 at 18:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.