|
POST
|
Invaluable advice I will look into this more. Thanks.
... View more
10-16-2017
07:19 AM
|
0
|
0
|
11014
|
|
POST
|
Thanks Interesting, this is the most I have used cursors. I get the desired result now, including the comma for some reason with arcpy.da.SearchCursor("escroads",'RecID') as cursor: for row in cursor: print max(cursor) (8182,)
... View more
10-13-2017
02:11 PM
|
0
|
5
|
11014
|
|
POST
|
Why do I get a print out of all the records values as opposed to just the highest which should be 8182 ? with arcpy.da.SearchCursor("escroads",'RecID') as cursor:
for row in cursor:
print str(max(row))
... View more
10-13-2017
01:42 PM
|
0
|
8
|
14692
|
|
POST
|
This worked perfect. I only need to modify to only update features that have a RecID = 0 I used this and added code to generate a zipfile.
... View more
10-12-2017
03:12 PM
|
0
|
2
|
4494
|
|
POST
|
Thank you, I will try this out. My unique will be roadsegid
... View more
10-11-2017
12:57 PM
|
0
|
0
|
4494
|
|
POST
|
Thank you for the suggestions. I will look into the Data Access module as an alternative to old cursors. Good advice on Calculate field tool and a join. I will see what works for me. As I am trying to copy attributes from one field of a feature class to another feature class. However, I need to match the feature classes fields that have different field names. All of this done via a python script.
... View more
10-11-2017
07:11 AM
|
0
|
0
|
4494
|
|
POST
|
I want to know what is the best way via arcpy to update a feature field by referencing another features field. I don't know if it is possible to use a updatecursor for 2 different features. Would I just perform a temporary join and use arcpy like field calculator. My Example of my cursor attempt. searchcursor = arcpy.SearchCursor("BASE.ROADS_SG_ESC","","","","")
updatecursor = arcpy.UpdateCursor("escroads","","","","")
for row in searchcursor:
RD20NAME = row.getValue("RD20NAME")
for row in updatecursor:
if row.getValue("NAME")
NAME = RD20NAME
updatecursor.updateRow(row)
... View more
10-10-2017
03:54 PM
|
0
|
9
|
5422
|
|
POST
|
I tried the different \\ regarding escape characters and I don't get any different results. I am looking up layer.dataSource which is the actual feature class name.
... View more
10-02-2017
02:54 PM
|
0
|
0
|
2329
|
|
POST
|
Thanks for this advice. I haven't used the in very much, I did and it works. I now see that the if x in str((ly.split ('\\')[2:])): is causing the issue. It is indexed correctly, but something is not right in the loop input syntax.
... View more
09-29-2017
11:30 AM
|
0
|
0
|
2329
|
|
POST
|
I use the following print statement and get the correct results as seen below (the feature class name) print "Feature Classes Name:" + str((ly.split ('\\')[2:])) I have it indexed correctly and results are correct but I have an issue when using the user input. Feature Classes Name:['BACK.Address_Points']
... View more
09-29-2017
10:36 AM
|
0
|
2
|
2329
|
|
POST
|
It runs with a type in feature name: prompt that repeats every time I type something and yield no results. I am running it in Jupyter Notebook
... View more
09-25-2017
12:50 PM
|
0
|
0
|
2329
|
|
POST
|
I am having an issue with raw_input as a variable x. The user types the name and receives returned values. x is in the ly variable is not working.( Line 20) I know that I need to set this up slightly different but not sure how. (Line 22,23) I can set the variable x as a hardcoded name and I get the correct results which confirms everything else is correct. (Line 21) import arcpy
import os
#Set folder space
folder = r'S:\\GIS\ServerMXDs\\_Future_Services\\CityWorks'
for filename in os.listdir(folder):
fullpath = os.path.join(folder, filename)
if os.path.isfile(fullpath):
basename, extension = os.path.splitext(fullpath)
if extension.lower() == ".mxd":
mxd = arcpy.mapping.MapDocument(fullpath)
dfs = arcpy.mapping.ListDataFrames(mxd)
for df in dfs:
layers = arcpy.mapping.ListLayers(mxd, "", df)
for layer in layers:
if layer.isFeatureLayer:
lyr_source = layer.dataSource
lyr_name = layer.name.encode("utf8", "replace")
ly = lyr_source.encode("utf8", "replace")-
#x = raw_input("type in feature name: ")
x = 'ServiceEstablishments'
if x in str((ly.split ('\\')[2:])):
print filename + " " + "Service Name:" + " " + df.name + " " + "Layer Name:" + " " + lyr_name
... View more
09-25-2017
07:34 AM
|
0
|
9
|
2574
|
|
POST
|
Thanks, it works perfect now. I don't know why I missed that. Now to try and figure out a way to save this as standalone tool.
... View more
08-23-2017
09:16 AM
|
0
|
0
|
4829
|
|
POST
|
n = [1, 7, 14, 16,19]
x = raw_input()
if x in n:
print "match"
else:
print "no match" How can I get this to work correctly ?
... View more
08-23-2017
08:58 AM
|
0
|
2
|
5058
|
|
POST
|
I am trying to save and open the MXDs from the following website. However, they were created with a newer version of ArcMap. IncidentStatus.mxd LogisticsPlanning.mxd http://arcgis4em.maps.arcgis.com/apps/MapAndAppGallery/index.html?appid=c09df18e1da44efcb27af0803ec73349 I have Version Arcmap 10.2.1, can you help me get a version of the mxds to match my ArcMap.
... View more
07-18-2017
04:01 PM
|
0
|
0
|
593
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-03-2016 06:52 AM | |
| 1 | 05-10-2016 10:27 AM | |
| 1 | 02-06-2017 01:22 PM | |
| 1 | 05-01-2018 07:23 AM | |
| 1 | 03-03-2017 02:46 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|