Creating a point shapefile from a percentage?

625
8
01-11-2014 04:42 AM
DavidPrado
New Contributor
I have been trying to find a tool or script that will allow me to create a new point shapefile from an existing point shape file.  I need to select the first 1% of rows from my shapefile.  I can't use a set number of rows because the total count for each shapefile changes with each file.  Is there any tool or script that exits to do this?  I have been doing it manually but I have over 1000 files to work with and it has been taking me weeks each time I try to do this process.
0 Kudos
8 Replies
TimWitt
Frequent Contributor
David,

I think the first issue you will have is, do you need to sort your attributes before you want to select the first 1%?

Tim
0 Kudos
DavidPrado
New Contributor
Yes sir,

I have them sorted as one of the processing steps.  I am looking to extract the lowest 1% of values within my current point shapefile.  I have been looking through tools for the last few weeks but I have been unable to find a tool that seems to be able to do it.  I have over 1000 shapefiles that I need to extract and the none of them have the same count so it would have to be done manually.

Thank you for any help you can provide,
David
0 Kudos
TimWitt
Frequent Contributor
To better understand it, what is the reason to select 1% of your data? What would be your criteria to sort your tables?
0 Kudos
DavidPrado
New Contributor
The three fields are Lat, Long, and Elevation.  I am sorting by the elevation fields.
0 Kudos
TimWitt
Frequent Contributor
This sounds like something that needs to be done in python.

First you would have to run the Get Count tool. This would give you the total count of rows.

The next step is divide the result by 100 to get your 1%.

After that use the Sort tool, to sort your attribute table.


This is where I am stuck at the moment. How to select a certain amount of rows (which we have the number for) and then export it.
0 Kudos
DavidPrado
New Contributor
That's where I am stuck at.  I have the counts for each file and they are sorted ascending, but I have been unable to extract by a count.  I might have to start looking into other programs that will handle shapefiles but can potentially do the extract.
0 Kudos
TimWitt
Frequent Contributor
Maybe this can help you?
0 Kudos
DavidPrado
New Contributor
I'll try to extract the last value and then clip everything smaller.  Thank you
0 Kudos