|
DOC
|
@DuncanHornbyI still receive an error when checking out the extension. Sometimes I receive the following error as well: Error creating service area: ERROR 160722: The item was not found. If I only have 1 point in the facilities feature class, the code executes successfully. I thought there may be a lock on the Network Dataset, so I tried creating a unique Network Dataset Layer in the createServiceAreas function and creating the Service Area Analysis Layer using that: arcpy.MakeNetworkDatasetLayer_na(networkDataset, "networkDataset_{0}".format(oid)) However, I still received an error.
... View more
03-05-2021
08:48 AM
|
0
|
0
|
15691
|
|
DOC
|
@DuncanHornby @curtvprice I'm trying to use multiprocessing to create service areas for many features. Below is my code, but I keep receiving an error when it tries to create the service area analysis layer: Creating OID list There are 2 facilities to process Sending to pool Creating service area Error creating service area: ERROR 160706: Cannot acquire a lock. Failed to execute (MakeServiceAreaAnalysisLayer). import arcpy, os, time, sys
import multiprocessing
from functools import partial
arcpy.env.overwriteOutput = 1
# Variables
gdb = r"C:\Projects\TCHP\TCHP.gdb"
networkDataset = r"C:\Projects\TCHP\TCHP.gdb\Transportation\Streets_ND"
facilities = r"C:\Projects\TCHP\TCHP.gdb\Facilities"
output_dir = r"C:\Projects\TCHP"
layer_name = "FacilityCoverage"
def createServiceAreas(facilities,oid):
try:
# Create a feature layer for each facility
descObj = arcpy.Describe(facilities)
field = descObj.OIDFieldName
df = arcpy.AddFieldDelimiters(facilities,field)
query = df + " = " + str(oid)
arcpy.MakeFeatureLayer_management(facilities,"facilities_{0}".format(oid), query)
# Create Service Area Layer
try:
print("Creating service area")
# Create unique service area name
serviceArea = "ServiceArea_{0}".format(oid)
result_object = arcpy.na.MakeServiceAreaAnalysisLayer(networkDataset, serviceArea, "Driving Time", "FROM_FACILITIES", [4], None, "LOCAL_TIME_AT_LOCATIONS", "POLYGONS", "GENERALIZED", "OVERLAP", "RINGS", "100 Meters", None, None)
layer_object = result_object.getOutput(0)
except Exception as e:
print("Error creating service area: {0}".format(e))
sys.exit()
# Add Locations
try:
print("Adding locations")
arcpy.na.AddLocations(serviceArea, "Facilities", "facilities_{0}".format(oid), "Name Name #;CurbApproach # 0;Attr_Minutes # 0;Attr_Meters # 0;Attr_WeekdayFallbackTravelTime # 0;Attr_WeekendFallbackTravelTime # 0;Attr_TravelTime # 0;Breaks_Minutes # #;Breaks_Meters # #;Breaks_WeekdayFallbackTravelTime # #;Breaks_WeekendFallbackTravelTime # #;Breaks_TravelTime # #", "5000 Meters", None, "Streets SHAPE;Streets_ND_Junctions NONE", "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "5 Meters", "EXCLUDE", None)
except Exception as e:
print("Error adding locations: {0}".format(e))
# Solve
try:
print("Solving")
arcpy.na.Solve(serviceArea)
except Exception as e:
print("Error Solving: {0}".format(e))
# Get Service Area polygon layer
sublayer_names = arcpy.na.GetNAClassNames(layer_object)
serviceAreaPolygon = sublayer_names["SAPolygons"]
# Export Service Area polygon layer to feature class
arcpy.FeatureClassToFeatureClass_conversion(serviceAreaPolygon, gdb, serviceArea)
return True
except:
# Some error occurred so return False
return False
def main():
startTime = time.clock()
# Create a list of object IDs for facilities
print("Creating OID list")
descObj = arcpy.Describe(facilities)
field = descObj.OIDFieldName
idList = []
with arcpy.da.SearchCursor(facilities,[field]) as cursor:
for row in cursor:
id = row[0]
idList.append(id)
print("There are {0} facilities to process".format(str(len(idList))))
# Use partial to declare the variables for the createServiceAreas function
func = partial(createServiceAreas,facilities)
print("Sending to pool")
# declare number of cores to use, use 1 less than the max
cpuNum = multiprocessing.cpu_count() - 1
# Create the pool object
pool = multiprocessing.Pool(processes=cpuNum)
# Fire off list to worker function.
# res is a list that is created with what ever the worker function is returning
res = pool.map(func,idList)
pool.close()
pool.join()
endTime = time.clock()
elapsedTime = (endTime - startTime) / 60
print("Elapsed Time: " + str(elapsedTime))
if __name__ == '__main__':
main() Do either of you see where I may be going wrong?
... View more
03-05-2021
08:07 AM
|
0
|
0
|
15700
|
|
POST
|
Hi @MehrshadNourani2 , You may want to give the following tool a try: https://community.esri.com/t5/arcgis-online-documents/download-arcgis-online-feature-service-or-arcgis-server-feature/ta-p/919626 I've had success with this when Pro's feature class to feature class fails.
... View more
03-04-2021
06:21 AM
|
1
|
1
|
1751
|
|
DOC
|
@Anonymous Useryes, if you overwrite the layer the field that contains the URL will most likely be blank, so you will have to re-execute the tool to populate it.
... View more
03-01-2021
05:41 AM
|
0
|
0
|
19841
|
|
DOC
|
@Izzatcan you send a screen shot of where you have the get-pip.py file in File Explorer?
... View more
03-01-2021
05:38 AM
|
0
|
0
|
45857
|
|
DOC
|
@Izzattry the following to get the dateutil module: 1. Download get-pip.py to C:\Program Files\ArcGIS\Portal\framework\runtime\python 2. Open a command prompt and navigate to the above directory 3. Run the following command python get-pip.py JakeSkinner_0-1614372967849.png 4. After that installs, navigate to C:\Program Files\ArcGIS\Portal\framework\runtime\python\scripts: JakeSkinner_1-1614373025807.png 5. Run the following command pip install python-dateutil
... View more
02-26-2021
01:00 PM
|
0
|
0
|
45900
|
|
POST
|
Hi @BrittanyBurson , Would using the Attachment Viewer app provide a solution? This provides a much cleaner way to view attachments: JakeSkinner_0-1614348382736.png
... View more
02-26-2021
06:07 AM
|
0
|
1
|
2078
|
|
POST
|
Hi @CRosemaryC , Is the windows service World Wide Web Publishing Service started? JakeSkinner_0-1614348004922.png
... View more
02-26-2021
06:00 AM
|
0
|
0
|
2817
|
|
POST
|
Hi @MHahn , I would try and recreate the .properties file and then re-execute the webgisdr utility.
... View more
02-26-2021
05:19 AM
|
0
|
0
|
12650
|
|
POST
|
Hi Kelly, You can use ArcGIS Pro's Select by Attribute tool. You will select Fields and then choose the appropriate field: JakeSkinner_0-1614191050409.png
... View more
02-24-2021
10:24 AM
|
3
|
0
|
1098
|
|
POST
|
1. Where are the rasters stored? Are they on a network drive? 2. Did you specify the option to build overviews when you added the rasters? 1.5 hours seems very long if you're not building overviews. Try the following: Copy 10 rasters to a local folder Create a File Geodatabase in a local folder Create a mosaic dataset in this File Geodatabase Add the rasters to the mosaic dataset (can you post a screen shot of how you have the Add Rasters to Mosaic Dataset tool setup?)
... View more
02-24-2021
04:46 AM
|
0
|
0
|
702
|
|
POST
|
I'm not sure if the mosaic dataset's overviews will export or copy/paste from a FGD to an Enterprise GDB. When a mosaic dataset is stored in an enterprise GDB, the overviews are stored within the enterprise GDB as well. It would be best to recreated the mosaic dataset in your Enterprise GDB.
... View more
02-23-2021
07:18 AM
|
0
|
3
|
4568
|
|
POST
|
Does your mosaic dataset reside in a File Geodatabase? If it does, another folder in the directory where the FGD resides will be created with the same name as the File Geodatabase, but with the extension .Overviews. screen1.png Within this folder should be the name of the Mosaic Dataset with a .Overviews extension. Within that folder will be the TIF files: JakeSkinner_0-1614092484492.png Are these being generated?
... View more
02-23-2021
07:02 AM
|
0
|
5
|
4581
|
|
POST
|
Hi @MDB_GIS , Execute the Build Overviews tool, and this will help render the mosaic dataset faster.
... View more
02-23-2021
06:48 AM
|
0
|
7
|
4595
|
|
POST
|
You could do something like below: import requests, json
# Variables
server = 'ags.esri.com'
webAdaptor = 'server'
username = 'siteadmin'
password = '******'
featureService = 'https://ags.esri.com/server/rest/services/WellPads/FeatureServer/0/query'
# Generate Token
tokenURL = 'http://' + server + '/' + webAdaptor + '/admin/generateToken'
params = {'username': username, 'password': password, 'client': 'requestip', 'f': 'pjson'}
response = requests.post(tokenURL, data = params, verify = False)
token = response.json()['token']
# Query Feature Service
whereClause = '1=1'
params = {'where': whereClause, 'outFields': '*', 'token': token, 'f': 'json'}
response = requests.post(featureService, data = params, verify = False)
data = response.json()
... View more
02-23-2021
06:46 AM
|
0
|
1
|
4367
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 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 |
Offline
|
| Date Last Visited |
Tuesday
|