|
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
|
2708
|
|
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
|
1149
|
|
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
|
3091
|
|
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
|
3091
|
|
POST
|
Sorry! I don’t mean GeoPy is janky only the dependency management inside a Python toolbox for ArcGIS Pro is janky with any third party dependency. I’d like to avoid the Bearing Distance to Line tool because it is IO bound (needs output to disk) and I don’t need lines and all the overhead, just points derived within memory space.
... View more
04-25-2022
04:33 PM
|
0
|
2
|
3091
|
|
POST
|
Maybe a little long but how's this def compare_vertices(linea, lineb):
matches = []
for i_idx, a in enumerate(linea):
for b_idx, b in enumerate(lineb):
if [a[0], a[1]] == [b[0], b[1]]:
if a[2] - b[2] > 0:
zdiff = a[2] - b[2]
else:
zdiff = b[2] - a[2]
matches.append({
"Point A": {
"XYZ": a,
"Index": a_idx,
},
"Point B": {
"XYZ": b,
"Index": b_idx,
},
"Z diff": zdiff
})
return matches
road1 = [(1, 2, 3), (3, 4, 5), (4, 6, 8)]
road2 = [(3, 4, 6), (1, 2, 4), (4, 5, 3)]
x = compare_vertices(road1, road2)
for i in x:
print(i)
{'Point A': {'XYZ': (1, 2, 3), 'Index': 0}, 'Point B': {'XYZ': (1, 2, 4), 'Index': 1}, 'Z diff': 1}
{'Point A': {'XYZ': (3, 4, 5), 'Index': 1}, 'Point B': {'XYZ': (3, 4, 6), 'Index': 0}, 'Z diff': 1} I only enumerated to know where the points are that match in the array, and returned as a dict because I'm fussy like that and want more info than less usually
... View more
04-25-2022
02:11 PM
|
1
|
1
|
1466
|
|
POST
|
I'm porting a tool from R to be run in a managed ArcGIS Pro instance (no access to R). In the script, destination points are calculated from a known origin based on bearing and distance. The script relies on the geosphere destPoint() method to do it, and is invoked like this: x = destPoint(origin, bearing, distance) x is a location object with .latitude and .longitude properties that return as floats for use in further processing. This seems like a super straightforward geometric problem but I am struggling to find how to use ArcPy to accomplish it. For initial testing purposes I gave up and just pip installed GeoPy, using geopy.distance.distance(unit=distance).destination((origin.Y, origin.X), bearing) and it works beautifully but I do not like delivering stuff with janky 3rd party dependencies. How do I do this in ArcPy without re-writing half of GeoPy?
... View more
04-25-2022
01:36 PM
|
0
|
9
|
3149
|
|
POST
|
Yeah, been trying this with zero success in ArcGIS Pro. I think I'll have to use gdal in this case, convert the jpg to a tiff, and issue the tie points in memory (ArcGIS wants a text file/csv). More straightforward. Thankfully since Pro's default python ships with gdal now, I can offer it to users with no dependency friction.
... View more
04-13-2022
02:15 PM
|
1
|
0
|
1189
|
|
POST
|
I am working with a library of overhead images accessible via simple REST endpoint. The workflow I'd like to have is that a user can query this library by their current ArcGIS Pro, active map view extent. That part works fine and I generate a series of polygon footprints onto the map. However, there's a small overview image associated with each record that I'd like to pull in and display on the map, doing a simple 4-corner georeferencing of the overview JPG with its corresponding polygon. However searches for georeferencing via arcpy aren't turning up a lot. How should I go about displaying these overview images on the map?
... View more
04-13-2022
11:21 AM
|
0
|
2
|
1218
|
|
IDEA
|
Yes! And you may want to amend this idea to have Enterprise support mixed geometry WFS, where one WFS layer can contain different geometric primitives. To my knowledge, nothing supports mixed geometry streams “out of the box”, even though it’s in WFS spec.
... View more
03-31-2022
05:20 AM
|
0
|
0
|
871
|
|
POST
|
So, it looks like this is not possible. You cannot side-load a MSPK to Portal in a way that allows you to then Publish it and have services for each layer created. So, this is kind of disappointing because as you know, we work across multiple networks that do not talk to each other. On some of those networks, we do not have ArcGIS license servers or access/ability to install ArcGIS Pro -- but there are Portals there, and we need to be able to somehow portable-ize, freeze, whatever word you want to use, a 3D scene of diverse content (custom elevation sources, 2D raster/vector, 3D multipatch) so that we can load it to a Portal instance where we lack publish-from-ArcGIS Pro ability. Also, complicating this, the scene in question is a Local Scene (UTM projection) which can't be viewed in ArcGIS Earth anyway. I understand this is an edge case, so I'll try and work this through our customer rep / solution engineers.
... View more
03-30-2022
07:47 AM
|
0
|
0
|
4404
|
|
POST
|
Hey Robert! Good to hear from you. This is a fairly large project and the idea is to side-load it to a Portal instance so that we can take advantage of the performance that server-side caching will provide. The only issue is that I cannot go directly from Pro to the Portal. I have to be able to (either) add it as a valid new item in my Portal content management section, or add it directly to the federated/hosted server via the traditional ArcGIS Server Manager (e.g., service definition file(s)). I'm going to try the mobile package approach in the meantime.
... View more
03-29-2022
03:15 PM
|
0
|
2
|
4418
|
|
POST
|
Hi Andrew, Nope, the workflow is to save the web scene to a flat file (slpk) for side-loading to portal on a network where I do not have ArcGIS Pro available to do the loading. Hope this helps.
... View more
03-29-2022
01:27 PM
|
0
|
0
|
4431
|
| 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 |