|
POST
|
"f" substitution only works in Python 3.6 and above.... might have to use an older substitution method. You could try % formatting... its an older way to do string substitution in Python.
... View more
02-14-2022
09:18 AM
|
0
|
0
|
1858
|
|
POST
|
I wrote mine in Spyder... I don't know much about PyScripter, but maybe it needs a reference to the 'os' or 'datetime' modules
... View more
02-14-2022
09:12 AM
|
0
|
0
|
1863
|
|
POST
|
When you look at the table for the output RRI_NP.shp does it include just the records you would expect (I.E. just those that match your IN ('OUT-PUGH','PAID UP') query? If so, check if the field you are symbolizing on in the TOC contains a domain. In my experience sometimes all domain values get a symbol even if they are not represented in the table. Just experimenting very quickly the only way I have found to suppress using all Domain values is if you choose "Unique Value" as your symbology type is by writing a custom Arcade script to limit it (below). But there has to be a switch somewhere. Maybe just delete the domain from the output layer.
... View more
02-14-2022
08:49 AM
|
0
|
0
|
2480
|
|
POST
|
I just ran a quick test on very simple test data. I used my simulated wetland "TestPoly1" as the Target FC and "Testpoly2" as the join layer. I used one-to-many and checked "Keep all Target Features". My result was what you want I believe....the table reflects one row for each (simulated) wetland polygon/join polygon combination. Hope this helps.
... View more
02-14-2022
04:07 AM
|
0
|
1
|
1570
|
|
POST
|
This worked for me using the rename_management function and a shapefile. It took a shapefile name Kim.shp and renamed it to append todays date... the code to create the zip file works to, but it creates a zip file that starts at the base of the path... if that makes sense.
... View more
02-13-2022
09:59 AM
|
1
|
0
|
1885
|
|
POST
|
Finally got it to work in a popup. I tried 15 ways and it finally worked when I returned a single feature and used the feature's geometry. This is code in a popup
... View more
02-11-2022
12:41 PM
|
2
|
1
|
2906
|
|
POST
|
For enterprise GDBs (at least in SQL Server in my case) this is common, but usually its not an issue, although I haven't tried Feature Class to Feature Class backup using a python script. That being said.... In Python the output name is an input into the Feature Class to Feature Class function: arcpy.conversion.FeatureClassToFeatureClass(in_features, out_path, out_name, {where_clause}, {field_mapping}, {config_keyword}) So if you have a variable something like txtInFeatures (to use as the 'in_features' in the function reference above) and its value is in the form "DatabaseName.Owner.FeatureClassName", I would use something like this to generate the txtOutName (to use as the 'out_name' in the function reference above) txtOutName = txtInFeatures[txtInFeatures.rindex('.')+1:] below is a snip of a test I ran in a python emulator. Code on the left, result on the right. Hope this helps.
... View more
02-11-2022
08:53 AM
|
1
|
1
|
1257
|
|
POST
|
I'm sure you've seen this, but just in case..... It looks like you would add a row to the "Generate ID" table: https://solutions.arcgis.com/shared/help/attribute-assistant/workflows/configure-generate-id-table/ If attribute assistant is set up on an SQL database that probably runs Create Sequence in your SQL GDB https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql?view=sql-server-ver15#:~:text=A%20sequence%20is%20a%20user,restart%20(cycle)%20when%20exhausted.
... View more
02-11-2022
05:57 AM
|
0
|
1
|
709
|
|
POST
|
I had written code that worked, but I used an array formatted like this: var myArray = ["Blue:"+$feature.Blue,"Yellow:"+$feature.Yellow...] So the array looked like this example: ["Blue:2","Yellow:5","Green:9","Orange:9","Red:8"] Using this method I had to use Left, and Right, Find, and Count functions to parse the array values, Yuck. That Decode function! Wow what a game changer! Not sure how I missed knowing about it, but that is very cool. Thanks for that.
... View more
02-10-2022
11:22 AM
|
0
|
1
|
1490
|
|
POST
|
Without knowing more all I can suggest is: 1) If you have different features selected during each run of a tool it can produce different results. Make sure you are filtering on the same records each time or clearing your selection before you run the tool. 2) Not sure I understand, but if you are running a Clip on an input feature class the Object IDs of the feature classes inputted into the Clip are not maintained, new Object IDs are generated. If you then use that as input in a Near tool the Object IDs it will reference are those of the clipped data, which would make it hard to link back to the original. Think about adding your own unique identifier to the original feature class. This value will be maintained by the clip and will link to the same feature in the original feature class. 3) If adjacent polygons intersect each other the lines returned by the Feature to Line command will be split where the polygons intersect. I hope I'm understanding correctly and that this is helpful at least in part.
... View more
02-07-2022
06:48 AM
|
0
|
0
|
839
|
|
POST
|
Unless I'm missing something it looks like your writing your six queries against the same feature class. I would use one query; something like this with your initial queries encased in parenthesis separated by "OR" statements (this example only has three queriers made into one): ((status = 1 AND height = 8.5 AND build_clas = 'C1') OR (status = 1 AND height = 9 AND build_clas = 'C2') OR (status = 2 AND height = 9.5 AND build_clas = 'C1')) Then you would have to add a column to your output table to hold the sum (Add Field) and use the Calculate Field tool to populate it. Hope I understood your question correctly and that this helps.
... View more
02-07-2022
06:11 AM
|
0
|
0
|
8933
|
|
POST
|
If the RFSTEST attribute in your table is defined as either a Float or a Double, and the precision and Scale of the Float or Double are set correctly to accommodate the pasted data then I might try changing something in Excel. If the column you are cutting out of in Excel is set to general or text you might try converting its contents to a numeric data type in Excel. Another thing I might try is converting your Excel sheet to a table in Excel. That being said I also don't copy and paste from Excel. I would would bring the Excel data into a map doc, create a join in the common key field, calc the field values over, then remove the join. That ensures the correct data goes to the correct record.
... View more
02-04-2022
12:55 AM
|
1
|
1
|
4362
|
|
POST
|
I agree with DanPatterson. I think its bailing because your asking it to iterate through strings to find "CAT" and "St" and its saying "I can't do that because this is an integer". ListFields looks like it could be useful here. The returned fields know their datatypes. https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listfields.htm
... View more
02-03-2022
03:33 PM
|
2
|
0
|
1500
|
|
POST
|
I just ran a quick test this morning. I created a very simple "Main" model and a sub-model whose only purpose is to Iterate through the database the results of the "Main" model are written to and collect their paths (if they exist). I defined the output of the "Collect Values" tool (in the sub-model) as a parameter and saved the sub-model. Then I just dragged the sub-model into the "Main" model just like any other tool. Since the sub-model doesn't require any inputs (other than knowing that the feature classes to be used as inputs into the merge have been created) I just set the feature classes that were the results of my Select statements to Preconditions that have to be met before the sub-model will run. Since I defined the output of the Collect Values tool in the sub-model to be a parameter it is shown as the output for the sub-model when it is dragged into the "Main" model. Then I just used that value as input into the merge. It worked for my very simple test, but your situation is a little more complex, but is should at least let your see how it works in one instance. Hope this helps. P.S. you might have to clean up for it between runs. For example if the first time your run it you have three inputs into the merge and it works as expected it might not work correctly the next time when you only expect 2 inputs into the merge, because the third input might still be existing in your database because you never cleared it out after the first run...Hope that makes sense.
... View more
02-03-2022
06:59 AM
|
1
|
1
|
4029
|
|
POST
|
Just to be clear in my head.... You want to convert the vertices defining your line to points and then calculate the length of the line up to that point into an M-Value field? Are you actually using linear referencing or was that just an example or are the vertices just vertices along a linear feature?
... View more
02-02-2022
02:46 PM
|
0
|
1
|
1147
|
| 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
|