POST
|
Yes, a custom text element (attribute expression) and the new map viewer.
... View more
11-04-2022
01:51 PM
|
0
|
0
|
1113
|
POST
|
Hi, I will flag the first response as the solution. It solved the original issue. However, I am still seeing line breaks instead of null without a line break. Some of the links I referenced in the first post talk about taking care of line breaks in HTML. Does anyone have experience with that?
... View more
11-04-2022
01:30 PM
|
0
|
2
|
1118
|
POST
|
This worked, thanks. (Where did those blank characters come from?!? 😉) Not certain how to get it to not put a line break. Can that be done in HTML formatting, as some of the above links suggest? I switched to a NULL from "none", as below. var np = $feature["New_Patien"]
return IIf(np==' ',NULL,'Phone for new patients: ' + np)
... View more
11-03-2022
02:14 PM
|
0
|
0
|
1133
|
POST
|
Hi, I've been searching around how to do this including the following: https://community.esri.com/t5/arcgis-pro-questions/arcade-labeling-based-on-null-or-not-null-values/m-p/1051904 https://community.esri.com/t5/arcgis-online-questions/arcade-cancel-new-line-in-null-field/m-p/1190256 https://community.esri.com/t5/arcgis-online-questions/prevent-fields-with-null-values-from-showing-up-in/m-p/370113 https://community.esri.com/t5/arcgis-online-documents/hide-field-in-pop-up-using-arcade/ta-p/1029496 https://community.esri.com/t5/arcgis-online-questions/one-pop-up-expression-for-multiple-attributes/m-p/333376 My attribute expression in ArcGIS Online's new map viewer is as follows var np = $feature.New_Patien
return IIf(IsEmpty(np),"none",'Phone for new patients: ' + np) However, it returns the 'Phone for new patients: ' even when the new patient phone field is empty. Any help
... View more
11-03-2022
01:01 PM
|
0
|
6
|
1161
|
POST
|
That seemed to work and took only four hours with the full dataset. I'd still like to try a dictionary to see if it goes faster, but this will be good enough for now.
... View more
07-06-2017
08:22 AM
|
0
|
3
|
412
|
POST
|
Thanks, I will try this particular code. We had gotten it to work with a SearchCursor and an SQL clause before. We have (in our particular dataset though we want it to be generic) 70,000 origins and 1,800 destinations. It was taking a long time so we were trying to do it in a dictionary per rfairhur24's suggestions.
... View more
07-03-2017
09:26 AM
|
0
|
4
|
412
|
POST
|
The table has an origin ID (OID), a destination ID (SID), and a distance between the two. I want to sort by OID then by distance, then save the first n distances for each origin ID to a table on disk.
... View more
07-03-2017
07:25 AM
|
0
|
6
|
1421
|
POST
|
We need to go the long route instead of Generate Near Table since we don't have ArcGIS Desktop Advanced. Thanks for the info about OrderedDict.
... View more
06-30-2017
03:31 PM
|
0
|
5
|
1421
|
POST
|
I'm pretty much a newbie to Python in ArcGIS. I have a table of origins and destinations and their distance. I want to be able to choose the closest n destinations for each origin and write that to a new table. I had been using cursors with SQL and OrderBy but that was taking way too long. I found Richard Fairhurst's Blog posts about using dictionaries (/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries) but I'm afraid the logic is beyond me right now. I've put the relevant piece of code below. 'neighborconstraint' is the n closest destinations that the user has specified. 'DistanceSort' is the table that we're writing to. 'Matrix' is the input table. The second table, 'NeighborLimit,' selects the nearest n distances. Any help? #Have table of Origin (BID) to Destination (SID) distances (Distance). Want to select a neighbor limit of shortest distances.
DistanceSort = "DistanceSort"
#Create empty output table, where insert cursor will put distances in ascending order, grouped by BID
arcpy.CreateTable_management(outpath, DistanceSort)
arcpy.AddField_management(outpath + DistanceSort, "BID","LONG")
arcpy.AddField_management(outpath + DistanceSort, "SID","LONG")
arcpy.AddField_management(outpath + DistanceSort, "Distance","DOUBLE")
arcpy.AddMessage("Empty distance sort table created")
#Faster to use dictionary that sorts distance in ascending order, then insert???
#Prepare insert cursor to insert BID, SID, and Distance according to to SQL clause. Inserted into the the DistanceSort table
iCursor = arcpy.da.InsertCursor(outpath + DistanceSort, ["BID","SID","Distance"])
with arcpy.da.SearchCursor(outpath + Matrix, ["BID","SID","Distance"], sql_clause=(None, 'ORDER BY BID, DISTANCE')) as cursor:
for row in cursor:
iCursor.insertRow(row)
del iCursor
arcpy.AddMessage("Insert cursor created to insert sorted distances, SID, and BID")
#Create empty output table, where insert cursor will put distances under the Neighborlimit.
arcpy.AddMessage("Calculating neighbor constraint")
NeighborLimit = "NeighborLimit"
arcpy.CreateTable_management(outpath, NeighborLimit)
arcpy.AddField_management(outpath + NeighborLimit, "BID","LONG")
arcpy.AddField_management(outpath + NeighborLimit, "SID","LONG")
arcpy.AddField_management(outpath + NeighborLimit, "Distance","DOUBLE")
arcpy.AddMessage("Empty neighborlimit table created")
BIDList = sorted({row[0] for row in cursor})
arcpy.AddMessage("sorted BID list created")
iCursor = arcpy.da.InsertCursor(outpath + NeighborLimit, ["BID","SID","Distance"])
for BID in BIDList:
expression = arcpy.AddFieldDelimiters(outpath + DistanceSort, "BID") + ' = ' + str(BID)
with arcpy.da.SearchCursor(outpath + DistanceSort, ["BID", "SID", "Distance"], where_clause=expression) as cursor: #or keep fields as ["BID","SID","Distance"]?
x = 1
for row in cursor:
if x < int(neighborconstraint) + 1:
iCursor.insertRow(row)
x = x + 1
del iCursor
... View more
06-30-2017
10:55 AM
|
0
|
15
|
2711
|
Online Status |
Offline
|
Date Last Visited |
05-15-2024
10:47 PM
|