POST
|
I want disable the base map in the ArcCatalog Pane. The basemap settings in the options only affect the map pane. Anyone has an idea? Thanks! Lothar
... View more
08-17-2020
07:52 AM
|
0
|
2
|
496
|
POST
|
In my tool the user has to connect to a MS Exchange-Server. The value method of the GPEncryptedString-object doesn't return the password in plain text (I'm highly appreciate for this fact...). But how do I pass through the password to my function? Thanks! Lothar
... View more
02-05-2018
09:10 AM
|
0
|
2
|
686
|
POST
|
This may help: import arcpy as ap table = <path_to_table> dest_table = <path_for_your_output> field_name ='EXP_CST' day_string = '2018-01-31' # If your string sequence is marked by double quotes, single quotes can be simply used inside the string. # The two '%' represents any number of signs (including none) before and after the string you're looking for. # Use ap.AddFieldDelimiters to be flexible in shp, mdb, fgdb and others dataformats. sql_expression = "{field} LIKE '%{sub_string}%'".format(field=ap.AddFieldDelimiters(table, field_name), sub_string=day_string) sql_expression #prompt the result ap.analysis.Select(table, dest_table, sql_expression) This code doesn't include a solution for transforming string to date and maybe reverse.
... View more
02-05-2018
08:48 AM
|
2
|
1
|
820
|
POST
|
Because DIR doesnt appear in the winddir function , I removed the parameter in the def-statement. I guess you're working in the python-window, so please try this: arcpy.env.workspace= "A:\\test" # Change to the data source directory
tables = arcpy.ListFeatureClasses('*') #all shapes inside the directory
#ALTERNATIVE if tables wanted
# tables = arcpy.ListFiles('*.dbf') #all dBase-files inside the directory
len(tables) # just to controll, should be ~50
for table in tables: #loop through all files
#
with arcpy.da.UpdateCursor(table,["DIR","U","V"]) as cursor:
for row in cursor: #loop through all rows
u,v = row[-2:]
row[0] = winddir(u,v) #new DIR-value associated
cursor.updateRow(row) #rewrite the row in the table You can replace line 11&12 by this expression: row[0] = winddir(*row[-2:])
... View more
03-14-2016
03:54 AM
|
5
|
0
|
186
|
POST
|
Uups, because you calculate only with integer it's better to use int() then float().
... View more
03-11-2016
12:43 PM
|
1
|
0
|
1566
|
POST
|
import math
k = (180/math.pi)
def winddir(v,u):
v = float(v)
u = float(u)
if v > 0:
result = (180/math.pi)*math.atan(u/v)+180)
elif u < 0 and v < 0:
result = ((180/math.pi)*math.atan(u/v))
elif u > 0 and v < 0:
result = ((180/math.pi)*math.atan(u/v)+360)
elif v == 0 and u > 0:
result = 270
elif v == 0 and u < 0:
result = 90
else: result = -1
return result
#-------------------
windir(!V!,!U!) Line 21 belongs to the expression-line, L1- 18 is part of the codeblock So the expression in L21 calls the windir function (L4-18) for every feature in the table with the current values of the fields V and U. Dir is the targetfield for the result of the function. For the function itself it's not nessesary. Line 1&2 will be evaluated only one time at the start of calculation. The following lines will be evaluated as a part of the windir-function every feature/record L4: The function to calculate the wind direction needs only two parameters: The values of the fields U and V. L5&6: You have to make shure, that the variables have the correct datatype. L8,10,12,14&17: The variable is defined by the calculation and at ... L18 at least by the word return the function has the instruction to "give the value back to the one who calls you up" It's more "pythonical" to do it like Freddie, but for beginners/examples my contruction is easyer to understand. L17: Every time you use an if statemant, IMO you have to use else at the end to capture all other oportunities.
... View more
03-11-2016
12:38 PM
|
3
|
1
|
1566
|
POST
|
One supplement to my first comment: The algorythm behind wildcard seems to be an legacy from 9.3. Like in these old times upper- and lowercase are unpythonical ignored: You are free to write '*ANalySis' or '*analysis' or whatever simular you want to write , if you are looking for '(analysis)' in fact.
... View more
03-07-2016
07:17 AM
|
0
|
0
|
333
|
POST
|
The searchstring doesnt end with parenthesis, the result founded do. IMO it's unlogical.
... View more
03-07-2016
06:15 AM
|
0
|
0
|
333
|
POST
|
>>> arcpy.ListToolboxes() [u'3D Analyst Tools(3d)', u'Analysis Tools(analysis)', ...... u'Toolbox(interactiveTools)'] >>> [i for i in arcpy.ListToolboxes() if i.endswith('analysis)')] [u'Analysis Tools(analysis)'] So far, everythings looking good. You may think: Ok, it's little bit complicated. Why don't you use wildcards? >>> arcpy.ListToolboxes( '*analysis)' ) [] No string ends with "analysis)"??. Did I missed something? >>> arcpy.ListToolboxes( '*)' ) [] UUPS!! No string ends with ")". Should I call my ocoulist ?? >>> ap.ListToolboxes('*analysis') [u'Analysis Tools(analysis)'] HEURECA!! Parenthesis are for ArcGIS "signs non gratia": Good enough for printing but not grand enough to receive attention by nobly arcpy-wildcards. But, thanks God!, my beloved core Python is a democratic Python and it's more logical.
... View more
03-07-2016
05:52 AM
|
0
|
3
|
3956
|
POST
|
Hy, after a long time I fond a soloution in the workspace 'release'-property: arcpy.Describe(PGDB-WS) returns something like u'3,0,0' while arcpy.Describe(pure_MSACCESS-WS) returns somethinge like this u'400558244,2616584,323869160' That's ok for me.
... View more
07-31-2015
04:31 AM
|
0
|
1
|
605
|
POST
|
Hi Joshua, thanks for your comprehensive and penetrative answer! I have to digest your code , but I think it contains all answers i'm looking for. Lothar
... View more
07-06-2015
11:53 PM
|
0
|
0
|
947
|
POST
|
Hallo, ArcGIS shows the size of each Dataset and I want to use this sizes in Python. so the first point is I'm looking for a function that decribes the size of a featureclass inside my filegeodabase. ArcCatalog shows it in the Content. I've serched inside the Decribe-Objects, but didn't found. Did I overlooked something? Second point is I'm looking for a function that describe wich files belongs for ArcGIS to a geodataset, so that i can summerize the sizes of each part. For example the land.shp -Dataset consist of e.g SHP, SHX, DBF-File. So, initially glob.glob('land.*') seems to be the solution. But I've got also an archive land.zip or an Table land.csv inside the directory... How can I consider geodata like ArcGIS do? Thanks, Lothar
... View more
06-25-2015
02:21 AM
|
0
|
4
|
4527
|
POST
|
In arcpy docs, like for the listxxx-function, one Paramter is 'wildcards' . I couldn't found any description about the ability of wildcard. '*' & '?' is known, but that's all ?
... View more
06-22-2015
02:33 AM
|
0
|
0
|
2868
|