|
POST
|
That's actually a script that I wrote a while ago that I'm trying to modify. I'm trying to alter the XY coordinates and create a point geometry from them. Ex: point = arcpy.Point(-88.24873, 34.232039)
ptGeometry = arcpy.PointGeometry(point)
arcpy.CopyFeatures_management(ptGeometry, "c:/temp/python/test.gdb/points") However, the output is empty. If I add two sets of points, it works:
pointList = [[-88.24873, 34.232039], [-77.99395, 34.232196]]
point = arcpy.Point()
pointGeometryList = []
for pt in pointList:
point.X = pt[0]
point.Y = pt[1]
pointGeometry = arcpy.PointGeometry(point)
pointGeometryList.append(pointGeometry)
arcpy.CopyFeatures_management(pointGeometryList, "c:/temp/python/test.gdb/points") I'm trying to figure out why I cannot create a PointGeometry with a single point.
... View more
09-19-2012
07:43 AM
|
0
|
0
|
2366
|
|
POST
|
Just double-click on the script in the catalog window and you will be presented with a dialog to specify your text file, output feature class, and template feature class. To upload a screen shot, click on the Image icon.
... View more
09-19-2012
06:41 AM
|
0
|
0
|
2291
|
|
POST
|
Hi Christi, Are you using ArcGIS 10 or 10.1? The difficult part would be creating the output dialog box that mimics the identify tool's dialog box. You could easily write the information to the python window, but I'm not sure if that would work for you.
... View more
09-19-2012
06:19 AM
|
0
|
0
|
2366
|
|
POST
|
I created the previous toolbox in 10.1. Try this one that was created in 10.0.[ATTACH=CONFIG]17798[/ATTACH]
... View more
09-19-2012
05:28 AM
|
0
|
0
|
2291
|
|
POST
|
Hi Mark, You can use the Flip Line tool to do this. This tool will also honor selected features.
... View more
09-14-2012
07:01 AM
|
0
|
0
|
691
|
|
POST
|
Hi Scott, Attached is a python script and toolbox. Instructions: 1. Unzip the zip file 2. Open ArcMap 3. In the catalog window go to where you unzipped the data 4. Expand the toolbox > right-click on the Script > Properties 5. Click on the Source tab > browse to the python script that was included with the zip file 6. Click OK 7. Double-click on the script 8. Specify an input text file, and an output feature class 9. You can optionally specify a template feature class
... View more
09-14-2012
02:41 AM
|
0
|
0
|
2291
|
|
POST
|
Your script has the path of your geodatabase as: C:\TEMP\WritingGeometries\BS_Test.gdb Your previous post states that your path is C:\TEMP\BS_Test.gdb. If this is so, you'll have to change the path in your script.
... View more
09-13-2012
11:04 AM
|
0
|
0
|
2291
|
|
POST
|
In ArcCatalog, right-click on 'Folder Connection's > Connect to Folder. Create a connection to your C:\temp directory. Do you see the geodatabase there?
... View more
09-13-2012
09:49 AM
|
0
|
0
|
2659
|
|
POST
|
Hi Lynn, When checking out a table, you will need to go into the advanced option of the 'Create Replica' wizard. By default, table's are checked out with the option 'Schema Only'. You will need to change this to 'All Records'. [ATTACH=CONFIG]17669[/ATTACH]
... View more
09-13-2012
07:55 AM
|
0
|
0
|
1546
|
|
POST
|
Check to make sure these feature classes exist by running the following: if arcpy.Exists(r"C:\TEMP\WritingGeometries\BS_Test.gdb\Polyline_fc"):
print 'true'
else:
print 'does not exist'
if arcpy.Exists(r"C:\TEMP\WritingGeometries\BS_Test.gdb\bsInFeatureClass"):
print 'true'
else:
print 'does not exist'
... View more
09-13-2012
07:39 AM
|
0
|
0
|
2659
|
|
POST
|
Hi Lynn, Does the crash occur when you attempt to create the join, or after the join and you attempt to run the 'Calculate Field' on the SDE table? I would first recommend trouble shooting this issue by copying the SDE table to a File Geodatabase (the relationship class and feature class will copy along with it). Then test to see if you can perform the join and calculate field. If this works, the problem may be with SDE. If it still fails, the problem may be with Access database.
... View more
09-13-2012
02:41 AM
|
0
|
0
|
1546
|
|
POST
|
You don't have to create a new geodatabase. You can use an existing feature class in an existing geodatabase. The output feature class created from this script will have the same schema as the feature class you specify for the 'template' variable.
... View more
09-12-2012
07:53 AM
|
0
|
0
|
2659
|
|
POST
|
Try setting the 'template' variable to an existing feature class. Ex: template = r"C:\temp\python\test.gdb\WaterMains"
... View more
09-12-2012
07:04 AM
|
0
|
0
|
2659
|
|
POST
|
Hi Thomas, What is the error you are receiving when you try to add the field to the IN_MEMORY dataset? I was able to get this to work with the following code: import arcpy
from arcpy import env
env.workspace = r"C:\temp\python\test.gdb"
fc = "Parcels"
arcpy.MakeFeatureLayer_management(fc, "IN_MEMORY\test")
arcpy.AddField_management("IN_MEMORY\test", "PIN", "DOUBLE")
lstFields = arcpy.ListFields("IN_MEMORY\test")
for field in lstFields:
print field.name
... View more
09-12-2012
03:44 AM
|
0
|
0
|
4234
|
|
POST
|
Problem #1: Yes, you can store your coordinates within a text file. Problem #2: Change 'infile = arcpy.GetParameterAsText(0)' and 'fcname = arcpy.GetParameterAsText(1)' to the paths of your text file and feature class. You will then be able to execute this code in IDLE. Ex: infile = r"C:\temp\python\Coordinates.txt"
fcname = r"C:\temp\python\Test.gdb\Polyline_fc"
... View more
09-12-2012
03:36 AM
|
0
|
0
|
2659
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|