|
POST
|
There's a few places where this could've gone wrong: Do your changes remain if you retrieve the map's data in the assistant after saving? (This is the "View an Item's JSON" option) When you look in the "operationalLayers" section of the JSON does the layer have an itemId as well as a url property? If there's both you may have to update the itemId as well, or remove it if the service is now coming from outside your Portal's catalog, or add if if the service is now coming from the catalog. You mentioned "WFS", was the previous service also a WFS or was it an ArcGIS Feature Service? If the service types changed you might have to make further additions to the JSON definition for that layer, I haven't used OGC services in my org so I'm not sure if the structure is different. If you get the url for that layer from the JSON and then add a new layer from that url, does it point to the correct data?
... View more
10-26-2022
01:26 PM
|
1
|
0
|
1627
|
|
POST
|
You can add any GP Tool or script tool to a model provided it has the appropriate inputs and outputs. When in doubt, just drag something onto the model canvas and see if it works out (using your test data of course).
... View more
10-17-2022
01:38 PM
|
0
|
0
|
1757
|
|
POST
|
It looks like the second "find the closest thing" loop is incomplete, you need to sort your list and return the first result like you did above.
... View more
10-17-2022
01:36 PM
|
0
|
0
|
768
|
|
POST
|
Validation Rules are your best bet here, this won't catch errors in process but you can have someone make their edits in a temporary version and then QA it before posting back. You should also double-check that these fields are non-null down to the database level, that way you avoid one source of error (although that won't stop empty strings and such)
... View more
10-17-2022
01:29 PM
|
0
|
0
|
4947
|
|
POST
|
A few people have posted suggestions, here's one that works with any number of fields and any value: def setIfFound(value, *checks):
return value if value in checks else None
... View more
10-13-2022
01:08 PM
|
2
|
1
|
2407
|
|
POST
|
Creating a spatial layer by joining features to a parent table has been a long-running deficiency in ArcGIS. The classic method to work around this is to create Query Layer or database view but this only works for EGDBs and a few other products and I assume your Survey123 data is all hosted which rules this out. The other workaround is to write a Python script that loads both tables, joins them and then outputs features to a third shadow table that you use for analysis. This prohibits real-time analysis and requires tool maintenance but it works! If there's been platform advancements to handle this use case then I haven't heard of any but that doesn't mean they aren't out there, worst case scenario you file or bump an Idea post and hope for the best.
... View more
09-29-2022
05:10 PM
|
0
|
1
|
1394
|
|
IDEA
|
Please add the ability to use an arcade expression for every map series field: name, page number, spatial reference etc. This would decrease the iteration time for map series where I'd have to copy out a layer to a geodatabase just to add and calculate map series specific fields.
... View more
09-29-2022
03:30 PM
|
13
|
7
|
3914
|
|
POST
|
I assume you're trying to clean up address data, which doesn't have a generic solution. If it's the same error over and over you can use string methods such as .index, .split, .join, slicing etc. to fix the error, here's an example that'll work for your example string: def fixAddr(x):
sNum, sData = x.split()
sDir = sData[0]
sName = sData[1:-2]
sType = sData[-2:]
return f"{sNum} {sDir} {sName} {sType}" If you want a generic method, the only technique I can think of is to run your address string through a geocoder and then pull out the component parts from the returned address. This is much more complex than just basic field calculation but it's the most bulletproof method I've found. Good luck!
... View more
09-21-2022
01:41 PM
|
0
|
0
|
1502
|
|
POST
|
Labels are locked to the feature they describe. If you want freely placeable text, you have a few options: Create a separate set of point features to hold the labels and then add them to the map with a blank symbol. These label points will work in virtually any part of an ArcGIS system but you're limited on how fancy the placement and text formatting can get Create an annotation feature class. These feature are explicitly designed to handle text and can store complex formatting rules. The catch is they don't play well with web services so unless you acquire a custom extension for annotation layers they're basically stuck in the desktop. Both maps and layouts have a layer for general graphics, such as text and images. These graphics technically aren't geospatial data and there's limits to data interoperability but if you just need a quick label for your PDF they'll do just fine.
... View more
09-21-2022
01:34 PM
|
0
|
0
|
2218
|
|
POST
|
The Pro geoprocessing system has this neat feature buried in the docs where you can create standard Python packages that contain script tools, then install those packages to your current environment with the accompanying toolbox infrastructure. More info here. The docs use a Python toolbox in their examples but there's mentions of supporting standard toolboxes as well, most notably in the introduction to the page I linked. However, when I build a package with a standard toolbox and then install it, attempting to run the tool in Pro 3.0.1 results in this error: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\JDangermont\AppData\Local\ESRI\conda\envs\testing\Lib\site-packages\foo\esri\arcpy\SampleToolbox.py", line 20, in SampleTool
raise e
File "C:\Users\JDangermont\AppData\Local\ESRI\conda\envs\testing\Lib\site-packages\foo\esri\arcpy\SampleToolbox.py", line 17, in SampleTool
retval = convertArcObjectToPythonObject(gp.SampleTool_SampleToolbox(*gp_fixargs((), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 510, in __getattr__
val = getattr(self._gp, attr)
AttributeError: Object: Tool or environment <SampleTool_SampleToolbox> not found This could be some weird misconfiguration or environment problem on my end so I've attached a little package that you can download, build, and add to your testing environment. You can build the package using the standard instructions, install it with pip, relaunch Pro and then run arcpy.SamplePythonToolbox.SampleTool() and arcpy.SampleToolbox.SampleTool() from the Python window. If the first tool succeeds but the second tool fails then it's safe to say atbx files aren't actually compatible with this packaging system. If so I hope someone from esri can dig into this as it's most likely just an issue with the autogenerated wrapper code.
... View more
09-21-2022
11:52 AM
|
0
|
0
|
641
|
|
POST
|
My general rule for writing script tools is to structure them like this: def main(param0, param1, param2):
return doSomethingWith(param0) + doOtherThingWith(param1 + param2)
if __name__ == "__main__":
param0 = arcpy.GetParameterAsText(0)
param1 = arcpy.GetParameterAsText(1)
param2 = arcpy.GetParameterAsText(2)
param3 = main(param0, param1, param2)
arcpy.SetParameterAstext(3, param3) This has two big benefits. First, you ensure all the parameters are yanked out of the aether and loaded into proper variables before you run your task. Second, you now have a main function that isn't strictly dependent on parameter state, which means you can write tests for it or call the function from other scripts without going through importing a toolbox.
... View more
09-21-2022
11:13 AM
|
1
|
0
|
3133
|
|
POST
|
If you're willing to dive into arcpy cursors and geometry objects you should be able to find a way to load in lines, generate points at set intervals along said line and then load those points into a feature class. There might be a stock geoprocessing or editing tool we're both missing but if you like solving little programming challenges this seems worth digging into.
... View more
09-15-2022
04:14 PM
|
0
|
0
|
2659
|
|
POST
|
It looks like the only exit point that can return a null value is the final return for the address itself. You can coerce a null address to your string like so: var address = closestFeatureWithDistance['feature']['Address']
return Iif(IsEmpty(address), "Not Detected", address) I think the issue is you're checking if the entire "closestFeatureWithDistance" object is null on line 33 rather than just the Address attribute.
... View more
09-15-2022
10:47 AM
|
1
|
1
|
1396
|
|
POST
|
Attribute Rules sound like the clear answer here, you can get started at this link. If your datasets need to remain accessible in ArcMap then this is off the table, 2 things you can try are: Using the new Field Maps arcade functionality to calculate the attributes client-side (link). This'll only work if your only point of entry to the data is through Field Maps. Create database triggers in your RDBMS if available. This is a very fragile process as anything that changes the underlying table structure (such as enabling versioning) will break your triggers and you may have to write some complex SQL to keep the tables in line, but this'll work across the board.
... View more
09-15-2022
10:41 AM
|
0
|
1
|
5899
|
|
POST
|
Try and reduce your workflow down to something that's easy to replicate and try to make it happen again. If you can reliably delete records just by using the join commands then you need to take this to your support contact as this could be a major regression in Pro, or at least signs that something in your environment is acting up.
... View more
09-15-2022
10:18 AM
|
1
|
0
|
3183
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | a week ago | |
| 2 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | a month ago |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|