Batch Field Extraction from a Point Feature Class:

2932
5
Jump to solution
08-20-2014 04:42 AM
MarkEnglish
New Contributor II

Hello:  I have a point dataset which has 20+ fields indicating different storm surge elevations.  For instance, one field indicates storm 1, and contains 200 water surface elevation records.  The second field indicates storm 2, with also 200 water surface records, and so on.  The returns for each storm are present on the same record/point, just different values.  I want to generate 20+ point feature classes, one for each storm by extracting each field into its own dataset.  Following this process, I'd like to run a batch process for each storm point file that generates a raster for each storm scenario.  I know how to do this manually, but it would take a lot of time considering the number of steps involved.  Any help would be greatly appreciated.

Thank you!

-Mark

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

You can specify the cell size (i.e. 10 Meters) by updating the 3rd parameter in the Idw function.  Ex:

outIDW = Idw("pt", field.name, "10", "2", "VARIABLE 12")

You can see a description of each parameter from the below link:

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

View solution in original post

5 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Mark,

You wouldn't have to create a separate feature class for each field.  You could iterate through each field and create a raster using the IDW tool.  Below is an example that iterates through a point feature class called 'pt' and creates a File Geodatabase Raster Dataset using the IDW tool.

import arcpy

arcpy.CheckOutExtension("spatial")

from arcpy import env

from arcpy.sa import *

env.workspace = r"C:\temp\python\test.gdb"

fc = "pt"

for field in arcpy.ListFields(fc):

    if field.name not in ('OBJECTID', "SHAPE"):

        outIDW = Idw("pt", field.name, "2", "2", "VARIABLE 12")

        outIDW.save("pt_" + field.name)

JakeSkinner
Esri Esteemed Contributor

You can specify the cell size (i.e. 10 Meters) by updating the 3rd parameter in the Idw function.  Ex:

outIDW = Idw("pt", field.name, "10", "2", "VARIABLE 12")

You can see a description of each parameter from the below link:

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

MarkEnglish
New Contributor II

Thanks Jake!

It worked, although I am unearthing additional issues within the data.  For instance, 'no data' is represented as -999.  Is there a method to convert all -999 in the point storm surge dataset to NULL?

M-

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Yes, you can use the Set Null tool to do this.

0 Kudos
MarkEnglish
New Contributor II

Yes, but that would have to be performed on all of the raster outputs.  Is there a way to locate all -999 records within a single point dataset and change them to NULL?  Or batch each field at a time?

0 Kudos