|
IDEA
|
@ChristopherRatcliff try the following after adding the new field to the feature service: change the GeoEvent output to another service and Save change the GeoEvent output to the original service and Save GeoEvent should update the new field, however I do see that it will not update the original record(s), but create a new one. Afterwards, it will update the existing record based on the unique identifier field: I would recommend deleting all records after adding the new field(s).
... View more
04-08-2024
09:41 AM
|
0
|
0
|
2598
|
|
POST
|
You should just have to change line 15 and specify the sublayer's index number. For example, if it's the 3rd layer in the service it would be an index of 2: layer = FeatureLayer.layers[2]
... View more
04-08-2024
07:16 AM
|
2
|
3
|
1558
|
|
POST
|
Hi @GeeteshSingh07, Can you post some of the code that is not working for you?
... View more
04-08-2024
06:39 AM
|
0
|
1
|
2250
|
|
POST
|
Hi @PolzinFiona , Can you post an example of the code your using?
... View more
04-08-2024
06:38 AM
|
0
|
0
|
1567
|
|
POST
|
Hi @ChenChen4, The documentation is stating if you delete the Portal Group, it will not delete the group from Active Directory/LDAP/SAML. If you delete the Active Directory/LDAP/SAML, it will not delete the Portal group, it will just remove all portal members, except the group owner. If you are looking to remove the Active Directory/LDAP/SAML group from Portal, deleting it from within Portal will be efficient enough.
... View more
04-08-2024
05:57 AM
|
0
|
1
|
1343
|
|
POST
|
@TonyAlmeida, yes, I can execute the tool multiple times. Try adding del cursor below the SearchCursor:
... View more
04-02-2024
03:18 AM
|
0
|
1
|
6366
|
|
POST
|
@GeorgeClark not quite sure on this, but I would simply use the full path to the python.exe when configuring the scheduled task:
... View more
03-29-2024
04:04 AM
|
0
|
1
|
4865
|
|
POST
|
@SGTomlins you can take a look at the scripts here. They have examples of creating users accounts.
... View more
03-28-2024
03:56 AM
|
1
|
1
|
2911
|
|
POST
|
It's something with how the CSV is being created. When trying to read the CSV file, it is not being read correctly. See below: I'm not sure if it has to do with the delimiter being used or something else, but this is where you will need to troubleshoot further. Sorry, I'm not an expert with dataframes, so not sure how much help I will be.
... View more
03-28-2024
03:42 AM
|
1
|
1
|
3149
|
|
POST
|
Can you share the CSV you're using to one of the AGOL groups you invited me to?
... View more
03-27-2024
04:30 AM
|
1
|
3
|
3157
|
|
POST
|
@WGIS with SAML enabled, you can still create a built-in Administrator account and use that. An Administrator account is not required, but the tool would have to be re-written in a few places so that a Publisher could execute it successfully. However, it may be worth given some thought if you want a non-admin promoting content to your Production environment.
... View more
03-26-2024
07:06 AM
|
1
|
2
|
5198
|
|
POST
|
Hi @g1omaa, These tools here will do exactly what you're looking for.
... View more
03-26-2024
05:37 AM
|
3
|
0
|
5220
|
|
DOC
|
@Sibe I currently don't have plans to implement this. To do this, you would need to query the manifest.json or manifest.xml files located at \arcgisserver\config-store\services\<service name>\esriinfo\manifest. These files hold information of the feature classes/tables used in the services.
... View more
03-26-2024
05:27 AM
|
0
|
0
|
28775
|
|
POST
|
@FredMitchell , Try the following: import arcpy, os, uuid
import pandas as pd
import datetime
from datetime import timedelta
from arcgis.features import GeoAccessor, FeatureLayer
from arcgis.gis import GIS
# Variables
url = 'https://kirklandwa.maps.arcgis.com'
username = 'user'
password = 'pw'
hostedTableID = '78e4a92c5c324dd18cc6eee11cb6b2f7'
outputCSVFile = r'local path to CSV'
# get table from AGOL
gis = GIS(url, username, password)
CrimeTrendsTable = gis.content.get(hostedTableID)
CrimeTrendsTableLyr = CrimeTrendsTable.tables[0]
crimeLayer = FeatureLayer(CrimeTrendsTableLyr.url, gis=gis)
# Truncate table
CrimeTrendsTableLyr.manager.truncate()
# import feature class and create slice of the data set in a new dataframe
df = pd.DataFrame.spatial.from_featureclass(r"local path of larger feature class from sde")
df = df.sort_values(['OFFENSES_YEAR', 'CRIME_STAT_TYPE', 'FROM_DATE'], ascending= [True, True, True], ignore_index=True)
df = df.loc[:, ['OFFENSES_YEAR', 'CRIME_STAT_TYPE', 'FROM_DATE']]
# set variables for today and the previous 5 years
today = datetime.datetime.today()
todate1 = today - timedelta(365)
todate2 = today - timedelta(730)
todate3 = today - timedelta(1095)
todate4 = today - timedelta(1460)
todate5 = today - timedelta(1825)
this_year = datetime.datetime.today().year
one_year_ago = this_year - 1
two_years_ago = this_year - 2
three_years_ago = this_year - 3
four_years_ago = this_year - 4
five_years_ago = this_year - 5
# create new dataframes for current and each previous year to date
df0 = df.loc[(df['OFFENSES_YEAR']==this_year) & (df['FROM_DATE'] < today)]
df1 = df.loc[(df['OFFENSES_YEAR']==one_year_ago) & (df['FROM_DATE'] < todate1)]
df2 = df.loc[(df['OFFENSES_YEAR']==two_years_ago) & (df['FROM_DATE'] < todate2)]
df3 = df.loc[(df['OFFENSES_YEAR']==three_years_ago) & (df['FROM_DATE'] < todate3)]
df4 = df.loc[(df['OFFENSES_YEAR']==four_years_ago) & (df['FROM_DATE'] < todate4)]
df5 = df.loc[(df['OFFENSES_YEAR']==five_years_ago) & (df['FROM_DATE'] < todate5)]
# create tables for each current and previous year grouped by crime type, add together previous year tables and average
table0 = df0.groupby('CRIME_STAT_TYPE')['OFFENSES_YEAR'].count().reset_index()\
.rename(columns={"OFFENSES_YEAR" : this_year})
table1 = df1.groupby('CRIME_STAT_TYPE')['OFFENSES_YEAR'].count()
table2 = df2.groupby('CRIME_STAT_TYPE')['OFFENSES_YEAR'].count()
table3 = df3.groupby('CRIME_STAT_TYPE')['OFFENSES_YEAR'].count()
table4 = df4.groupby('CRIME_STAT_TYPE')['OFFENSES_YEAR'].count()
table5 = df5.groupby('CRIME_STAT_TYPE')['OFFENSES_YEAR'].count()
avgtable = pd.concat([table1, table2, table3, table4, table5]).groupby('CRIME_STAT_TYPE').mean().reset_index()\
.rename(columns={"OFFENSES_YEAR" : "previous5yearAverage"})
trendstable = avgtable.join(table0.set_index('CRIME_STAT_TYPE'), on='CRIME_STAT_TYPE').fillna(0)
trendstable.to_csv(outputCSVFile, sep='\t', encoding='utf-8')
# update hosted table from csv file
csvDF = GeoAccessor.from_table(outputCSVFile)
adds_fs = csvDF.spatial.to_featureset()
adds_dict = adds_fs.to_dict()
adds = adds_dict["features"]
crimeLayer.edit_features(adds=adds)
... View more
03-25-2024
04:24 PM
|
1
|
5
|
3168
|
|
POST
|
Hi @AFackler_NAPSG, You can use the group ID and then check if the item is shared with the group based off that. Ex: groupID = 'c901a2470db24abfb92a079f14186c1e'
lyr_item = gis.content.get('db6680d8e14d4f2bba5236752d44efc3')
for group in lyr_item.shared_with['groups']:
if group.id == groupID:
print("Shared with group")
else:
print("Not shared with group")
... View more
03-25-2024
12:33 PM
|
1
|
1
|
1759
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Online
|
| Date Last Visited |
Friday
|