|
POST
|
I am testing it out by taking your suggestion of adding a new length field and using the following expression. It is not working as I think I have to specify when it is a non text field. Is that correct ? def FindLabel ( [LENGTH] , [PLAN] ):
if Double ( [LENGTH] ) > 50:
return [PLAN]
else:
return [PLAN]
... View more
11-14-2016
04:06 PM
|
0
|
1
|
2872
|
|
POST
|
Thanks, I will look into this. At a first look I don't see how all this can be included in a label expression. my goal is not needing to edit the actual data at all.
... View more
11-14-2016
11:58 AM
|
0
|
6
|
2872
|
|
POST
|
Great feedback, thanks. With your help I was able to use the following python label expression in my mapbook. For any water pipeline attributed with, "abandon", do not label. Also, if any pipeline is null then label as seen below. def FindLabel ([PLAN], [AGENCY]):
if [AGENCY] == "ABANDON":
return None
elif [PLAN] in (None, " "):
return "Plan ?"
else:
return [PLAN] I need to also only show pipeline labels for pipe greater than 50 feet. I tested out the following and it doesn't work. I would then need to add it to my current expression. Any ideas what is wrong with my expression. Thanks def FindLabel ( [SHAPE.LEN], [PLAN] ):
if [SHAPE.LEN] > 50:
return [PLAN]
else:
return [PLAN]
... View more
11-07-2016
04:07 PM
|
0
|
0
|
3847
|
|
POST
|
I agree that in general, nulls, empty, NA and spaces always present issues which I don't remember how to address right away. Technically, my empty fields do not have spaces since I never typed anything in, I would assume? So, you bring up a good point, what exactly are the empty fields represented by ?
... View more
11-03-2016
08:16 AM
|
0
|
6
|
3847
|
|
POST
|
def FindLabel ( [PLAN] ):
if [PLAN] in (None, " "):
return "Unknown Plan"
else:
return [PLAN] This work perfect, thank you. Good to know that an empty string treated the same for label expressions and the field calculator. Null is not though, having to use None to represent Null in label expressions.
... View more
11-03-2016
06:52 AM
|
1
|
1
|
6392
|
|
POST
|
Good point, I have empty strings, how would I represent empty strings, not Null ?
... View more
11-02-2016
04:13 PM
|
0
|
3
|
6392
|
|
POST
|
I made Dan's suggested changes and still no luck. I should of elaborated what string PLAN field is. The blank fields are Null.
... View more
11-02-2016
03:52 PM
|
0
|
5
|
6392
|
|
POST
|
I am having difficulty with python parser label function to replace null values with "Unknown Plan" and leave everything else as is. The Unknown Plan is not displaying in the map label. I have the following: def FindLabel ( [PLAN] ):
if ([PLAN]) is None:
return "Unknown Plan"
else:
return [PLAN] Any idea it is not working ?
... View more
11-02-2016
03:26 PM
|
0
|
30
|
17382
|
|
POST
|
I get the dispersed points but need to keep on main line as seen with blue circle features.
... View more
08-25-2016
04:03 PM
|
0
|
0
|
1204
|
|
POST
|
b = fullpath.split('\\') c = ("{}\n" * len(b)).format(*b) for i in b: writer.writerow(i) This is one step closer. Yet writing into single cells and vertically. S\"E"\"W"... C\"O"\"N"...
... View more
07-21-2016
03:37 PM
|
0
|
2
|
5151
|
|
POST
|
Thanks for the help I put the following and results in vertical rather than horizontal and each letter is written to a different cell. b = fullpath.split("\\") c = ("{}\n" * len(b)).format(*b) for i in c: writer.writerow (i )
... View more
07-21-2016
03:19 PM
|
0
|
4
|
5151
|
|
POST
|
Interesting I just added .split ("\\) writer.writerow([fullpath.split("\\")]) I get the following which correctly splits it at the slashes and yields commas. ['Sewer', 'ControlValve'] So, I only need to write to different rows where it is has a comma.
... View more
07-21-2016
02:13 PM
|
0
|
6
|
5151
|
|
POST
|
This is an example of a row I need to write to csv file by delimiting the slash. Write each section within the slashes to separate rows . I guess I need to know how to make it not recognize as a escape character ? ... \Sewer\ControlValve
... View more
07-21-2016
01:37 PM
|
0
|
8
|
5151
|
|
POST
|
How do I use a back slash as a delimiter, python wont recognize it. ofile = open('MapServicesInfo.csv', "w") writer = csv.writer(ofile, delimiter = '\', quotechar='"', quoting=csv.QUOTE_ALL)
... View more
07-21-2016
12:39 PM
|
0
|
10
|
9716
|
|
POST
|
Thank you for taking the time to look at this. I get the following error. Traceback (most recent call last): File "C:/Users/dunderwood/Documents/AutomatePublishWebLayers/Overwrite_Map_Service.py", line 24, in <module> doc = DOM.parse(xml) File "C:\Python27\ArcGIS10.2\lib\xml\dom\minidom.py", line 1921, in parse return expatbuilder.parse(file) File "C:\Python27\ArcGIS10.2\lib\xml\dom\expatbuilder.py", line 922, in parse fp = open(file, 'rb') IOError: [Errno 2] No such file or directory: 'C:\\Users\\dunderwood\\AppData\\Local\\ESRI\\Desktop10.2\\Staging\\ARCGIS on xyz (publisher)\mapservice.sddraft'
... View more
07-18-2016
07:08 AM
|
0
|
0
|
1469
|
| 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
|