POST
|
Hi, I have made a composite raster using single band rasters that represent the same area at different times. I need a way to transfer the timestamp to each band as I can't rely on the simple design of "Band_1, Band_2, ..." in the composite. Is there a way to do this using ArcPy? It seems like it should be necessary functionality.
... View more
09-16-2020
07:24 PM
|
0
|
0
|
331
|
POST
|
I am extracting a viewshed raster from multiple locations in a city using the Solar Radiation Graphics tool. The tool's documentation states the following: "When multiple locations are specified, the output will be a multiband raster, where each band corresponds to the viewshed for a specific location." It seems each band in the output raster doesn't have metadata linking its viewshed back to an observation point? Is it safe to assume that the sequential order of bands in the viewshed relates to the order of the input observation features? Thanks
... View more
07-29-2020
06:10 AM
|
0
|
1
|
463
|
POST
|
Hi, I'm finding that python is crashing each time I request feature classes using ArcPy when the default workspace is set to an sde connection. I have feature classes that are not within feature datasets. Currently, the only way that I am able to access these feature classes outside of the feature datasets is by using the following code: for root, dirs, datasets in arcpy.da.Walk(workspace): for ds in datasets: print(os.path.join(root, ds)) However, this returns every item in the sde which is far more than I need and when I put a datatype filter in the Walk method it crashes the program (i.e. datatype = 'FeatureClass'). ArcPy also crashes when I run arcpy.ListFeatureClasses() with the sde workspace set to default. Am I missing something obvious? Any insight would be really appreciated. Thanks
... View more
12-09-2019
03:28 PM
|
0
|
1
|
477
|
POST
|
I've been trying to come up with a workaround for this too. Obviously the shapes only align their vertices to the terrain, so elongated shapes that lie over an irregular terrain provide a poor visual. It seems like there should be a more obvious fix for this? I've used Python to script a process that breaks up the shapes (for example, parks) a certain amount of times until the subdivided shapes are small enough to dynamically fit the terrain. Finally, I align the terrain to the shapes to give it a polished finish to ensure that the terrain is always under the shapes. This seems like a lot of overhead? I would really like to hear if there are better alternatives.
... View more
10-02-2019
03:26 PM
|
0
|
0
|
371
|
POST
|
I made a solution. I missed that addAttributeLayer could perform the function. Here's a script if anyone wants to run a similar batch process. I found this necessary as my terrain files needed to be broken down to a smaller resolution. Here, I have both the texture tiles and heightmap tiles named to match and located in sub directories. from scripting import * import os # get a CityEngine instance ce = CE() # function to access the filename of a requested heightmap (.tif) def get_heightmap(file): return 'maps/<sub_directory>/' + file # function to access the filename of a requested texture (.tif) def get_texture(file): return 'maps/<sub_directory>/' + file def main(): # get a list containing all texture files (imagery) texture = os.listdir(ce.toFSPath('maps/imagery_by_grid_blocks')) # get a list of all heightmap files heightmaps_all = os.listdir(ce.toFSPath('maps/dem_by_grid_blocks')) heightmaps = [file for file in heightmaps_all if file.split('.')[1] == 'tif'] # for each image in the texture list for image in range(len(texture)): t = get_texture(texture[image]) # get the texture image file_name = texture[image].split('.')[0] # this becomes the file name # loop through heightmaps to find the respective file for heightmap in range(len(heightmaps)): #find matching heightmap and texture file if texture[image].split('.')[0] == heightmaps[heightmap].split('.')[0]: h = get_heightmap(heightmaps[heightmap]) ce.addAttributeLayer(file_name, t, h, True) print (file_name + ' has been added.') if __name__ == '__main__': main()
... View more
09-02-2019
11:10 PM
|
0
|
1
|
644
|
POST
|
Is there any terrain importing functionality offered by the CityEngine Python API? I can import both the heightmap and texture .tif files separately using the ce.importFile() method but I need to automate the process for batch imports so that each heightmap tile is draped with its respective texture file. Has anyone come across this problem? Thanks
... View more
09-02-2019
09:43 PM
|
0
|
2
|
755
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|