|
POST
|
Can you please re-post your code so it is formatted properly within the tags. It's hard to read the way you posted it.
... View more
12-20-2013
02:01 AM
|
0
|
0
|
862
|
|
POST
|
ArcGIS Server uses 64-bit python, not 32-bit, therefore, you need to install the 64-bit version of win32 on the server machine. To run the tool local, not published, you need to have the 32-bit version of the module. It's ok to install both the 32-bit and 64-bit versions of the same module on the same machine if you have both desktop and server installed because you have two seperate installation of python 2.7.x installed on that machine. Let me know if installing the 64-bit version fixes your issue.
... View more
12-18-2013
12:58 AM
|
0
|
0
|
3063
|
|
POST
|
Did you install the pywin32 x64-bit version on the ArcGIS Server box?
... View more
12-17-2013
09:11 AM
|
0
|
0
|
3063
|
|
POST
|
Check out the following GP tool: http://resources.arcgis.com/en/help/main/10.1/index.html#/Calculate_Adjacent_Fields/007000000009000000/ This might help you. Andrew
... View more
04-12-2013
05:38 AM
|
0
|
0
|
451
|
|
POST
|
Are you using 10.1 or 10.0? If it's 10.0, then you can find all the cursor information here: http://help.arcgis.com/en/arcgisdesktop/10.0/help/ Just search for the information I showed before. The concepts are the same, except the 10.0 cursor objects are slower. You want to use these two functions at 10.0:
arcpy.SerachCursor()
arcpy.UpdateCursor()
... View more
02-04-2013
02:43 AM
|
0
|
0
|
1264
|
|
POST
|
You can also use the arcpy.Raster object to get all the properties a tad faster. Check out: http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000051000000
... View more
02-01-2013
05:23 AM
|
0
|
0
|
1351
|
|
POST
|
Python scripting can be tough at first, just like and language, but these links should help you: For Search Cursors, please see: http://resources.arcgis.com/en/help/main/10.1/index.html#/SearchCursor/018w00000011000000/ For Update Cursors, please see: http://resources.arcgis.com/en/help/main/10.1/index.html#/UpdateCursor/018w00000014000000/ If the datasets live in the same workspace, you might need to start an edit session: http://resources.arcgis.com/en/help/main/10.1/index.html#/Editor/018w00000005000000/ For general python: Look at the quick links section of this page: http://resources.arcgis.com/en/communities/python/
... View more
02-01-2013
02:27 AM
|
0
|
0
|
1264
|
|
POST
|
Try using the python csv library and do something like this:
def get_rows(data_set, fields):
with da.SearchCursor(data_set, fields) as cursor:
for row in cursor:
yield row
if __name__ == "__main__":
data_set = arcpy.GetParameterAsText(0) # feature class/Table
output = arcpy.GetParameterAsText(1) # csv file
desc = arcpy.Describe(data_set)
fieldnames = [f.name for f in desc.fields if f.type not in ["Geometry", "Raster", "Blob"]]
rows = get_rows(data_set, fieldnames)
with open(output,'wb') as out_file:
out_writer = csv.writer(out_file)
out_writer.writerow(fieldnames)
for row in rows:
out_writer.writerow(row)
Hope this gets you in the right direction.
... View more
01-31-2013
07:45 AM
|
0
|
0
|
2576
|
|
POST
|
You can do this many different ways, but the easiest is probably to just do a spatial join. Check out: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000000q000000 You can also use a search and update cursor to add the information into the field. Workflow: 1. Create a search cursor on the point data 2. Grab the Geometry of the Point and use that geometry to select by location on the polygon 3. Using and update cursor, update the polygon with the ID value. Andrew
... View more
01-31-2013
07:38 AM
|
0
|
0
|
1264
|
|
POST
|
If you have a search radius, you can try extracting your points first to a temporary feature class by using the clip method, then running the near tool. You might see a performance gain if you move away from shape files and use a file geodatabase featureclass. Also, try calculating spatial indexes on your point feature class.
... View more
01-30-2013
02:21 AM
|
0
|
0
|
1271
|
|
POST
|
For a python script, %Scratchworkspace% = arcpy.env.scratchWorkspace
... View more
01-30-2013
02:16 AM
|
0
|
0
|
1165
|
|
POST
|
Think of %ScratchWorkspace% is just a reference to the scratch workspace environmental variable in ArcGIS Desktop. To see where the data is being stored, just click on 1. Geoprocessing Menu Bar Item 2. Select Environments... 3. Expand 'Workspace' You can set or view the location of the scratch workspace. To use the output in another model, as long as the output model is a parameter (the little P is next to the bubble), then the next model should see this as an output and use it.
... View more
01-29-2013
08:10 AM
|
0
|
0
|
1165
|
|
POST
|
I assume you are referring to the Data frame, to get a complete listing of all the methods and properties, please read: http://resources.arcgis.com/en/help/main/10.1/index.html#/DataFrame/00s300000003000000/
... View more
01-28-2013
03:16 AM
|
0
|
0
|
814
|
|
POST
|
I don't know what you mean by items in a field. If you have a cursor you can do something like:
with da.SearchCursor(<data>, [fields]) as cursor:
for row in cursor:
fieldValue = row[cursor.fields.index("fieldname")]
startWord = row[cursor.fields.index("startWordField")]
stopWord = row[cursor.fields.index("stopWordField")]
stop = fieldValue.find(stopWord)
start = fieldValue.find(startWord)
print fieldValue[start:stop]
I didn't test the code, but that's how you can break a string up by a start and stop position. For help with working with python standard types, please see: http://docs.python.org/2/library/stdtypes.html Thank you
... View more
01-24-2013
05:53 AM
|
0
|
0
|
1193
|
|
POST
|
You can try this as well:
text = "HITCH ENTERPRISES, INC. WARRANTY DEED BOOK 552, PAGE 532 (NW/4) (NE/4) (SE/4) OUT OF SECTION 29 TOWNSHIP 1N RANGE 16E TEXAS COUNTY, OKLAHOMA"
loc = text.find("OUT OF") #"OUT" works the same
print text[:loc]
... View more
01-24-2013
05:41 AM
|
0
|
0
|
1193
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2017 05:56 AM | |
| 1 | 03-28-2018 03:28 AM | |
| 1 | 07-24-2017 05:39 AM | |
| 1 | 06-01-2016 03:48 AM | |
| 1 | 01-27-2016 02:53 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|