|
POST
|
you could parse out each path individually using [FIELD].split(" | ") and make a for loop that opens each parsed path. Even if it has only 1 record, it will still return a list of string(s). test = "Test1 | Test2" test2 = "Test1" print test.split(" | ") ['Test1', 'Test2'] print test2.split(" | ") ['Test1'] just would need to add "PATH" in front of each. import webbrowser
def OpenLink ( [FIELD] ):
pathlist = [FIELD].split(" | ")
for path in pathlist:
fullpath = 'PATH' + path
webbrowser.open(fullpath)
return EDIT: Updated code to final.
... View more
09-04-2015
01:08 PM
|
1
|
0
|
4467
|
|
POST
|
How about making a second layer for the same dataset, have one label be the label you have now, the other be the number? That way they would not be part of the same label and you could give the numeric label higher weight and make sure its centered on the point.
... View more
09-04-2015
08:57 AM
|
1
|
2
|
2352
|
|
POST
|
Why not just make the point Symbology no color, then just have the points labelled based off the number field? That way they could effectively be the symbology for the points.
... View more
09-04-2015
08:34 AM
|
0
|
4
|
2352
|
|
POST
|
You could add some fields and parse out the parts of the PopUpInfo you need for each individual field with field calculator.
... View more
09-04-2015
08:20 AM
|
1
|
3
|
2320
|
|
POST
|
They are very hit and miss about what layer properties you can set with arcpy, and which ones you need ArcObjects to directly manipulate. Luckily they had somewhat of a workaround for this particular scenario.
... View more
09-04-2015
07:24 AM
|
0
|
0
|
3644
|
|
POST
|
I wonder if Richard Fairhurst has any comments on this, I know he does alot of addressing.
... View more
09-03-2015
12:18 PM
|
0
|
0
|
2397
|
|
POST
|
There was another duplicate over in python snippets Space. I went ahead and shared with a few other Places
... View more
09-03-2015
09:58 AM
|
0
|
1
|
3644
|
|
POST
|
Hi Ian I don't believe there is a direct way to do this with arcpy.mapping.Layer. However, if you have a saved Layer file that does have time enabled, you should be able to use arcpy.mapping.UpdateLayerTime to update the time properties of the layers you are adding from an existing .lyr file. see:(copy/paste) http://resources.arcgis.com/en/help/main/10.1/index.html#/UpdateLayerTime/00s300000064000000/ I'd test on a single layer first. Ian M
... View more
09-03-2015
09:37 AM
|
1
|
2
|
3644
|
|
POST
|
I think the problem is you are setting InAsciiFile = None, and never changing its value except in the for-loop which is a local variable, not global. Since your ASCIItoRaster_conversion is outside the forloop, it uses the None as an input with os.path.join not the file name. Move the conversion in the forloop so it can use the local variable InAsciiFile, not the global value.
... View more
09-03-2015
09:05 AM
|
1
|
3
|
2507
|
|
POST
|
Wes is quite correct that the arcpy mapping module can take care of most of your needs. You would probably need to set-up some map templates with all the layers, text elements, picture elements, legends, etc you will need on them(Naming all these elements making them significantly easier to access via the arcpy module). Using cursors you could pull data from the attribute table and apply them to various text elements on your map. You could pull the current date via the python time module, and also created date information for the start of the week for display. Once all the changes are made, you can save the map and export to pdf. I posted a script that I used alot of the arcpy.mapping module on this thread, if you need some examples. Custom brochure printing Python
... View more
09-03-2015
08:15 AM
|
1
|
1
|
2978
|
|
POST
|
It also might be worthwhile to see if any open source GIS solutions would meet your needs, such as QGIS or GRASS. OSGeo.org | Your Open Source Compass
... View more
09-02-2015
06:53 AM
|
2
|
0
|
5434
|
|
POST
|
Definitely a more pythonic solution and in the case of having more states would be significantly improved over my version. I should really use dictionaries more often, but since I only use python with arcgis I haven't used them alot(exception of storing data from cursors with them).
... View more
08-26-2015
02:47 PM
|
0
|
0
|
1744
|
|
POST
|
Also, why would you need to create a new field each time? You could run the field calculator over and over again on the existing field if you wanted. Calculate Field can be done on an existing field or a new empty field.
... View more
08-26-2015
12:56 PM
|
0
|
1
|
5148
|
|
POST
|
I used a function to do something like this and it should be adaptable for what you are needing. I had a table with mixed upper and lower cases no's and Nones, that I all wanted "No". Also replaced all "yes" with "Yes". The function allows you to use loops and other python tools, instead of a single line of code. If you know all the exact strings you need replaced, you can put them in lists, otherwise wildcards could be used. Python Parser, click Show Code Block Pre-Logic Script Code def Rename(field):
type1_replace = [ "no" , "None"]
type2_replace = "yes"
for n in type1_replace:
field = field.replace(n , "No")
field = field.replace(type2_replace , "Yes")
return field New Field = Rename(!YourFieldHere!) Edit: Ah heck, I'll post a relevant to you example. def Rename(field):
type1_replace = ["california" , "CA" , "cal" ]
type2_replace = [ "florida" , "FL" , "fl"]
for n in type1_replace:
field = field.replace(n , "California")
for n2 in type2_replace:
field = field.replace(n2 , "Florida")
return field
... View more
08-26-2015
12:44 PM
|
2
|
1
|
5149
|
|
POST
|
It would be possible to use a csv file as an input parameter with a few changes. Python has a csv reader/parser module that could convert a csv to a list which could be iterated through. 13.1. csv — CSV File Reading and Writing — Python 2.7.10 documentation A few changes I would make are removing the loop for the 3 scales, I was going to just have it set first scale, save, set second scale, save with new name, set 3rd scale, save with third name. Other thing was to add field delimiters so you wouldn't have to change the select by layer expression depending on which input type you are using, shapefile, gdb fc, or sde fc. http://resources.arcgis.com/en/help/main/10.1/index.html#//018v0000006p000000 (copy/paste) You wanting to keep it a script tool, or just run as a python script?
... View more
08-24-2015
12:16 PM
|
0
|
1
|
1290
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-22-2017 08:58 AM | |
| 1 | 10-05-2015 05:43 AM | |
| 1 | 05-08-2015 07:03 AM | |
| 1 | 10-20-2015 02:20 PM | |
| 1 | 10-05-2015 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|