POST
|
Yeah I think for me I solved this by moving the project and data to a different drive. I believe my shared network drive was experiencing some connectivity issues.
... View more
07-14-2016
11:28 AM
|
0
|
1
|
300
|
POST
|
Did you ever find your answer here? I am encountering the same thing? Thanks in advance, Noah
... View more
06-01-2015
07:11 AM
|
0
|
1
|
264
|
POST
|
I was wondering if someone can point me in the direction of the simplest method of creating a mobile routing application form a point feature layer in arcgis online map. Just wishing to use users current location from mobile device and route to selected point from published feature layer. Anyway there are alot of options and getting a bit overwhelmed. Suggestions are appreciated.
... View more
03-17-2015
01:14 PM
|
0
|
0
|
3480
|
POST
|
Thank you all!! You all seem very knowledgeable and have provided much useful info. Josh your query statement is precisely what I am looking for with this thread. Below is the complete code for this operation I am posting for the archives. # get unique list of values
values = [row[0] for row in arcpy.da.SearchCursor(fc, (field))]
query = "Value IN ({})".format(str(values).strip('[]'))
# Extract Features where Value is in values
attExtract = ExtractByAttributes(name, query)
attExtract.save("Extract_landuseRaster")
landuseRasterWeighted = "Extract_landuseRaster"
... View more
12-15-2014
07:57 AM
|
0
|
0
|
511
|
POST
|
Hi Dan. Thanks for chiming in. I am just trying to return a list of unique values. This revised portion of the script may have been less confusing. This one was also successful in printing the list in the desired format. How can I use this now in my sql expression? # Use SearchCursor with list comprehension to return a
# unique set of values in the specified field
#
values = [row[0] for row in arcpy.da.SearchCursor(fc, (field))]
uniqueValues = (values)
print(uniqueValues) Thank you for your help with this!
... View more
12-11-2014
01:20 PM
|
0
|
0
|
511
|
POST
|
I am getting an incorrect SQL statement while trying to extractby attributes where item is in list. Can somebody help me form the correct SQL statement? Line 30 below...
import arcpy
import os
arcpy.env.overwriteOutput = 1
# Check out any necessary licenses
arcpy.CheckOutExtension("Spatial")
base = r'C:\Users\Noah\Desktop\LCP Example\Scratch.gdb'
name = "landuse_Clip"
fc= os.path.join(base,name)
field = "Value"
arcpy.env.workspace = base
# Use SearchCursor with list comprehension to return a
# unique set of values in the specified field
#
for row in arcpy.da.SearchCursor(fc, "Value"):
values = [row[0]]
query = "Value" in values
# Extract Features where Value is in values
attExtract = ExtractByAttributes(name, query)
attExtract.save("Extract_landuseRaster")
landuseRasterWeighted = "Extract_landuseRaster"
... View more
12-11-2014
11:19 AM
|
0
|
6
|
2299
|
POST
|
Thanks for the response Tobias. I have rolled this over into a new discussion while trying a different approach maybe you can help? XSL Hide field name for image url
... View more
11-10-2014
09:00 AM
|
0
|
0
|
355
|
POST
|
I am attempting to configure html popup. I would like for field to display text 'WAFWA', but provide link to url. Similar to basic html structure:<a href="http://www.wafwa.org">WAFWA</a> Can this be done? Thanks in advance, Noah
... View more
11-07-2014
12:06 PM
|
1
|
3
|
4135
|
POST
|
I am receiving the error that variable row is not defined (second line of codeblock). I am attempting to check "constraints_Merge_fl" against code value in "lepc_clip_fl". What does the correct usage of this variable in the codeblock look like?
fc = "lepc_clip"
code = "CODE"
field = "OBJECTID"
# Make fl's for select tools
arcpy.MakeFeatureLayer_management(fc,fc + "_fl")
arcpy.MakeFeatureLayer_management("constraints_Merge","constraints_Merge_fl")
cursor = arcpy.SearchCursor(fc + "_fl")
row = cursor.next()
arcpy.AddField_management("constraints_Merge_fl","HEX_ID","Long")
chat_List = []
while row:
code_Value = row.getValue(code)
hex_ID = row.getValue("Hex_ID")
chat_List.append(hex_ID)
for feature in chat_List:
arcpy.SelectLayerByAttribute_management (fc + "_fl","NEW_SELECTION",'"Hex_ID" = {}' .format(feature))
arcpy.SelectLayerByLocation_management("constraints_Merge_fl",'intersect', fc + "_fl")
expression = "getClass(int(!CODE!))"
# Check syntax for row.getValue(code) in codeblock
codeblock = """def getClass(code):
if code < row.getValue(code):
return row.getValue(code)
else:
return code"""
arcpy.CalculateField_management("constraints_Merge_fl", "CODE", expression, "PYTHON_9.3", codeblock)
row = cursor.next()
Thanks in advance.
... View more
10-02-2014
10:29 AM
|
0
|
1
|
2453
|
POST
|
I am probably overlooking something, however I have not been able to find any way to round relative scale. Has anyone done this via interface or programmatically? Any suggestions? Sp. instead of 1inch -= 59 feet. Display 1 in = 60 feet. Thanks in advance, Noah
... View more
08-14-2014
03:03 PM
|
0
|
1
|
914
|
POST
|
Thanks all for the input! Duncan your reply provided exactly what was needed. Here is what worked for me... whereClause = """"{}" = '{}'""".format(field, filename) cursor = arcpy.UpdateCursor(fc, whereClause) Thanks again, Noah
... View more
08-08-2014
12:40 PM
|
0
|
0
|
401
|
POST
|
Thanks for the reply Duncan. Could you provide an example of this?
... View more
08-08-2014
09:09 AM
|
0
|
1
|
401
|
POST
|
I am attempting to search directories and sub directories for file in 'name' and return full file path of found file in a new field. When I print the value of variable 'string' it prints the desired results However after the script runs the field is populated with a single value instead of unique values for each subsequent row. Can anyone tell me why this is?
# Set local variable
source = 'R:\\'
fc = "I14__ATTACH_TEST"
field = "ATT_NAME"
addfieldName = "fullPath"
fieldLength = 200
# Add field
arcpy.AddField_management(fc, addfieldName, "TEXT", "", "", fieldLength)
### Attempting to search directories and sub directories for file in 'name'
### and return full file path of found file (name)
sc = arcpy.SearchCursor(fc)
names = []
for scrow in sc:
names.append(scrow.getValue(field))
for root, dirnames, filenames in os.walk(source):
for filename in filenames:
if filename in names:
string = os.path.join(root, filename)
cursor = arcpy.UpdateCursor(fc)
row = cursor.next()
while row:
# field2 will be equal to field1 multiplied by 3.0
row.setValue(addfieldName, string)
cursor.updateRow(row)
row = cursor.next()
... View more
08-08-2014
07:39 AM
|
0
|
4
|
1054
|
POST
|
Thanks Don! Was still getting familiar with new design. Better now!
... View more
07-29-2014
02:57 PM
|
0
|
0
|
204
|
POST
|
This was completely my fault these were all great responses and correct answers for what I have provided here! It turns out I was confusing the script name for script label. Thus... pythonaddins.GPToolDialog(toolPath,"GetIRCount") instead of... pythonaddins.GPToolDialog(toolPath,"Get IR Count") Which is what is displayed in arc catalog. Thank you both for your time and valuable input!!
... View more
07-29-2014
02:22 PM
|
0
|
0
|
951
|
Title | Kudos | Posted |
---|---|---|
1 | 11-05-2012 06:00 AM | |
1 | 11-07-2014 12:06 PM | |
1 | 07-02-2014 11:59 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|