|
POST
|
Hello, I have ArcGIS Pro, and ArcGIS Online. I have a question regarding the point shapefile transit stop in city boundary. Someone wants to see a GIS Map of the City, with points for elderly residents. Those point clusters should start to create a heat map like visual that can show where the highest concentration of elderly residents live. The points for the trolley stops and public transit stops should be the easiest points to source and are there purely for context about nearby transit options the clusters might have available. identified several age bands for the data (maybe color coded) 60-70, 71-80, => 81. Some potential data sets we might be able to use to source the demographic info were parks data (silver club members, current - but that will be a small pool), potentially voter registration, golden passport members. Using Age: 5 years increments population senior citizen 60+. I found tools Enrich and Buffer. Is it required to input distance or can it be without? Please need your advice. Thank you for your time and support. Alex
... View more
12-06-2023
09:31 AM
|
0
|
3
|
1229
|
|
POST
|
Hello @RhettZufelt Thank you for your reply. Do I also need to input UNC path on add argument optional since it is not letter C:?
... View more
03-16-2023
09:27 AM
|
0
|
1
|
3552
|
|
POST
|
Hello, Thank you for your reply. the add argument is already add full path. by full path, I have different letter than C: and it is already set up map network. I am gonna try using UNC as per @RhettZufelt .
... View more
03-16-2023
09:09 AM
|
0
|
0
|
3556
|
|
POST
|
Hello all, I have ArcGIS Pro 3.0, window task scheduler and python 27. I am not expertise with window task scheduler. Please see screenshots and error below. It is working successful when I run python script manually. But when I tried to run window task scheduler, I got error messages. I am not sure what to do. Please kindly assist. Thank you so much in advance. ERROR MESSAGES PYTHON SCRIPT CODE import arcpy
import csv
import os
from datetime import date
from datetime import datetime
matchTableName = r"ElevationCertificatesAttachmentMatchTable.csv"
docFolder = r"Q:\2023\IMPORTED TO GIS"
matchField = "MatchID"
pathField = "Filename"
#change this date to the disired value
processFilesAddedOnDate = date.today()
# iterate through each .pdf file in the directory and write a row to the table
for (root, dirs, files) in os.walk(docFolder):
workingFolder = root
matchTableNamePath = os.path.join(root, matchTableName)
# create a new Match Table csv file
if os.path.exists(matchTableNamePath):
os.remove(matchTableNamePath)
writer = csv.writer(open(matchTableNamePath, "w", newline=''), delimiter=",")
# write a header row (the table will have two columns: ParcelID and Picture)
writer.writerow([matchField, pathField, 'fullPath'])
for f in files:
if '.pdf' in f:
#if datetime.strptime(os.path.getctime(os.path.join(root, f)),"%m/%d/%Y") >= processFilesAddedOnDate:
if date.fromtimestamp(os.path.getctime(os.path.join(root, f))) >= processFilesAddedOnDate:
#print(processFilesAddedOnDate)
#print(date.fromtimestamp(os.path.getctime(os.path.join(root, f))))
fileNameToAddress = f.replace(".pdf", "")
fileNameToAddress = fileNameToAddress.replace(" ", " ");
fileNameToAddress = fileNameToAddress.replace("nw", "NW")
try:
firstPartUntilNW = fileNameToAddress.split("NW")[0].strip().split(" ")
restAfterNW = fileNameToAddress.split("NW")[1].strip()
#print(firstPartUntilNW, len(firstPartUntilNW))
#print(restAfterNW)
fileNameToAddressWithNoPermitNumber = ""
if len(firstPartUntilNW) == 2:
fileNameToAddressWithNoPermitNumber = firstPartUntilNW[1]+" NW "+restAfterNW
if len(firstPartUntilNW)== 1:
fileNameToAddressWithNoPermitNumber = firstPartUntilNW[0]+" NW "+restAfterNW
#print(fileNameToAddressWithNoPermitNumber)
writer.writerow((fileNameToAddressWithNoPermitNumber,f, os.path.join(root, f)))
except:
continue
del writer
# Set the workspace environment and run add attachment
arcpy.env.workspace = r'C:\Users\AppData\Roaming\Esri\ArcGISPro\Favorites\test.sde'
arcpy.management.AddAttachments('sde.TEST.TEST', 'ADDR', matchTableNamePath, "MatchID", "Filename", workingFolder)
... View more
03-15-2023
01:39 PM
|
0
|
8
|
3629
|
|
POST
|
Hello all, I have ArcGIS Pro 3.0 and python 27. I am not expertise with code. Please see error and code below. It is working fine when using "processFilesAddedOnDate = datetime.strptime('01/01/2023', '%m/%d/%Y')". But when I switched to "processFilesAddedOnDate = date.today()", I got an error message. I am not sure what to do. Please kindly assist. Thank you so much in advance. ERROR MESSAGE = RESTART: M:\ArcGIS\ArcGIS\Projects\EC\PROD2023.py Traceback (most recent call last): File "M:\ArcGIS\ArcGIS\Projects\EC\PROD2023.py", line 33, in <module> if datetime.fromtimestamp(os.path.getctime(os.path.join(root, f))) >= processFilesAddedOnDate: TypeError: can't compare datetime.datetime to datetime.date >>> PYTHON SCRIPT CODE import arcpy
import csv
import os
from datetime import date
from datetime import datetime
matchTableName = r"ElevationCertificatesAttachmentMatchTable.csv"
docFolder = r"Q:\2023\IMPORTED TO GIS"
matchField = "MatchID"
pathField = "Filename"
#change this date to the disired value
#processFilesAddedOnDate = datetime.strptime('01/01/2023', '%m/%d/%Y')
processFilesAddedOnDate = date.today()
# iterate through each .pdf file in the directory and write a row to the table
for (root, dirs, files) in os.walk(docFolder):
workingFolder = root
matchTableNamePath = os.path.join(root, matchTableName)
# create a new Match Table csv file
if os.path.exists(matchTableNamePath):
os.remove(matchTableNamePath)
writer = csv.writer(open(matchTableNamePath, "w", newline=''), delimiter=",")
# write a header row (the table will have two columns: ParcelID and Picture)
writer.writerow([matchField, pathField, 'fullPath'])
for f in files:
if '.pdf' in f:
#if datetime.strptime(os.path.getctime(os.path.join(root, f)),"%m/%d/%Y") >= processFilesAddedOnDate:
if datetime.fromtimestamp(os.path.getctime(os.path.join(root, f))) >= processFilesAddedOnDate:
#print(os.path.getctime(os.path.join(root, f)).strftime("%m/%d/%Y")+ ' ' + processFilesAddedOnDate.strftime("%m/%d/%Y"))
fileNameToAddress = f.replace(".pdf", "")
fileNameToAddress = fileNameToAddress.replace(" ", " ");
fileNameToAddress = fileNameToAddress.replace("nw", "NW")
try:
firstPartUntilNW = fileNameToAddress.split("NW")[0].strip().split(" ")
restAfterNW = fileNameToAddress.split("NW")[1].strip()
#print(firstPartUntilNW, len(firstPartUntilNW))
#print(restAfterNW)
fileNameToAddressWithNoPermitNumber = ""
if len(firstPartUntilNW) == 2:
fileNameToAddressWithNoPermitNumber = firstPartUntilNW[1]+" NW "+restAfterNW
if len(firstPartUntilNW)== 1:
fileNameToAddressWithNoPermitNumber = firstPartUntilNW[0]+" NW "+restAfterNW
#print(fileNameToAddressWithNoPermitNumber)
writer.writerow((fileNameToAddressWithNoPermitNumber,f, os.path.join(root, f)))
except:
continue
del writer
# Set the workspace environment and run add attachment
arcpy.env.workspace = r'C:\Users\AppData\Roaming\Esri\ArcGISPro\Favorites\test.sde'
arcpy.management.AddAttachments('sde.123.test', 'ADDR', matchTableNamePath, "MatchID", "Filename", workingFolder)
... View more
02-24-2023
01:24 PM
|
0
|
2
|
4943
|
|
POST
|
@DanPatterson Thank you for the information. I tried this method and it doesn't work. I found a different method for sde file workspace location added above line "acrpy.management.addattachments" and it was successful. # Set the workspace environment and run add attachment
arcpy.env.workspace = r'C:\Users\AppData\Roaming\Esri\ArcGISPro\Favorites\test.sde'
... View more
02-15-2023
12:21 PM
|
0
|
0
|
2167
|
|
POST
|
@DanPatterson Thank you for your prompt response. I ran it again and I got another error message below. I don't think I wrote the fullpath correctly. I am trying to set up using python scrip to set up in task scheduler. is it possible to set up ArcGIS Pro Notebook to window task scheduler? the goal is to have it run by task scheduler. Please kindly advise. = RESTART: M:\test\ArcGIS\Projects\EC\IMPORTEC.py Traceback (most recent call last): File "M:\test\ArcGIS\Projects\EC\IMPORTEC.py", line 53, in <module> arcpy.management.AddAttachments(r"C:\Users\AppData\Roaming\Esri\ArcGISPro\Favorites\test.sde", "sde.123.test", "ADDR", matchTableNamePath, "MatchID", "Filename", workingFolder) TypeError: AddAttachments() takes from 0 to 6 positional arguments but 7 were given >>>
... View more
02-10-2023
10:57 AM
|
0
|
0
|
2243
|
|
POST
|
Hello all, I have ArcGIS Pro 3.0 notebook and python 27. I am not expertise with code. Please see error and code below. I exported from ArcGIS Pro notebook to Python script. It is working fine when run on ArcGIS Pro notebook. But when I tried to run Python script, I got an error message. I am not sure what to do. Please kindly assist. Thank you so much in advance. PYTHON SCRIPT CODE from arcgis.gis import GIS
import arcpy
import csv
import os
from datetime import date
from datetime import datetime
matchTableName = r"CertificatesAttachmentMatchTable.csv"
docFolder = r"Q:\2022\IMPORTED TO GIS"
matchField = "MatchID"
pathField = "Filename"
#change this date to the disired value
processFilesAddedOnDate = datetime. strptime('06/01/2022', '%m/%d/%Y')
#processFilesAddedOnDate = date.today()
# iterate through each .pdf file in the directory and write a row to the table
for (root, dirs, files) in os.walk(docFolder):
workingFolder = root
matchTableNamePath = os.path.join(root, matchTableName)
# create a new Match Table csv file
if os.path.exists(matchTableNamePath):
os.remove(matchTableNamePath)
writer = csv.writer(open(matchTableNamePath, "w", newline=''), delimiter=",")
# write a header row (the table will have two columns: ParcelID and Picture)
writer.writerow([matchField, pathField, 'fullPath'])
for f in files:
if '.pdf' in f:
if datetime.fromtimestamp(os.path.getctime(os.path.join(root, f))).strftime("%m/%d/%Y") >= processFilesAddedOnDate.strftime("%m/%d/%Y") :
fileNameToAddress = f.replace(".pdf", "")
fileNameToAddress = fileNameToAddress.replace(" ", " ");
fileNameToAddress = fileNameToAddress.replace("nw", "NW")
try:
firstPartUntilNW = fileNameToAddress.split("NW")[0].strip().split(" ")
restAfterNW = fileNameToAddress.split("NW")[1].strip()
#print(firstPartUntilNW, len(firstPartUntilNW))
#print(restAfterNW)
fileNameToAddressWithNoPermitNumber = ""
if len(firstPartUntilNW) == 2:
fileNameToAddressWithNoPermitNumber = firstPartUntilNW[1]+" NW "+restAfterNW
if len(firstPartUntilNW)== 1:
fileNameToAddressWithNoPermitNumber = firstPartUntilNW[0]+" NW "+restAfterNW
#print(fileNameToAddressWithNoPermitNumber)
writer.writerow((fileNameToAddressWithNoPermitNumber,f, os.path.join(root, f)))
except:
continue
del writer
arcpy.management.AddAttachments("sde.123.test", "ADDR", matchTableNamePath, "MatchID", "Filename", workingFolder) ERROR MESSAGE = RESTART: M:\test\ArcGIS\Projects\EC\IMPORTEC.py Traceback (most recent call last): File "M:\test\ArcGIS\Projects\EC\IMPORTEC.py", line 52, in <module> arcpy.management.AddAttachments("sde.123.test", "ADDR", matchTableNamePath, "MatchID", "Filename", workingFolder) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 874, in AddAttachments raise e File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 871, in AddAttachments retval = convertArcObjectToPythonObject(gp.AddAttachments_management(*gp_fixargs((in_dataset, in_join_field, in_match_table, in_match_join_field, in_match_path_field, in_working_folder), True))) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Dataset: Dataset sde.123.test does not exist or is not supported Failed to execute (AddAttachments).
... View more
02-10-2023
10:01 AM
|
0
|
4
|
2272
|
|
POST
|
I ran it manually from task scheduler, and it is working. It seems like configuration issue with windows task. I am not sure where to narrow it down. It hasn't been changed.
... View more
03-22-2022
01:54 PM
|
0
|
0
|
2966
|
|
POST
|
Hello @BlakeTerhune Please see screenshots and python script. i also set it up on task scheduler. it was working running since September 2021 until stop recently. I haven't change any script and task scheduler. For some reasons, my zip file 'PaFiles.gdb' stopped working. I found out that the last time inside that zip file, it ran populated on Jan. 2022 but everything else is fine. Please advise. Thank you for your help. from arcgis.gis import GIS
# Python Standard Library Modules
from pathlib import Path, PurePath
from zipfile import ZipFile
public_data_item_id = '123'
anon_gis = GIS(username="123", password="123")
data_item = anon_gis.content.get(public_data_item_id)
data_path = Path('C:\123')
if not data_path.exists():
data_path.mkdir()
zip_path = data_path.joinpath('PAData.zip')
extract_path = data_path.joinpath('PADataDatasets')
with ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(extract_path)
data_item.download(save_path=data_path)
print (PurePath(zip_path))
from pathlib import Path, PurePath
from zipfile import ZipFile
data_path = Path('C:\123\PADataDatasets\PA_Data')
if not data_path.exists():
data_path.mkdir()
zip_path = data_path.joinpath('PaFiles.gdb.zip')
extract_path = data_path.joinpath('PaFiles.gdb')
with ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(extract_path)
print (PurePath(zip_path))
... View more
03-22-2022
07:56 AM
|
0
|
2
|
2972
|
|
POST
|
Hello, For user conference 2022, I am unable to find a proposal or justification letter. I need it to submit to my employer for approval. It has been posted on the website UC in the past UC, and now I can't find it. Please kindly advise. Thank you, Alex
... View more
03-18-2022
07:35 AM
|
0
|
1
|
1693
|
|
POST
|
@Anonymous User @BrianKaplan Hi! Where can I find this information to schedule ArcGIS notebook from ArcGIS Pro? Has this been out yet?? Thank you.
... View more
10-07-2021
08:33 AM
|
0
|
0
|
1436
|
|
POST
|
Hello, I have ArcGIS Pro 2.8 using notebook. I am unable to find information how to set up run schedule from ArcGIS Pro direct. I read a documentation somewhere it stated it should display history to set up schedule but I don't see anything. I created notebook and manual run it and it is working fine on ArcGIS Pro but would like to set up schedule. Please kindly advise. Thank you, Alex
... View more
09-28-2021
11:51 AM
|
0
|
1
|
2399
|
|
POST
|
@TravisSizemore Thank you. I will check on it and will get it back to you maybe in a week. Hopefully it works. (:
... View more
09-28-2021
05:54 AM
|
0
|
0
|
1914
|
|
POST
|
@TravisSizemore Thank you. I understand. I looked into it and I don't think they have this specific type of lat and long like this example: 26.090144, -86.062784. Not sure if I am missing.
... View more
09-23-2021
08:21 AM
|
0
|
0
|
1937
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-01-2025 12:12 PM | |
| 1 | 05-12-2021 10:12 AM | |
| 1 | 07-25-2018 12:53 PM | |
| 1 | 08-06-2018 12:27 PM | |
| 1 | 07-06-2018 01:00 PM |