|
POST
|
I would like to export a local 3D scene from ArcGIS Pro. The scene is made up of raster layers (2D) draped on custom terrain (elevation) in a local projection. My predicament is that I need to sideload the scene to ArcGIS Portal instances on two other networks where I do not have ArcGIS Pro. I know an SLPK is the way to do this, but I do not see anything that supports raster/elevation export to SLPK. So the question really is: What is the workflow for exporting full local scenes for staging to multiple Portal instances?
... View more
03-29-2022
12:18 PM
|
1
|
8
|
4465
|
|
POST
|
Thanks Don; maybe I am having trouble here but I don't see what I've done that is any different from what you've posted (except running it via script tool)... ideas?
... View more
03-28-2022
07:01 PM
|
0
|
1
|
2036
|
|
POST
|
UPDATED-- fixed the group layer reference at line 15; still doesn't work I'm attempting to follow this answer: https://community.esri.com/t5/arcgis-pro-questions/is-it-possible-to-create-a-new-group-layer-with/td-p/1068607 But it is not working for me. I have a script tool that performs various route solving problems using a defined OSRM instance. The results return fine but tend to clutter up the table of contents. My intent is to put the results of each run (lines, points) into its own group layer. I can create the group layer without issue via an empty group layer .lyrx file that will be distributed with the release. However, here's where I'm failing: # At this point I have feature classes in
# a list that I iterate over to add to the map
grplyrpath = os.path.join(Path(os.path.dirname(__file__)).parent, "res")
gprlyrfile = os.path.join(grplyrpath, "group.lyrx")
grplyr = arcpy.mp.LayerFile(grplyrfile)
osrm_group = active_map.addLayer(grplyr)[0]
osrm_group.name = f"OSRM {now}" # now is the script start-time in string
for idx, rfc in enumerate(route_fc_list):
osrm_lyr = active_map.addDataFromPath(rfc)
if idx == 0: # First route is primary/fastest route
osrm_lyr.name = "OSRM Route (Primary)"
# then do bunch of symbology
active_map.addLayerToGroup(osrm_group, osrm_lyr) this earns me an error in addLayerToGroup ValueError: <MappingLayerFileObject object at (memory address)> I've also tried directly adding the feature classes to the group layer (which would be more efficient) but that failed too. Can someone post a working example of how to prep a layer and add it into a group layer via arcpy?
... View more
03-28-2022
01:16 PM
|
0
|
3
|
2113
|
|
POST
|
Interesting! I’m away from my workstation but will give it a try tomorrow and report back.
... View more
03-22-2022
04:13 PM
|
0
|
0
|
2198
|
|
POST
|
In ArcGIS Pro (2.9), I'm doing some processing work based on a mask I derive from the active map view. The processor expects UTM-projected data. However, it might be that the user has not projected their map project to UTM, so I am trying to catch and handle that in the flow. Right now my code looks like this: d = arcpy.Describe(raster_in)
r_in_sr = d.spatialReference
# Make sure data is not unprojected or in common GCS
if r_in_sr.factoryCode in [4326, 3857, None]:
raise ProjectionException("Input data not projected. Please ensure all inputs are projected and retry.")
# Make sure the active map is set to same spatial reference as input layer
p = arcpy.mp.ArcGISProject("CURRENT")
m = p.activeMap
m.spatialReference = r_in_sr # successfully switches active map coord system!
# Now get the view extent
view_extent = p.activeView.camera.getExtent()
arcpy.AddMessage(view_extent) # Yields GCS Lat/Lons, not UTM!
extent_poly = arcpy.Polygon(
arcpy.Array(
[
view_extent.lowerLeft,
view_extent.lowerRight,
view_extent.upperRight,
view_extent.upperLeft,
view_extent.lowerLeft
]
), spatial_reference=r_in_sr
).projectAs(r_in_sr) # neither of these sr's do anything, I still get GCS lat/lons
mask = arcpy.CopyFeatures_management(extent_poly, os.path.join(scratch, "mask")) # scratch is arcpy.env.scratchGDB The interesting thing here is that if I START the process with a UTM-projected active map, the whole thing works fine. I get extent coordinates in UTM. If I start the process with a common GCS, the script does set the active map to a UTM coordinate system. But nothing I do seems to coerce the Polygon object to UTM: it still reports GCS Lat/Lon coordinates. Therefore when I call 'mask' on UTM-projected input layers, it throws an error and tells me the extent is wrong. The amusing thing is, that if I simply re-run it after that, the script starts out with the active map in the UTM projection set from the previous attempt, and runs fine. This feels like a bug, but I could definitely be doing something wrong, so I thought I'd check with the experts before I file it with our customer rep.
... View more
03-22-2022
03:03 PM
|
1
|
4
|
2255
|
|
POST
|
From what I have been able to discern, Project() does not take GPKG layers as input. Hopefully this changes in the future but at least as of early 2022 that's the situation.
... View more
03-16-2022
10:56 AM
|
1
|
0
|
13886
|
|
POST
|
Matt, it turns out it's because it's a GeoPackage layer. Apparently Project wants a feature class not a GPKG layer. Hopefully this changes at some point since GPKG is becoming a very widely used format, but at least that's the answer as of today.
... View more
03-16-2022
10:56 AM
|
0
|
0
|
13886
|
|
IDEA
|
Hi Doug, Unfortunately, no. I haven't heard anything from Esri on it. Probably what I should do is send this up via my Esri customer rep and get it put in as an enhancement request. I seem to have better luck that way. It is unclear how Esri harvests and approves ideas from these boards. Sometimes I'll see an idea with 2 votes "under review" and sometimes even implemented, while other ideas with dozens of votes go completely unaddressed.
... View more
03-01-2022
04:51 PM
|
0
|
0
|
1259
|
|
POST
|
Thanks Dan, I switched to in_memory and it worked. Hopefully that won't be deprecated any time soon (or at least not before memory supports all the same operations)!
... View more
03-01-2022
04:42 PM
|
0
|
0
|
1677
|
|
POST
|
Hi, I need to create a memory featureclass from a JSON file (Esri). My code looks like this: json_out = f"C:/Temp/feats_{datetime.strftime(now, '%Y-%m-%dT%H%M%S')}.json"
with open(json_out, 'w') as outfile:
outfile.write(str(feature_set)) # feature_set is validated Esri JSON
# The JSON file loads fine and the conversion works
# without issue in the ArcGIS Pro GUI when writing to a file geodatabase.
new_fc = arcpy.JSONToFeatures_conversion(json_out, r"memory\temp_fc") This yields arcgisscripting.ExecuteError: ERROR 000206: Cannot create FeatureClass 'memory\temp_fc'. I've tried giving it a geometry_type (unnecessary, it's EsriJSON) with no change. Ideas?
... View more
02-25-2022
02:56 PM
|
0
|
4
|
1755
|
|
IDEA
|
Great idea, I am surprised this is not already a thing
... View more
02-14-2022
06:55 AM
|
0
|
0
|
1380
|
|
POST
|
Thanks Dan, I did look up the 000210 documentation. The output is not locked. The path is not incorrect. The access is not limited. I can verify this by running other operations besides Project() and outputting it to the project geodatabase. This feels like it's a bug. I'll work through my customer account rep to get it submitted.
... View more
02-03-2022
07:12 AM
|
0
|
2
|
13957
|
|
POST
|
When I do this in python: p = arcpy.mp.ArcGISProject("CURRENT")
arcpy.env.workspace = p.defaultGeodatabase
d = p.defaultGeodatabase
arcpy.env.overwriteOutput = True
# abbreviating here - "inlyr" is a layer that has been gotten in a GetParameter() call
original_name = inlyr.name
utm_out_name = (original_name + '_UTM').replace(".","_")
utm_out = os.path.join(d, utm_out_name)
out_layer = arcpy.management.Project(inlyr, utm_out, arcpy.SpatialReference(32638)) this gives me: Traceback (most recent call last):
File "M:\Temp\arcstuff\utm.py", line 246, in <module>
out_layer = arcpy.management.Project(inlyr, out_layer, arcpy.SpatialReference(32638))
File "C:\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 13216, in Project
raise e
File "C:\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 13213, in Project
retval = convertArcObjectToPythonObject(gp.Project_management(*gp_fixargs((in_dataset, out_dataset, out_coor_system, transform_method, in_coor_system, preserve_shape, max_deviation, vertical), True)))
File "C:\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 000210: Cannot create output M:\Temp\ArcGIS\Projects\MyProject\MyProject.gdb\osm_roads_UTM
Failed to execute (Project). When I run Project() on the data directly, using the same exact parameters (not scripted), it also fails! However, when I redirect the output to a shapefile in another directory (same NAS), it succeeds. Why is this? How do I get more specific information to figure out why it is refusing to write to the default project geodatabase? I am able to create feature classes in the same .gdb (including via python) in the same session, so there is no permissions or lock issue that would seem to be at fault. Version: ArcGIS Pro 2.9 UPDATE: the input layer is from a GeoPackage. Not sure why that should matter, as it's an open/broadly compatible format.
... View more
02-02-2022
07:10 PM
|
0
|
6
|
14005
|
|
POST
|
Please, someone help me figure this out. ArcGIS Earth has a chance to finally move people away from KML, which is a little like storing your spatial data in Powerpoint. Esri could do this by supporting their excellent format for storing both vector/raster content and symbology: LAYER PACKAGES. But when you go to drop a .lpkx on ArcGIS Earth, it says "unsupported format." I'm getting close to giving up on ArcGIS Earth because years later, it is still behind the (very stale) Google Earth EC Client. It is less flexible (i.e., you can't export a straight KML file from ArcGIS Earth because ArcGIS Earth doesn't know how to reference remote icon links! It has to stash them all in a "files" subfolder and zip them into a KMZ!), and it still doesn't approach parity even in basic symbology. I just got done writing a geoprocessing tool to "Esrify" KML output from Google Earth (e.g., remap icon symbology/styles, etc) only to find for example that the icon <href> won't understand anything remote (https) or local (file:). Probably, I shouldn't have to do this anyhow. It seems to make no sense when Esri has a perfectly great storage format which could free us all from KML. So what is the deal?
... View more
01-19-2022
06:02 PM
|
1
|
1
|
1438
|
| Title | Kudos | Posted |
|---|---|---|
| 4 | 02-03-2025 01:29 PM | |
| 1 | 01-31-2019 11:15 AM | |
| 1 | 03-29-2022 12:18 PM | |
| 1 | 05-21-2024 12:32 PM | |
| 1 | 05-21-2024 01:03 PM |