POST
|
You might try this MySQL query which should return both table names and associated row counts for a database: SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'yourDatabaseName';
... View more
10-21-2021
09:15 PM
|
1
|
0
|
678
|
POST
|
Check your SQL documentation for proper query syntax. You might try replacing the double quote with a single one, so you get: cab_id IN ('ESC-C02', 'ESC-C04', 'SDY-HUT')
... View more
08-10-2021
10:16 AM
|
3
|
2
|
1149
|
POST
|
Per @DanPatterson's suggestion, if the layer supports DEFINITIONQUERY, then check the definition property for a string with length. If it has length, the layer is using a query. for lyr in lyrs:
if lyr.supports("DEFINITIONQUERY"):
if len(lyr.definitionQuery.strip()): # a string with length
print lyr.name, lyr.definitionQuery (My version of ArcMap allowed spaces as a definition query, so stripping them before checking length is advised.)
... View more
06-12-2021
12:40 PM
|
0
|
0
|
1582
|
POST
|
You might try two spaces between Zone and 6S. I ran into a similar problem with Desktop, and the extra space was the fix. I think the extra space is used for aligning single and double digits. >>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone 10N")
>>> print sr.name
WGS_1984_UTM_Zone_10N
>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone 6S") # single space
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\arcobjects\mixins.py", line 992, in __init__
self._arc_object.createFromFile(item, vcs)
RuntimeError: ERROR 999999: Error executing function.
>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone 6S") # double space
>>> print sr.name
WGS_1984_UTM_Zone_6S
... View more
05-06-2021
11:30 PM
|
1
|
0
|
1673
|
POST
|
The search cursor is returning a tuple of 3 elements matching the three fields requested. The check for None is being done on the tuple when it should be the first element which matches the 'Pin' field. Try: with arcpy.da.SearchCursor(fc,['Pin','Perm_COUNT','P_Num']) as cursor:
for row in cursor:
if row[0] not in (None, "", " "): # row[0] checks 'Pin'
... View more
04-21-2021
11:58 PM
|
1
|
1
|
3654
|
POST
|
It doesn't look like the x/y coordinates are in longitude/latitude (WGS 84) in the URL request: inSR=4326
&outSR=26912
&geometries={"geometryType":+"esriGeometryPoint",+"geometries":+[{"x":+-12456757.481260095,+"y":+4974725.271437088}]} %0D%0A
&transformation=108190
&transformForward=true
&vertical=false
&f=html Project documentation.
... View more
04-15-2021
10:37 AM
|
1
|
1
|
1236
|
POST
|
When you design the pop-up for the map, under configure attributes, you can select all the attributes you want to display. You can also select those attributes that can be edited. These are two separate check-boxes. When a field user selects a feature, all the attributes that have been selected to display will be shown (editable and non-editable). When editing is selected then only those attributes where editing has been enabled will be shown. However, it is not possible to see all (editable and non-editable) attributes in edit mode.
... View more
04-12-2021
11:31 PM
|
0
|
1
|
1122
|
POST
|
@JoeBorgioneand @Anonymous User offer good solutions. But you also need to use the proper form in your query since 'week_a' is a variable name and not the actual field name. def weekly_update(week_a, hours_a, week_b, hours_b):
with arcpy.da.UpdateCursor (fc, ['OBJECTID_1', week_a,hours_a, week_b,hours_b], "{} LIKE '%Planned%'".format(week_a)) as cursor: Or, with Jeff's idea: fldList = ["Wk25_Oct12Oct15_ACTIV", "Wk25_HRS", "Wk26_Oct19Oct22_ACTIV", "Wk26_HRS"]
def weekly_update(fldList):
with arcpy.da.UpdateCursor (fc, fldList, "{} LIKE '%Planned%'".format(fldList[0])) as cursor:
....
... View more
04-08-2021
03:56 PM
|
4
|
1
|
2703
|
POST
|
After adding/removing some layers, can you confirm that at least one of the layers used in the new map is editable?
... View more
04-08-2021
03:47 PM
|
0
|
1
|
1403
|
POST
|
Then set row[1] = None. Using the update cursor you can move the value of row[1] into row[2], then delete (set to None) the value in row[1]. with arcpy.da.UpdateCursor (fc, ['SITE_ID', 'Wk3_May11May14_ACTIV','Wk4_May18May21_ACTIV'], "Wk3_May11May14_ACTIV LIKE '%Planned%'") as cursor:
for row in cursor:
row[2] = row[1]
row[1] = None
cursor.updateRow(row)
... View more
04-01-2021
09:32 PM
|
4
|
1
|
2026
|
POST
|
A wild guess, if you would consider tab delimited: lines = ["\t".join(str(i) for i in row) for row in arcpy.da.SearchCursor("MyFeature",["*"])] You could join with a comma instead of the tab. Just a quick test in desktop, so it is 2.7 python.
... View more
03-25-2021
12:35 PM
|
1
|
0
|
2418
|
POST
|
Both Joe and Dan have good suggestions. You are also quoting "Point" in the block where you are setting the definition query. Since you were using the old SearchCursor, I will assume you are using Desktop. Try: mxd = arcpy.mapping.MapDocument("CURRENT")
Point = "MyFeature" # your code sets this
# picking up with:
pointList = []
with arcpy.da.SearchCursor(Point,['OBJECTID']) as cursor:
for row in cursor:
pointList.append(str(row[0])) # row[0] is ObjectID
defQuery = "OBJECTID IN ({})".format(",".join(pointList))
# print defQuery # to verify, if needed
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.name == Point: # remove quotes around Point
lyr.definitionQuery = defQuery
# continue
... View more
03-23-2021
04:01 PM
|
2
|
1
|
4224
|
POST
|
You shouldn't have to import the toolboxes at the top of your script. ImportToolbox says "the core ArcGIS toolboxes are accessible by default in a script".
... View more
01-27-2021
02:49 PM
|
0
|
1
|
1288
|
POST
|
It looks like the ActivitySubCategory field sets the subtype of the feature in the Chemical_Activity layer. For additional information see: Introduction to subtypes Manage feature templates (section: Create feature templates in Map Viewer)
... View more
01-25-2021
08:04 PM
|
0
|
0
|
534
|
POST
|
I don't see in your request where you are including the token "...<featurelayer>/FeatureServer?f=json..."; but perhaps you are. It looks like you might also be missing the layer id and the type of request. Here's my suggestion for the format: https://services1.arcgis.com/<account info>/arcgis/rest/services/<feature layer name>/FeatureServer/<layerid>/query?where=&outFields=*&f=json&token=<token> I'm also not sure if your token request is actually a post request as it looks like you may be appending your username and password to the url as in a get request. Difference between GET and POST method in HTTP I suggest you consider using only post requests for security.
... View more
01-11-2021
01:40 PM
|
1
|
0
|
1897
|
Title | Kudos | Posted |
---|---|---|
1 | 10-27-2016 02:23 PM | |
1 | 09-09-2017 08:27 PM | |
2 | 08-20-2020 06:15 PM | |
1 | 10-21-2021 09:15 PM | |
1 | 07-19-2018 12:33 PM |
Online Status |
Offline
|
Date Last Visited |
07-24-2024
03:05 AM
|