|
POST
|
@JoshuaBixby So the multiprocessing code worked for you? Would you mind posting the exact code that you ran (there is lots of code I posted in this thread so curious what exactly you ran). I'm curious what would be different that would have the multiprocessing work for GenerateTessellation. Thank you!
... View more
04-14-2022
04:51 PM
|
0
|
2
|
1359
|
|
POST
|
@Sharon_MU I should have been more specific. I only see this behavior with MapServices, not FeatureServices. So initially in Portal I would go to Add Item-->From URL, and enter in a url of a layer in a MapService (...MapServer/0). This would create the Portal item, which I can then filter and change the symbology from the visualization tab, and save as a new layer or just resave the Portal item. When adding this Portal item to ArcGIS Earth (either via the Portal item URL or just though the My Content), the full MapService layer is added, not the filtered layer I had just created. Does this make sense? Thank you!
... View more
04-14-2022
07:46 AM
|
0
|
1
|
1827
|
|
POST
|
Thanks! I wonder if they'd take on this bug. The line executes, just not when implemented with multiprocessing. Might be out of scope for them.
... View more
04-07-2022
10:03 AM
|
1
|
1
|
1381
|
|
POST
|
Thanks @ABishop I'm comfortable doing this in ModelBuilder if I needed to. My issue is I have a process I would like to automate that takes over an hour, and would like to improve the performance using the multiprocessing module in Python like I have with some other projects.
... View more
04-07-2022
05:50 AM
|
1
|
1
|
2141
|
|
POST
|
@Anonymous User Would you mind posting your code. I just upgraded to 2.9.2 and still nothing. Mine is as simple as I could make it - still no errors and no output either. import multiprocessing
from processRun import multifunction
def main():
pool = multiprocessing.Pool(processes=4)
pool.map(multifunction, range(0,1))
pool.close()
pool.join()
if __name__ == "__main__":
main() My processRun file looks like: import arcpy
def multifunction(num):
arcpy.management.GenerateTessellation("C:\\Users\\jay\\Documents\\test.shp", "-86.809667396 33.5218054870001 -86.7009855469999 33.6051117490001", "SQUARE", "900 SquareMeters", 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision') If yours is working, and I can't get it to work on my machine I'll probably just give up.
... View more
04-07-2022
05:49 AM
|
1
|
7
|
2141
|
|
POST
|
@DuncanHornby @Anonymous User @DanPatterson I changed my setup so the extent is passed in as a "Space delimited string of coordinates" per the Generate Tessellation documentation (https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/generatetesellation.htm). So at this point I'm just passing in an array with two strings to my multiprocessing pool function and no errors are thrown but the output is not created. If I replace the generate tellessation line wtih CreateFeatureclass, output is generated. I even tried hard coding the extent, hard coding the spatial reference as a string instead of an arcpy method, and nothing works. I have been getting other multiprocessing code to work too, so I think there is something in the GenerateTessellation method that is causing this (but no errors are thrown). At this point I have gone over every possible thing I could think of except reinstall Pro. If someone wants to validate they can create a function with just one line. Set your output to be some shapefile, and then run it once as a multiprocessing function. Does it create the grid? arcpy.management.GenerateTessellation(output, "-86.809667396 33.5218054870001 -86.7009855469999 33.6051117490001", "SQUARE", "900 SquareMeters", 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision')
... View more
04-06-2022
01:02 PM
|
1
|
0
|
2165
|
|
POST
|
If I comment out the GenerateTessellation line and replace it with CreateFeatureclass_management(outputDir, "{}.shp".format(apt), geometry_type="POINT", spatial_reference=SpatialReference(4326)) the multiprocessing works. I'm getting no pickling errors, but this might have to do with the Extent portion? I have no idea 😞
... View more
04-04-2022
06:54 AM
|
0
|
0
|
3383
|
|
POST
|
I have simplified everything to minimize the number of lines of code, split out my multiprocessing function into a separate file, tested without using multiprocessing, trying to catch errors, and still can't get it to work. Could this have something to do with the GenerateTessellation method? First my file containing the function to be passed into the multiprocessing Pool: def multifunction(airport):
from arcpy import GenerateTessellation_management
import os
apt = airport[0]
extent = airport[1].extent
print('Working on {}'.format(apt))
outputDir = "C:\\Jay\\data\\{}".format(apt)
os.mkdir(outputDir)
output = "C:\\Jay\\data\\{}\\{}.shp".format(apt, apt)
print(output)
try:
GenerateTessellation_management(output, Extent=extent, Shape_Type="SQUARE", Size="900 SquareMeters")
except Exception as err:
print("error", err)
return output Next the main file: import multiprocessing
import os
import time
import arcpy
from func import multifunction
startTime = time.time()
basedir = "C:\\Users\\jay\\Documents\\ArcGIS\\Projects\\DataPrep"
features = os.path.join(basedir,"features.shp")
def main():
processList = [ft for ft in arcpy.da.SearchCursor(features, ['Name', 'SHAPE@'])]
#THESE LINES DO WHAT I WANT
# for row in processList[0:10]:
# multifunction(row)
pool = multiprocessing.Pool()
pool.map(multifunction, processList[0:10])
pool.close()
pool.join()
if __name__ == "__main__":
print("Running")
main()
executionTime = (time.time() - startTime)
print('Execution time in seconds: ' + str(executionTime))
... View more
04-04-2022
06:29 AM
|
0
|
1
|
3387
|
|
POST
|
Even if I make those lines the below it still doesn't work output = "C:\\Users\\Jay\\{}.shp".format(name)
print(output)
grid = arcpy.management.GenerateTessellation(output, Extent=extent, Shape_Type="SQUARE", Size="900 SquareMeters", Spatial_Reference=arcpy.SpatialReference(4326))
... View more
04-01-2022
02:05 PM
|
0
|
0
|
3453
|
|
POST
|
Thanks for the tip - just did that, but it still didn't fix the issue.
... View more
04-01-2022
01:34 PM
|
1
|
2
|
3471
|
|
POST
|
I'm trying to implement a fairly straightforward multiprocessing script that takes every polygon in a shapefile, tessellates into a grid, takes the center points of each grid square, and then clips the points by the original feature (since the tessellation generates a minimum bounding rectangle). The tessellation feature class is never created so next step (FeatureToPoint) fails. I don't understand - can someone help? Even if I comment out all the arcpy commands except GenerateTessellation, the output is never actually created. import multiprocessing
import os
import time
import arcpy
startTime = time.time()
basedir = r"C:\Users\Jay\Documents\ArcGIS\Projects\DataPrep"
scratchGDB = 'C:\\Jay\\data\data.gdb'
output = os.path.join(basedir, "grids.gdb")
features = os.path.join(basedir,"features.shp")
def multifunction(ft):
import arcpy
name = ft[0]
extent = ft[1].extent
print('Working on {}'.format(name))
fl = arcpy.management.MakeFeatureLayer(features, "{}fl".format(name), where_clause=f"Name='{name}'")
gdb = os.path.join(basedir, "{}.gdb".format(name))
arcpy.management.CreateFileGDB(basedir, "{}.gdb".format(name))
output=os.path.join(gdb, "{}grid".format(name))
grid = arcpy.management.GenerateTessellation(output, Extent=extent, Shape_Type="SQUARE", Size="900 SquareMeters")
print('tellessation')
pointgrid = arcpy.management.FeatureToPoint(grid, os.path.join(scratchGDB, "{}pointgrid".format(apt)))
arcpy.analysis.Clip(pointgrid, fl, os.path.join(output, f"{apt}Points"))
arcpy.management.Delete(fl)
arcpy.management.Delete(grid)
arcpy.management.Delete(pointgrid)
def main():
processList = [feature for feature in arcpy.da.SearchCursor(features, ['Name', 'SHAPE@'])]
pool = multiprocessing.Pool(1)
pool.map(multifunction, processList[0:10])
pool.close()
pool.join()
if __name__ == "__main__":
print("Running")
main()
executionTime = (time.time() - startTime)
print('Execution time in seconds: ' + str(executionTime))
... View more
04-01-2022
01:12 PM
|
0
|
25
|
7044
|
|
POST
|
@DanPatterson @AndyAnderson @Sean_Wray Follow up question: if I am using high resolution terrain data (SRTM) to extract elevation values for my points as well, would it follow I should be projecting the individual tiffs to the same UTM or StatePlane projection I am using for my point feature classes before extracting elevation from the rasters?
... View more
03-31-2022
02:02 PM
|
0
|
0
|
5052
|
|
POST
|
I have an S3 bucket with over 2000 geotiffs containing elevation data (I believe it is 1arcsec SRTM), and would like to publish an elevation service to my ArcGIS Enterprise, but am unclear on the process. Do I need to mosaic all the geotiffs into one dataset and then just publish an image service, or can I just load all 2000 images into Pro and publish as is? Is there any other data prep I would need to do? I know I would need to register the S3 bucket as a cloud store to reference the images in place, but unsure on other steps and best practices. Thanks!
... View more
03-29-2022
06:46 AM
|
0
|
0
|
803
|
|
POST
|
I would like advice on how to visualize my project in 3D. I have 12 datasets which are the result of a model, each dataset represents the model output at an elevation "slice" (i.e. dataset 1 is for 0 AGL, dataset 2 is for 10 m AGL, dataset 3 is for 50 m AGL, etc. etc.). Each dataset was generated by running a model against the same 123k features (the only difference between each model run is the elevation). Each feature represents a 30m x 30m area (so yes it is a lot of data). So my model output could be 12 point feature classes (by taking the center of each square), 12 polygon feature classes, or 12 raster datasets. But what I have is 12 distinct products that I can only visualize one at a time. How can I combine these into a 3D visualization - first to visualize in ArcGIS Pro, and then if possible publish to ArcGIS Enterprise as a Scene Service or some other mechanism. Any advice would be helpful.
... View more
03-29-2022
06:09 AM
|
0
|
2
|
1302
|
|
POST
|
Thanks all - this is valuable input. I need to talk with the folks that developed the model but this is extremely helpful.
... View more
03-26-2022
07:00 AM
|
0
|
0
|
5089
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 02-23-2026 11:00 AM | |
| 1 | 07-08-2025 11:33 AM | |
| 1 | 11-07-2023 08:32 AM | |
| 2 | 10-01-2025 06:52 AM | |
| 5 | 09-08-2025 07:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|