|
POST
|
I think all its tell you is that when they created the shapefile from whatever source database it was in, it shorted the field "stroke-Width" to "stroke-wid". It would do this because shapefile attribute names are limited to 10 characters. So if the person that sent you the file says something like "In the "stroke-width" field...." and you say "I don't have a "stroke-width" field just a "stroke-wid" field"... that confusion is averted. I doubt that it is necessary to use that file with the rest of the files that make up the shapefile. You could probably just not use that file and the shapefile would work fine. Its just there for information purposes.
... View more
04-25-2022
12:41 PM
|
1
|
0
|
1355
|
|
POST
|
I finally had a chance to circle back on this one. This code works for "O'" names but like some many have discovered before me when you are dealing with hundreds of thousands of comments and 60,000 street names and embedded organization acronyms and proper names.... there are just too many exceptions to handle. I think the solution might just be title case and call it a day. Not optimum, but trying to achieve optimum is probably wasted effort in this case. At least I got to mess around with re and lambda functions. import re
test = "RYAN O'NEAL AND JERRY O'CONNELL WERE ON CONAN O'BRIEN."
test2 = test.capitalize()
wholeExceptions = [
("jerry","Jerry"),
("ryan","Ryan"),
("conan","Conan")
]
def subsmade (instring):
#Handle exception that are whole words
for x in wholeExceptions:
if re.search(r"\b" + re.escape(x[0]) + r"\b", instring):
instring = re.sub(r'\b'+x[0]+r'\b',x[1],instring)
if re.search(r"\b"+"O'"+'[a-z]', instring, re.IGNORECASE): instring = re.sub(r"([o]['][a-zA-Z]|[O]['][a-z])", lambda p: p.group(0).upper(), instring)
return instring
print (subsmade(test2))
# prints "Ryan O'Neal and Jerry O'Connell were on Conan O'Brien."
... View more
04-25-2022
06:39 AM
|
0
|
0
|
405
|
|
POST
|
I like it. Live and learn. I didn't know data management had a pivot table tool.
... View more
04-24-2022
08:32 AM
|
1
|
0
|
1326
|
|
POST
|
I created a Feature Class in a SQL Server enterprise GDB that has this table: The SQL Select statement below will creates a table in my database called BogusStatesFormat that looks like this: Select State, [2007], [2020],([2007]-[2020]) as YearDiff
Into BogusStateFormat
from
(
Select State, MyCount, Year
FROM [TESTSTATES]
) src
pivot
(
Sum(MyCount)
for Year in ([2007],[2020])
) piv; If you don't need the final data to be a feature class your done. If you want to create a new feature class containing this data, you could use the Delete Identical tool on A COPY OF YOUR STATES FEATURE CLASS (Delete Identical modifies the input data you enter into the tool) to get just one state polygon for each state. Then you could use the state name to join the resulting new state feature class to the new table in SQL server containing your year counts and difference. Then you could export that joined feature class to a new feature class. Hope this helps. K
... View more
04-22-2022
12:29 PM
|
0
|
0
|
1362
|
|
POST
|
I have similar data in a SQL Server EGDB and when I drag the table onto my map in Pro 2.8.5 I do see the lines. I know that's not helpful, but it points to an implication that it can work and we can find a solution. If you open the table in SQL Server, what data type is your geometry being stored in? When you right click the table in your Catalog pane and click properties what does it show for Geometry Type and Storage:
... View more
04-22-2022
05:55 AM
|
1
|
0
|
1251
|
|
POST
|
I wouldn't move the points manually unless this is a one time situation and that level of accuracy is acceptable. Manually moving the the points is a time consuming workflow, especially if you have to repeat it often, and it adds error to the points. The points are probably shifted because their spatial reference differs from that of the base map. If you find out what coordinate system your points are in you can set your basemap to match it. As for connecting the points all four of the points you would want to connect to make a polygon would all need a common IDentifier to let the system know that they form a unique polygon. Each point that shares a common ID would also need a sequence number so the system would know that for this polygon it's going to connecting 1 to 2 and 2 to 3 and 3 to 4, and 4 to 1 again. without this you can get some unexpected results. If you are going to just be doing this once, and you know which points are in a polygon group, it might just be easier to define a polygon layer, turn on snapping, and draw them manually.
... View more
04-21-2022
02:41 AM
|
0
|
0
|
1391
|
|
POST
|
Could it be that someone has the CSV file open, or even may have edited it? If not I'm not sure why it doesn't work (I just tested it and it worked for me), but I have seen similar messages in the past. What might work is: 1) open the csv in excel 2) convert the columns into the data types you want (I.E. make sure number fields are formatted as numbers with the correct number of decimals). 3) Select all the rows in excel and click "Table" on the Insert tab (the selected rows will turn into alternating blue and white rows): 4) Save the Excel 5) Import the data into a file geodatabase as a table (using Table to Table tool) and try you're "relate > export" or "relate > calculate" again. You could probably skip all the Excel steps and just load your data directly into a table using Pro and Table to Table using the .csv file, but formatting the data has worked for me in the past (depending on how complex it is). I have found that ArcGIS prefers your data in a nice predictable table format, whereas .csv and Excel can be less than predictable (I.E. can be open in other programs, could have numbers and text stored in the same column, stuff like that).
... View more
04-20-2022
02:32 PM
|
0
|
0
|
4422
|
|
POST
|
Hmmm... odd. This code works in AGOL, and if I edit the Layer through a feature service in Pro (this is different test data, but the same code as I originally sent structure wise) var myid = $feature.Work_Unit_No
var mysum = 0
var myfs = filter(featuresetbyname($datastore,"TestPoints",['TestInt'],false),'Work_Unit_No = @myid')
if(!IsEmpty(myfs)){
var mysum = Round(($feature.TestInt/Sum(myfs,'TestInt'))*100,2)
}
return mysum The reason your original code returned 1 every time was because it divided any number it found by itself: $feature.FullVaccin / Sum($feature.FullVaccin) So a tweak to the original code would be to create a feature set (in my example below called myfs) and pass that into the Sum function. If I want the myfs feature set to return all the rows in the Layer's table I can just remove the filter from my original response. var myid = $feature.COJ_FacilityID
var mysum = 0
var myfs = featuresetbyname($datastore,"BogusPumps",['Integer1'],false)
if(!IsEmpty(myfs)){
var mysum = ($feature.Integer1/Sum(myfs,'Integer1'))
}
return mysum If this doesn't work, I'm afraid I'm missing something that is right in front of me, but I just can't put my finger on.
... View more
04-20-2022
01:06 PM
|
0
|
1
|
4126
|
|
POST
|
Is "FullVaccin" off the page to the left? Is the table joined with another table? If you run a calc on Percentage again, and this time just do something simple like ($feature.Calculation * 1000)/Join_Count (just using data I see in your table); it will return a useless number, but does that result also show 1 every time?
... View more
04-20-2022
11:47 AM
|
0
|
2
|
3316
|
|
POST
|
Still getting 1? That is odd... are their any nulls in your table that you have to account for or does every row contain a FulVaccin value?
... View more
04-20-2022
11:20 AM
|
0
|
1
|
3327
|
|
POST
|
If you are calc'ing into a Long also, it might not like getting numbers to the right of a decimal. Try calc'ing into Float or a Double. Since percentage is going to be a decimal number by definition it only show 0 or 1 when you calc into an integer type. if you multiple by 100 it will show an int.
... View more
04-20-2022
11:08 AM
|
0
|
3
|
3332
|
|
POST
|
Hmmm... what data type is FullVaccin? Also, are you using Field Calculator? If so, what is the data type of the field you are calculating?
... View more
04-20-2022
11:00 AM
|
0
|
5
|
3339
|
|
POST
|
Try something like this... I'm running this in field calculator and filtering on an ID, but edit at will. var myid = $feature.COJ_FacilityID
var mysum = 0
var myfs = filter(featuresetbyname($datastore,"BogusPumps",['Integer1'],false),"COJ_FacilityID = @myid")
if(!IsEmpty(myfs)){
var mysum = ($feature.Integer1/Sum(myfs,'Integer1'))
}
return mysum I ran this on the field "Float1" against this data:
... View more
04-20-2022
10:43 AM
|
0
|
7
|
3346
|
|
POST
|
Sounds like the user connection you are using to try to edit the database doesn't have permission to edit. You could try switching to a different user or granting edit permission to the current user (could also be you are trying to edit a private or ptotected version). If the database is branch versioned you need to edit through a feature service (but I think you would get a different error).
... View more
04-20-2022
03:29 AM
|
0
|
0
|
865
|
|
POST
|
If you are using a table "Joined" to the feature class the syntax is like this (I.E. $feature['tablename.attributename']: "Attribute from feature class: " + $feature['CityTestPoints.CityName'] + TextFormatting.NewLine + "Attribute from joined table: " + $feature['TestData.TestField'] gives you: Is this what you are asking about, or are you using a relationship class to associated the feature class with the related table data?
... View more
04-17-2022
01:49 PM
|
0
|
1
|
1239
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-25-2025 07:54 AM | |
| 1 | 07-25-2025 10:45 AM | |
| 1 | 05-10-2022 11:06 AM | |
| 1 | 05-09-2022 04:05 AM | |
| 1 | 03-17-2022 04:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-25-2025
07:47 AM
|