POST
|
@Anonymous User Thanks for this! I ran into this same issue in a larger geoprocessing tool where I wanted to display rapid, ephemeral results and the IO expense really hurt user experience. Based on your solution I threw together a helper function that I reference in a bunch of scripts now: def memory_to_active_map(self, memory_fc):
active_map = arcpy.mp.ArcGISProject("CURRENT").activeMap
lyr_result = arcpy.MakeFeatureLayer_management(
memory_fc, arcpy.Describe(memory_fc).name)
mem_lyr = lyr_result.getOutput(0)
return active_map.addLayer(mem_lyr)[0]
... View more
01-03-2023
01:36 PM
|
3
|
0
|
243
|
IDEA
|
@JohXENIE There is a way to go smoothly from a terrain/image raster combo to a glb that Blender handles beautifully, but it involves using QGIS and the Qgis2three.js plugin. This is my current workflow but it causes me to have to maintain extra software. If you want more info just message me privately.
... View more
01-02-2023
03:31 AM
|
0
|
0
|
1707
|
IDEA
|
To flesh this out more, there ought to be a .valueAsTable property for when one wants to return the ValueTable object: parameters[0].valueAsTable # returns ValueTable
... View more
12-30-2022
01:57 PM
|
0
|
0
|
525
|
IDEA
|
Currently, the only 3D model transfer format that ArcGIS Pro supports in terms of exporting is Collada. However Collada is an older spec and not handled well by many 3D design software titles. I would like functionality to export a 3D Multipatch object from ArcGIS Pro into GLTF (ascii AND/OR binary). The general flow would be similar to arcpy.MultipatchToCollada_conversion() and could be something like arcpy.MultipatchToGLTF(output_path, output_name, prepend_source_name, format="BINARY") (or, format="ASCII") GLTF/GLB files are handled very pleasantly not only by numerous 3D design titles (e.g., Blender can open a 100mb GLTF without breaking a sweat while a 50mb Collada will bring it to its knees) but also the universal three.js framework. Please bring GLTF export support to ArcGIS Pro!
... View more
12-30-2022
11:27 AM
|
1
|
13
|
1847
|
IDEA
|
When a Parameter holds multiple values, it would be nice to be able to catch them in a simple list object instead of a String or ValueTable. For example, given: param0 = arcpy.Parameter(
displayName="Inputs",
name="inputs",
datatype="GPString",
parameterType="Required",
direction="Input",
multiValue=True) If the user inputs multiple strings like "Orange", "Apple", "Banana" the current options are parameters[0].valueAsText # "Orange;Apple;Banana" or parameters[0].value # <geoprocessing value table object> I would like to be able to return multiple values in a more idiomatic way: parameters[0].value # yields simple list: ["Orange", "Apple", "Banana"] Yes, it is easy to do parameters[0].valueAsText.split(";") or search through a value table, but both approaches are a needless complication. Getting a list directly from the Parameter seems to be the most straightforward, intuitive way to deal with multiple values.
... View more
12-29-2022
09:25 AM
|
3
|
1
|
572
|
POST
|
Here's the super duct tapey way I handle this now, by the way: import arcpy
import re
def get_wkts(self, lyr):
# This is part of a larger python toolbox class
wkts = []
with_z = r"(\d+\.\d+) (\d+.\d+) (\d+,?)"
without_z = r"(\d+.\d+) (\d+.\d+,?)"
typemap = {
"MULTILINESTRING (": ["LINESTRING", without_z, "((", "))"],
"MULTILINESTRING Z (": ["LINESTRING", with_z, "((", "))"],
"MULTIPOLYGON (": ["POLYGON", without_z, "(((", ")))"],
"MULTIPOLYGON Z (": ["POLYGON", with_z, "(((", ")))"],
"POINT (": ["POINT", without_z, "(", ")"],
"POINT Z (": ["POINT", with_z, "(", ")"]
}
with arcpy.da.SearchCursor(lyr, ["SHAPE@WKT"]) as cur:
for row in cur:
for k, v in typemap.items():
if row[0].startswith(k):
wkt_prefix = v[0]
coords = v[2] + ",".join([str(f[0] + " " + f[1]) for f in re.findall(v[1], row[0])]) + v[3]
wkts.append(wkt_prefix + coords)
return wkts
... View more
06-07-2022
11:49 AM
|
0
|
0
|
370
|
POST
|
Not sure if "what's the best way" questions are frowned on, but before I burn a bunch of cycles fixing this, I figured there might be a capability buried in ArcPy that I'm missing. I'm attempting to get WKT of what appears to be a simple line feature in ArcGIS Pro. When I use the SHAPE@WKT token to call it, it returns as MULTILINESTRING Z ((10.0 20.0 0, 11.0 21.0 0,...)) I would like to return the feature as LINESTRING((10.0 20.0,11.0 21.0,12.0 22.0,...)) as I am issuing these geometries as query criteria to various web services that are looking for simple OGC WKT. Is there preprocessing available to me to ensure the SHAPE@WKT returns as a LINESTRING or POLYGON without Z, vs. MULTILINESTRING or MULTIPOLYGON? I can brute force this with re patterns and a dictionary of replacements, but I was hoping for something slicker and more idiomatically "esri."
... View more
06-07-2022
10:43 AM
|
0
|
1
|
385
|
IDEA
|
Another vote for this; we'd like to change the HTML/CSS on the default portal page without having to create a landing page in Sites.
... View more
05-27-2022
09:21 AM
|
0
|
0
|
1468
|
IDEA
|
@ThomasCrossmanpythonnet 3.0 alpha appears to support .NET 6, so it's on the way. https://github.com/pythonnet/pythonnet/releases referencing https://github.com/pythonnet/pythonnet/pull/1620
... View more
05-21-2022
09:28 AM
|
0
|
0
|
953
|
IDEA
|
Thinking out loud here. Most Enterprise customers are likely significant: major industry players, civil government, and defense/military units. Many probably have a negotiated SLA with Esri and a dedicated account representative or team (probably former participants in that industry). That sort of level of business can (understandably) give the customer special access to submit feature requests and get priority support on bugs. Sometimes, esp depending on how the SLA is set up, it can grease the wheels to get dev/engineer time and have human-to-human conversations. My guess is that in your case, the Idea page (which takes into account community support) may not be the greatest path because while your submissions are awesome they are very esoteric. I'd further guess that out of the thousands of people browsing the Ideas page, maybe 10 fully grasp what you're proposing and out of that 10 maybe 2 are in the right place at the right time to give it an upvote. So I'd either: amplify your idea posts on some other network, build momentum among your community of practice, and get them over here to upvote your stuff, because even if Esri says that community support is "only one" variable of many, it's still a variable; and eventually when you cross some threshold they have to address it; or, Be the squeaky wheel with your account rep. They work for Esri, but they kind of work for you too. Their job is to keep you happy. Sit on desks. Physically, sometimes. Get them to get you technical meetings with the right people and be your advocate. This is what I have done in the past and it usually results in a better, faster and more tailored solution than hoping an idea takes off here.
... View more
05-21-2022
08:59 AM
|
0
|
0
|
1616
|
POST
|
I've got a point feature class that is a result of BearingDistanceToLine --> GeneratePointsAlongLines. It has generated around 150 points associated with about 400 lines. I'm attempting to go in and add curvature offsets to each point in this feature class based on its distance from its associated origin point. The easiest way for me to do this is to bundle the features by the ORIG_FID field and then sort by OID@ (first is the origin, last is the furthest distance). Similar to using a track ID in trajectory data. I'm trying to put it all in a dictionary that should look like this, and then use built in math package to do the calculations across the dictionary, and construct a new feature class (maybe faster than doing UpdateCursor). Anyway it should look like this: {1: [row, row, row, row],
2: [row, row, row, row],
....
} Here is how I'm attempting to implement, probably poorly: with arcpy.da.SearchCursor("samplepoints", ["OID@", "ORIG_FID", "curvature"]) as cursor:
uniques = sorted({row[1] for row in cursor})
c = {i: [row for row in cursor if row[1] == i] for i in uniques} This ends up creating a dictionary that does pull the unique ORIG_FID in as keys, and sets the value as a list, but adds no rows. Even though each ORIG_FID should be common to around 150 rows. Why is it not adding the rows even though row[1] should match i?
... View more
05-03-2022
08:05 AM
|
0
|
3
|
482
|
POST
|
Nice! This looks way closer to what I’m looking for. Will give it a shot and report back, thanks Dan
... View more
04-25-2022
04:37 PM
|
0
|
0
|
1082
|
POST
|
This is great but I’d like to do it in memory like with GeoPy without incurring overhead of writing feature classes to disk.
... View more
04-25-2022
04:35 PM
|
0
|
1
|
1082
|
Title | Kudos | Posted |
---|---|---|
1 | 03-04-2024 09:12 AM | |
4 | 03-06-2024 05:47 AM | |
1 | 01-31-2019 11:15 AM | |
6 | 09-15-2023 11:45 AM | |
10 | 07-31-2023 12:15 PM |