|
POST
|
Has anyone found a working setup for script tool debugging with Pro 3.0 and VS2022? I'm following the steps from the usual guide which worked fine with Pro 2.9 and VS2019 but nothing seems to be working right now. I was able to get an exception caught at one point but I haven't been able to replicate it after a dozen attempts. I don't have VS2019 on hand so I can't test if it's just an issue with VS2022 but I'd hope the version of Pro built on the latest .NET release would also support the current Visual Studio.
... View more
08-05-2022
03:18 PM
|
1
|
1
|
1375
|
|
POST
|
"import issues and third party libraries" piques my interest. I'm pretty sure when you have both runtimes installed on your server site you have two Python installations as well. If you installed packages and .pth files to your ArcMap Python directories you'll have to do the same process to your Pro Python directory (using the 3.x version of the packages of course). If that doesn't fix it I'd give your support rep a call, these sorts of issues are hard to solve without someone poking around your server machines.
... View more
07-28-2022
09:26 AM
|
0
|
1
|
2292
|
|
POST
|
If you have a DBA they would create the view and register it with the EGDB so you can work with it in Pro. They'd presumably have the knowledge to create a table view with an extra identity field for whatever your DB provider is. This requires creating a new view in the DB but it won't interfere with important processes so they hopefully won't have any issues with your request. If both tables in your join are in the same DB, another thing you can try is creating a Query Layer. That way you can join your tables together without worrying about what Pro uses as the ObjectID.
... View more
07-28-2022
09:13 AM
|
0
|
0
|
5970
|
|
IDEA
|
Please add the ability to export toolbox parameter definitions to the format used in Python toolboxes. I'd love to migrate my tools to Python toolboxes but I'm having difficulties working with parameter definitions. Editing these items in a regular toolbox and then exporting them to Python would greatly speed up the development process when using Python toolboxes.
... View more
07-18-2022
03:31 PM
|
2
|
0
|
708
|
|
IDEA
|
This exact thing caught me by surprise when I switched over to Pro, I think a quick pass through the localization files is well worth avoiding confusion from ArcMap converts.
... View more
07-08-2022
10:51 AM
|
0
|
0
|
4489
|
|
POST
|
Is the database table the foreign table? If so you may be able to wrap it in a registered view that creates a unique ID field for you. With SQL Server the query is something like: SELECT
CAST(ROW_NUMBER() OVER (ORDER BY allRecords.[SortField]) AS int) AS [OBJECTID],
allRecords.*
FROM
[database].[user].[table] allRecords
... View more
07-07-2022
04:40 PM
|
0
|
2
|
6003
|
|
POST
|
One thing you can try is checking if the code block is causing issues. You can replace the block with this 1-line expression: "{} {}".format(!QSTRM!, !LLD!) if !LLD! is not None else !QSTRM!
... View more
07-07-2022
04:25 PM
|
1
|
1
|
2250
|
|
POST
|
It's a bit hard to diagnose this from where I'm sitting, your code looks solid overall. One thing you can do is modify the loop to print out the generated SQL clauses and see what happens if you try to set a definition query with them, then select them by location etc. etc. That way you can see where the process breaks down interactively. If everything works just fine this way then I'm not sure what the next step would be. Maybe try replacing arcpy.conversion.FeatureClassToFeatureClass with arcpy.analysis.Select?
... View more
07-07-2022
04:05 PM
|
0
|
0
|
844
|
|
IDEA
|
I'll add a "everything on screen" option to that suggestion as well, I'm sure a lot of users would be more comfortable setting the extents using the map controls instead of a vertex tool
... View more
07-07-2022
03:18 PM
|
0
|
0
|
3668
|
|
POST
|
Are you converting a text field to a long integer field? The maximum value of a long field is (2^31)-1, or 2,147,483,647, which is 9 consistent decimal digits, or 10 in some cases. To store numeric versions of larger numbers, use a "double" field, that gives you 15 consistent decimal digits with no precision loss. Here's a quick field calculator example (the long field is null because the value causes the calculation to fail due to size restrictions):
... View more
07-07-2022
02:54 PM
|
0
|
0
|
1758
|
|
POST
|
I think this is what you're looking for: ArcGIS API for Javascript - Reverse Geocode.
... View more
07-07-2022
11:07 AM
|
2
|
0
|
1558
|
|
POST
|
The good news is you've encapsulated the "add a vertex at a given distance to an existing line" code to a nice, easy to use function. You can use that in another function, maybe something like this: def densify(shp, vertex_count):
# Add 1 so the final vertex isn't coincident with the line end
stride = shp.length / (vertex_count + 1)
dist = 0.0
for _ in range(vertex_count):
dist += stride
shp = insertV(dist, shp)
return shp As an aside, I misread your function as an attempt to clip off the first portion of a line, so here's some code that does that at a bonus: def shortenLineReverse(dist, shp):
newP = shp.positionAlongLine(dist).firstPoint
arr = arcpy.Array()
arr.add(newP)
part = shp.getPart(0)
for i in range(len(part)):
p = part.getObject(i)
l = shp.measureOnLine(p)
if l > dist:
arr.add(p)
return arcpy.Polyline(arr, shp.spatialReference)
... View more
06-27-2022
10:30 AM
|
0
|
0
|
3356
|
|
POST
|
You're on the right track, all arcpy Geometry objects have a JSON property, so your line #10 should be: geom_loads = json.loads(geom.JSON) For simpler jobs you can skip JSON fiddling and use some of the properties and methods on the Geometry objects themselves, such as getPart and spatialReference. For example, here's a line of code that creates a new Polyline object from the last 2 points of another Polyline: new_geom = arcpy.Polyline(geom.getPart(-1)[0][-2:], geom.spatialReference) I highly recommend you keep the official docs on hand, there's a surprising amount of built-in methods on these objects so you can build up your own little GIS factory. Here's some key links: Geometry (this is the base class for all the other Geometry types). PointGeometry Polyline Polygon Point (this is the simple 2D/3D/4D point object that all of the other Geometries are built out of. If you want the object that you deal with from a point feature class' shape field, you want "PointGeometry"). Array (this is like a Python list but is different somehow, Polyline and Polygon objects use this class to hold the Point objects they're built from. You can use standard Python index and slice syntax to extract data).
... View more
06-24-2022
10:16 AM
|
1
|
3
|
3380
|
|
POST
|
For manual vertex fiddling a good method is to extract the geometry object for each feature like with arcpy.da.UpdateCursor(my_features, "SHAPE@") as update:
for row in update:
geom = row[0] and then dump the geometry data to JSON by combining the loads function from the standard Python json library with the geometry object's JSON property. Once you're done manipulating the dictionary you get back you can use something like new_geom = arcpy.AsShape(json_data) and throw that into your update cursor. You'll probably need a few helper functions to deal with subsets of the JSON structure so you can deserialize individual points/segments as geometry objects without losing your spatial reference info. As for your specific case, if you just need to add vertices to the lines, you can find the final two vertices in the line, construct a temporary line object from that, then call the line's positionAlongLine method with use_percentage=True to dump out new vertices that won't distort your original feature. No guarantee this'll work for complex segments but it's a starting point. Have fun!
... View more
06-23-2022
04:28 PM
|
0
|
1
|
3395
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 4 weeks ago | |
| 1 | 09-08-2023 10:07 AM | |
| 3 | 03-26-2026 08:11 AM | |
| 2 | 03-12-2026 01:41 PM | |
| 1 | 03-06-2026 08:58 AM |
| Online Status |
Online
|
| Date Last Visited |
6 hours ago
|