Select to view content in your preferred language

Point Shapefile to Multiple Points

921
3
01-23-2011 01:33 AM
RiccardoKlinger1
Deactivated User
Hello Everyone,

for multiple viewshed calculation i need my point shapefile divided into several shapefiles (each point should be one shapefile)

I was trying to use this ressource : http://arcscripts.esri.com/details.asp?dbid=14127
but this is not working maybe due to at least 100.000 points...

then i was trying : http://www.umesc.usgs.gov/management/dss/split_by_attribute_tool.html

which takes nearly an hour for 1000 point shape files to create...

any other suggestions?

I'm using WIN 7, arcgis 9.3
Tags (2)
0 Kudos
3 Replies
LornaMurison
Regular Contributor
I see this was posted over a month ago, but here is what I would do:
Add a new field (number)and populate with an incremental number 1,2,3, etc... using:
Static rec As Long 
Dim pStart As Long 
Dim pInterval As Long 
 
' adjust start value if you want it to
' start at a value other than 1. 
' For example, 1000. 
' ====================================

pStart = 1 

' adjust interval value if you want it to
' increment at a value other than 1. 
' For example, 2. 
' =======================================

pInterval = 1 
 
If (rec = 0) Then 
rec = pStart 
Else 
rec = rec + pInterval 
End If
__esri_field_calculator_splitter__
rec


Then run this script in python:
 #import modules
import arcgisscripting

# Create geoprocessor object
gp = arcgisscripting.create (9.3)
gp.overwriteoutput = True
gp.Workspace = r"C:\...location of points and output points"

# Access parameters
Points = name of points feature class

#where n is the total number of points in the feature class +1
#where number is the name of the field you added above
for i in range(1,n,1):
    gp.Select_analysis (Points, "Output" + str(i), '"number" = ' + str(i))
0 Kudos
RiccardoKlinger1
Deactivated User
thank you very much for this version!!! it is still very time consuming (takes about 5sec per point... i have about 1000000 points 😉

best regards, riccardo
0 Kudos
RiccardoKlinger1
Deactivated User
For all the guys using python instead of the gp:

1442401 is the nmber of points, and POINTID is the pointidentifier!

pfad="C:\\Users\\Riccardo Klinger\\Documents\\WD_Vis\\points\\points_all\\"
for i in range(1,1442401,1):
    clause= "POINTID = " + str(i)
    arcpy.SelectLayerByAttribute_management("points_dem","NEW_SELECTION",clause)
    arcpy.CopyFeatures_management("points_dem",pfad+"output"+str(i)+".shp")


I see this was posted over a month ago, but here is what I would do:
Add a new field (number)and populate with an incremental number 1,2,3, etc... using:
Static rec As Long 
Dim pStart As Long 
Dim pInterval As Long 
 
' adjust start value if you want it to
' start at a value other than 1. 
' For example, 1000. 
' ====================================

pStart = 1 

' adjust interval value if you want it to
' increment at a value other than 1. 
' For example, 2. 
' =======================================

pInterval = 1 
 
If (rec = 0) Then 
rec = pStart 
Else 
rec = rec + pInterval 
End If
__esri_field_calculator_splitter__
rec


Then run this script in python:
 #import modules
import arcgisscripting

# Create geoprocessor object
gp = arcgisscripting.create (9.3)
gp.overwriteoutput = True
gp.Workspace = r"C:\...location of points and output points"

# Access parameters
Points = name of points feature class

#where n is the total number of points in the feature class +1
#where number is the name of the field you added above
for i in range(1,n,1):
    gp.Select_analysis (Points, "Output" + str(i), '"number" = ' + str(i))
0 Kudos