|
POST
|
Hi Louis K. Here's the script that does what you are after: from arcgis.gis import GIS
from arcgis.features import SpatialDataFrame
import pandas as pd
gis = GIS(portal, "username", "password", verify_cert=False)
print("Connected")
search_result = gis.content.search(query="owner: s*", item_type="Feature Service", sort_field="numViews", sort_order="asc", max_items=5000)
df_list = []
for item in search_result:
items = item.items()
df = pd.DataFrame.from_dict(items)
dfTransposed = df.T
dfTransposed.columns = dfTransposed.iloc[0]
dfTransposed = dfTransposed[1:]
dfTransposed = dfTransposed.set_index('name', inplace=False)
dfTransposed = dfTransposed[["owner", "created", "modified", "numViews"]]
df_list.append(dfTransposed)
merged_df = pd.concat(df_list)
# export to excel
merged_df.to_excel(r"Path to output.xlsx") Just input your destination path for the excel output to the script.
... View more
08-18-2020
07:25 PM
|
1
|
5
|
2476
|
|
POST
|
Matt Starry (SWLP) You need to install the package Workforce package. To install, use the following link. It also contains sample notebooks. GitHub - Esri/workforce-scripts: A set of scripts to help administer Workforce projects.
... View more
08-18-2020
09:19 AM
|
1
|
1
|
1994
|
|
POST
|
Hi Matt Starry (SWLP), Can you please explain more about what you are trying to achieve?
... View more
08-18-2020
08:51 AM
|
0
|
3
|
1994
|
|
POST
|
Hi GIS Unit PSBA, Try this code, it should work: search_result = gis.content.search(query="modified: [1514728800000 TO 1525788000000]", max_items=1000)
Search_result If Search_result outputs [ ] which is an empty list, this means there aren't any feature layers or items created between those dates. I hope that helps.
... View more
08-18-2020
12:08 AM
|
1
|
0
|
889
|
|
POST
|
Hi Andrew Thompson, You are just missing 3 zeros in front of the UNIX times and also double quotation marks. Your code has to be as follows: search_result = gis.content.search(query="modified:[1577840400000 TO 1609455600000]", item_type="Feature Service", sort_field="modified", sort_order="desc", max_items=5000)
... View more
08-17-2020
11:49 PM
|
3
|
0
|
1716
|
|
POST
|
Hi Cara Joos, WhatDavid Pike's mentioned above is right. However, if you are after tools out of the toolbox, you can use Dissolve tool for the polyline provided that it has a field with the same value so that you could use it as a dissolve parameter/field to aggregate features. you can add a field with same values if it's not already there. Once the polyline feature class is aggregated (continuous), use the Feature to Polygon tool. => => Note that sometimes just using the Feature to Polygon tool will do the split without using the Dissolve tool, depending on your polyline feature class. I hope that's helpful. Cheers.
... View more
08-11-2020
09:01 AM
|
4
|
0
|
11779
|
|
POST
|
Hi Tracy Whelen, I just checked the ArcGIS API for Python V1.6.1 in the following link: Release v1.6.1 · Esri/arcgis-python-api · GitHub The file is downloadable, you can download and check it for yourself. The equivalent notebook file for this link (other Esri tutorials) isusing-the-map-widget. It looks like zoom_to_layer is not available for this version. I hope that helps.
... View more
08-10-2020
08:39 AM
|
1
|
1
|
2225
|
|
POST
|
Hi Alberto Cañivano I tested the same code with a sample feature layer and it's working fine. I just changed the item.tables index to 0 as I only have one related table to the feature layer. item = gis.content.get("xxxxxxxxxxxx")
foto = (item.tables)[0]
field_service_dataframe = pd.DataFrame.spatial.from_layer(foto)
field_service_dataframe Output: I recommend check you feature layer first, then change the index. you can also check the code on other feature layers to see if it throws the same error. I hope that helps.
... View more
08-09-2020
06:17 AM
|
1
|
1
|
5186
|
|
POST
|
Hi Paul Sweeney The code needs some tweaks to get it working. First you can limit the number of max_items down to 4 or 5 to speed up the process. Once it gets to work you can increase the number. Second I recommend using gis.map() instead of WebMap(). The code will be something like below: item1 = gis.content.search(query = "title:HSF",item_type='Feature Layer', max_items=5)
for item in item1:
display(item)
======================================
item2 = gis.content.search(query = "title:xxxxxxxxx",item_type='Web Map', max_items=1000)
wm_item = item2[0]
web_map_obj = gis.map(wm_item)
web_map_obj
======================================
for item in item1:
web_map_obj.add_layer(item) Run each block (delineated by =======) on a separate cell in notebook to have a better check.
... View more
08-09-2020
05:41 AM
|
1
|
1
|
1406
|
|
POST
|
Hi Eric Wagner, I was wondering if it would be possible to update or customize surveys by adding more questions and republishing and then customize the dashboards. Thanks Mehdi
... View more
07-21-2020
09:27 PM
|
1
|
0
|
959
|
|
POST
|
Hi Christian Bischof, Here's the python code which takes an excel file with a startpoint and endpoint column each containing x and y coordinates as input and outputs an excel file with shape_length (distance) calculated in a new column. Just change the variables' values, sheet name and the spatial_reference accordingly it should work. import arcpy
import pandas as pd
excelTable = r"D:\temp\XY_Coordinates.xlsx"
csvTable = r"D:\temp\out_csv.csv"
outputFC = r"D:\temp\output.gdb\out_coordinates"
out_Excel = r"D:\temp\XY_Coordinates_output.xlsx"
arcpy.env.overwriteOutput = True
read_file = pd.read_excel (excelTable, sheet_name='Sheet1')
read_file.to_csv (csvTable, index = None, header=True)
# Convert x and y coordinates into line
arcpy.XYToLine_management(
csvTable,
outputFC,
'Start_X',
'Start_Y',
'End_X',
'End_Y',
'NORMAL_SECTION',
'#',
"PROJCS['GDA_1994_MGA_Zone_50',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 1900 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"
)
# Converting gdb feature class attribute to Excel
arcpy.TableToExcel_conversion(outputFC, out_Excel) Here's a screenshot of the output:
... View more
07-07-2020
12:22 AM
|
2
|
1
|
3168
|
|
POST
|
Hi Victor Tey, The Extract Data tool in ArcToolbox contains 7 parameters. It's zero-indexed. If you go to the properties of the tool and click parameters, you will see there are 7 parameters already set up. If you want to update or change any parameters, you need to make a copy of the tool and paste it somewhere else e.g. Toolbox.tbx in Home - Documents\ArcGIS directory. The Area of Interest you are pointing to is a feature set. The way I use is export the model builder into a script, do the changes there, make a tool out of it. Area_of_Interest = "in_memory\\{3429FFB4-5050-4D6E-B6BF-3266C230BC5F}" Then bring it back into a new model builder should you wish to use it with other tools in model builder, otherwise you can carry on with the script.
... View more
07-06-2020
11:26 PM
|
1
|
1
|
1518
|
|
POST
|
Hi Cameron McArtney, There are two ways that I know of making basemaps available offline: 1. Using ArcMap to create a tile package - How to create a tile package 2. The ArcGIS Marketplace has tool called Tile Package Kreator which allows tiles to be downloaded offline with mobile applications. Cheers Mehdi
... View more
06-26-2020
07:23 PM
|
4
|
1
|
719
|
|
POST
|
Not a problem Modern Electric. Great to hear that Could you please flag the question as Answered? Thanks.
... View more
06-26-2020
11:18 AM
|
1
|
0
|
6447
|
|
POST
|
Not a problem, Kathy Gillis This sign # is for Priority Ranks. Refer to the link below for more info: Priority ranks and geoprocessing tools—Help | Documentation
... View more
06-26-2020
11:13 AM
|
1
|
0
|
3494
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-16-2021 09:38 PM | |
| 1 | 03-17-2024 06:09 PM | |
| 1 | 11-10-2020 04:59 PM | |
| 1 | 02-08-2021 09:29 PM | |
| 1 | 02-17-2021 04:47 PM |