|
POST
|
@Dan Patterson Sorry, this code came from the book I am working on from Eric Pimpler's ebook "Programming ArcGIS 10.1 with Python cookbook. That book was in 2013 Yes I find a lot of errors in that book however I tried to tweak some of the codes but was not able to figure it out and I thought there must be a way around to correct it..
... View more
03-08-2015
09:12 PM
|
0
|
1
|
2318
|
|
POST
|
You should be able to use this method... might want to look at here Image Management Workflows | ArcGIS Resource Center Honestly, it is an awkward workflow but I had to work on it for many hours until I understand how it works... Like I said I did work on NAIP for New Mexico and i was able to get it right..it took me to figure it out about three days... I have asked others here on the GeoNet and only few people repsond me back... Do you have background in Erdas or Envi ?
... View more
03-08-2015
09:08 PM
|
0
|
3
|
1924
|
|
POST
|
Before I ask you further, how many aerial images and what will you be using them for ?
... View more
03-08-2015
08:58 PM
|
0
|
5
|
1924
|
|
POST
|
import arcpy, sys
workspace = sys.argv[1]
featureclass = sys.argv[2]
try:
arcpy.env.workspace = workspace
fields = arcpy.ListFields(featureclass)
for fld in fields:
print fld
except:
print arcpy.GetMessages()
The error I am getting is : >>> Traceback (most recent call last): File "C:\ArcpyBook\Appendix1\ListFields.py", line 3, in <module> workspace = sys.argv[1] IndexError: list index out of range >>>
... View more
03-08-2015
03:15 PM
|
0
|
5
|
6001
|
|
POST
|
Hi friend, Have you consider using Mosaic Dataset ? I'd start working with two first and then add two more to give you an idea. More information can be found here :ArcGIS Help 10.1 I just worked on this with NAIP I am working on for the whole state of New Mexico 2009, 2011,2012, and 2014.
... View more
03-07-2015
08:41 AM
|
0
|
7
|
1924
|
|
POST
|
Thanks. It is still not working though I do believe the Delete management had to do with it. What I did was drag around a boundary and nothing comes out..so I modifty to see what happens and this only works... so I put number sign next to 04 and 05 . See here: def onRectangle(self, rectangle_geometry):
extent = rectangle_geometry
arcpy.env.workspace = r"c:\ArcpyBook\Ch11"
#if arcpy.Exists('randompts.shp'):
#arcpy.Delete_management('randompts.shp')
randompts = arcpy.CreateRandomPoints_management(arcpy.env.workspace,'randompts.shp',"",rectangle_geometry)
arcpy.RefreshActiveView()
#return randompts
pass This was from the book I have on page 231 from Programming ArcGIS 10.1 with Python cookbook. I know probably it has change since then. The book was published in 2013.
... View more
03-01-2015
08:55 AM
|
0
|
2
|
2022
|
|
POST
|
You mean I just deleted was because of the same name ? I am still struggled with it and trying to do many different method even I looked at the CreateRandomPoints help on arcgis 10.1.
... View more
02-28-2015
08:35 PM
|
0
|
0
|
2022
|
|
POST
|
import arcpy
import pythonaddins
class ToolClassRandom(object):
"""Implementation for GenerateRandomPoints_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = 'Rectangle' # Can set to "Line", "Circle" or "Rectangle" for interactive shape drawing and to activate the onLine/Polygon/Circle event sinks.
def onMouseDown(self, x, y, button, shift):
pass
def onMouseDownMap(self, x, y, button, shift):
pass
def onMouseUp(self, x, y, button, shift):
pass
def onMouseUpMap(self, x, y, button, shift):
pass
def onMouseMove(self, x, y, button, shift):
pass
def onMouseMoveMap(self, x, y, button, shift):
pass
def onDblClick(self):
pass
def onKeyDown(self, keycode, shift):
pass
def onKeyUp(self, keycode, shift):
pass
def deactivate(self):
pass
def onCircle(self, circle_geometry):
pass
def onLine(self, line_geometry):
pass
def onRectangle(self, rectangle_geometry):
extent = rectangle_geometry
arcpy.env.workspace = "c:\ArcpyBook\Ch11"
if arcpy.Exists("randompts.shp"):
arcpy.Delete_management("randompts.shp")
randompts = arcpy.CreateRandomPoints_management(arcpy.env.workspace,"randompts","randompts.shp","POINT",rectangle_geometry)
arcpy.RefreshActiveView()
return randompts Been trying to run this code to create an addin for the Generate Random Points. It gave me the error that says: Traceback (most recent call last): File "C:\Users\Pollock\AppData\Local\ESRI\Desktop10.1\AssemblyCache\{A6309427-3034-2E61-07C7-2A592C101F22}\GenerateRandomPoints_addin.py", line 41, in onRectangle return randompts UnboundLocalError: local variable 'randompts' referenced before assignment
... View more
02-28-2015
03:38 PM
|
0
|
6
|
5666
|
|
POST
|
So when I write this code df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] print df.extent In return the numbers showed me 238135.744094489 3606562.79790026 494041.255905512 3787829.20209974 NaN NaN NaN NaN What does NaN NaN NaN NaN mean ? Is it laughing at me ?? No, I know ! what does it mean, BTW ! Thanks
... View more
02-27-2015
11:17 AM
|
0
|
3
|
4696
|
|
POST
|
When you add the python add in wizard, should it be saved under \USERS|your name|\Desktop\folder name ? Can I save it anywhere in C hard drive ? Thanks
... View more
02-27-2015
07:48 AM
|
0
|
1
|
1598
|
|
POST
|
My question IS how can we know if Pyscripter and ArcMap can communicate to each other BUT what if I want just run like a debug first before the actully work in ArcMap ? For example, you write the code and test it and shows it work and then you can run it either in Python Window or Pyscripter to get the results done ?
... View more
02-26-2015
01:07 PM
|
0
|
0
|
2605
|
|
POST
|
The imagery are set to NAD 1983 UTM Zone 13 N and the code I wrote are done in Pyscripter
... View more
02-26-2015
09:19 AM
|
0
|
1
|
2125
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-08-2026 10:11 AM | |
| 1 | 09-01-2022 03:43 PM | |
| 1 | 09-28-2020 09:34 AM | |
| 2 | 09-24-2025 09:48 AM | |
| 1 | 09-22-2025 08:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|