|
POST
|
I need to take a folder that contains multiple shapefiles and then zip them all into their own individual zip file. I found this script on a REALLY old post and it does what I'm looking for. However, I'm running into one issue. Before the zip section of the script, the python steps through several other steps of the shapefiles being exported to this location with certain criteria. So what happens is I get the shapefiles, but each shapefile contains a lock file. When the script starts for the zip, it starts to execute from top to bottom in the folder, but once it hits the first lock file it then fails. I have this in Notebook in a Pro Project. Once I close the Pro Project the lock files disappear, but as soon as I reopen the Pro Project the lock is reapplied because even though I don't have a map open, when I run my export features script it automatically adds it to the default map so it places a lock on it. Is there a way to make the below zip script ignore any lock files or release all shapefile lock files in a folder? import arcpy, os
from os import path as p
import zipfile
arcpy.overwriteOutput = True
def ZipShapes(path, out_path):
arcpy.env.workspace = path
shapes = arcpy.ListFeatureClasses()
# iterate through list of shapefiles
for shape in shapes:
name = p.splitext(shape)[0]
print (name)
zip_path = p.join(out_path, name + '.zip')
zip = zipfile.ZipFile(zip_path, 'w', compression=zipfile.ZIP_DEFLATED)
zip.write(p.join(path,shape), shape)
for f in arcpy.ListFiles('%s*' %name):
if not f.endswith('.shp'):
zip.write(p.join(path,f), f)
print ("All files written to %s" %zip_path)
zip.close()
if __name__ == '__main__':
path = r"Z:\General\Projects\Engineering\SubSurface Mapping\DataExport\Updates"
outpath = r"Z:\General\Projects\Engineering\SubSurface Mapping\DataExport\Updates\ZipFiles"
ZipShapes(path, outpath)
... View more
12-12-2024
01:30 PM
|
0
|
5
|
1401
|
|
POST
|
Thanks @MobiusSnake That worked perfectly by adding "rf" in front of all field mapping.
... View more
12-12-2024
01:10 PM
|
0
|
0
|
1040
|
|
POST
|
I'm new to Python and I'm trying to do a Export Features tool with the Field mapping only bringing over a handful of the fields. I have ran the tool and then copied the python code into a Notebook and it works. However I was trying to use variables of the location of the input and output database. With the variables the export works with the input and output features, but the field mapping doesn't and it exports ALL the fields. Is there a way when using variables it only exports only the fields I want it to export. Below are some screenshots that I have come up with. Variables: Attempt at Export Features with Variables. I tired the wODB with and without the brackets and neither worked. Working script when not using any variables.
... View more
12-10-2024
11:55 AM
|
0
|
3
|
1107
|
|
POST
|
This is the update I received on 10/24/24 on the Bug that I submitted. BUG-000169826 - Lists scroll back to the top in ArcGIS Dashboards when viewed on Android devices in mobile view. Status: Under Consideration Additional Information: Thank you for reporting this issue. We\'ve accepted the bug and are exploring solutions. No timeline set as of yet. Alternate Solution: Increase the vertical size of the list element and, if possible, toggle off the search function. This should avoid the underlying issue.
... View more
12-05-2024
09:21 AM
|
0
|
0
|
724
|
|
POST
|
@Robert_LeClair I was using the Export Features tool which only allows to export from feature class to feature class. What I found as I have been playing with it the last few days that I have been having some extreme inconsistency when running this tool. (Pro 3.2.0). One day when running it and exporting it to a new blank file geodatabase the subtypes and domains transfer over, yesterday I tried it again, the subtypes were transferring but not the domains within the subtypes and only the domains that was listed in the field properties transferred. Now today when I try it no matter the settings all subtypes and all domains are transferring. I will look into to see the 3rd party software can take shapefiles as I see now when I run the Feature Class To Shapefile tool it does add those additional fields with the domain descriptions when that field is checked.
... View more
12-03-2024
09:38 AM
|
0
|
1
|
650
|
|
POST
|
I'm trying to import feature layers from a Geodatabase that contains subtypes and domains into a third party application. However, the third party application does not recognize subtypes. This results in any field that has the domain designated via the subtype properties and not the field properties results in just the coded value of the domain and not the description in that field. At this point after much playing the only way I have figured out on how to get this to import correctly is to run the below workflow on each individual subtype: Run Export Features tool with a filter for an individual subtype. I check the Transfer Field domain descriptions to catch the domains that are set in the Field Properties are transferred through. Run Remove SubType tool and remove ALL subtypes Run Assign Domain to Field for each field that had the domain only designated via the Subtype properties. Repeat for all additional subtypes. As you could imagine this is going to be quite the process to get this all accomplished and before I go through the process and try to set up some automation with python as I will need to repeat this task periodically to push updates; I was wondering if anyone knew of any additional tools or setting that I'm missing that could combine a few of these steps or automate this better?
... View more
12-02-2024
09:45 AM
|
0
|
3
|
694
|
|
POST
|
Thanks @jcarlson & @KenBuja all the codes except for the one that had the else statement, which was the other way I tried it before posting here. I'm newer to the attribute rules and using them what is the pros/cons between the way I had it written and the way jcarlson suggested utilizing the filter and count functions? Also, I found a similar code online that someone had posted that I tweaked to get mine, they didn't have brackets and so when I copied it, I dropped the brackets too, but I had the same mind set of shouldn't this have brackets.
... View more
08-30-2024
12:44 PM
|
0
|
1
|
1372
|
|
POST
|
I have a table within my geodatabase with a list of Street IDs and Street Names. I then have a calculation rule where in my address layer I have the end user fill out the streetID and it automatically copies the Street Name out of the table and puts it in the Street Name field of the layer. This rules is then adjusted a few times in additional attribute rules to pull the street type and directional also from the table. I have this working as needed. However I wanted to add a message that pops up that when the user puts in a StreetID that doesn't exist it gives them a message instead of just doing nothing. So I added the else if statement at the end of my existing code (shown below) and now I get the error message no mater if I enter a valid ID number or Not instead of just getting it when it is not a valid ID number. var street = FeatureSetByName($datastore, 'tStreet', ['Street_ID','St_Name'],false);
var SID = $feature.St_ID;
for(var i in street)
if(i.Street_ID == SID)
return i.St_Name
else if (i.Street_ID != SID)
return {"errorMessage": "Street ID does not exist"}
... View more
08-30-2024
11:53 AM
|
0
|
8
|
1403
|
|
POST
|
Here is how we did it, our two direction fields, unit, and addNum_suf fields may or may not be Null. //Array to hold values and an index
var i = 0;
var features = [];
//Add value to array if not empty
function addvalue(feat) {
if (!IsEmpty(feat)) {
features[i++] = feat;
}
}
//Add your values
addvalue($feature.Add_Number);
addvalue($feature.AddNum_Suf);
addvalue($feature.St_PreDir);
addvalue($feature.St_Name);
addvalue($feature.St_PosType);
addvalue($feature.St_PosDir);
addvalue($feature.Unit);
//Return a concatenated string with a space between each attribute
return Concatenate(features, " ")
... View more
08-30-2024
11:43 AM
|
0
|
0
|
395
|
|
POST
|
@Baylie_Scott Thank you for the response. I have a few follow up questions. Can you expand on more on the feedback of why there is no relationship between site consideration and plans to optimize data portability. What would we be loosing if we did this? Also, what would this look like in Field Maps for adding those site considerations? Our intention is the plan polygon will be there or created through the Manager App and all the site considerations would be added in the field via Field Maps. Our initial thought that is you create an occupancy record for example you want it linked to that plan because it goes with that building. Also, looking at the preconfigured mobile map Site visit via field maps the Site Visits table is not on option to add records too. What is the intentions to leave this off. This would mainly be used for historical records, correct?. Is this intention for the manager to create that historical record or was it just omitted in the event the historical record keeping doesn't want to be kept? I don't really see it linked on any of the other viewer maps or dashboards either. Thanks for the help!
... View more
07-31-2024
10:02 AM
|
0
|
0
|
1010
|
|
POST
|
I'm starting to look into the Pre-Incident Planning Solution via ArcGIS Online and I have a question on the the relationships. It appears to me the Pre-Incident Plans (Polygons) has a Building Identifier and a Plan ID field. The Plan ID is a globalID so that is automatically being assigned and a relationship back to the site visit table. What is the Building Identifier used for, anything the fire dept. wants that they have to manually enter in? However, on all the dashboards and editing it doesn't appear this Building Identifier by default is hidden. Then on the Site Considerations, all the layers have a Plan ID field that is a String, but I'm not seeing any relationship. So what is this field used for? Is there there no relationships between the Site Considerations and the plans besides spatially next to each other?
... View more
07-30-2024
02:40 PM
|
0
|
3
|
1061
|
|
IDEA
|
It would be very handy if the filter widget would have a framework action so it can interact with other widgets and/or data that have a relationship. For example, I have a one to many relationship set up between Parks(One - Polygon) and Amenities(Many- Points). I want to utilize the filter widget to select/filter out a certain Amenity and only filter those parks that contains that amenity on the map and on a list widget. For example the end user chooses playground equipment in the filter widget. Then the Parks List Widget will filter and show ALL the parks with playground equipment. The list widgets contain a Framework Action, so the only way I can accomplish this now. Is having a Parks List, a Amenities List, and a Amenities Filter. So in order to do the above the user is required to select an amenity on the filter widget, which then filters the Amenities List (since it is the same data). The amenities lists then shows all the results of playground equipment. So there is a entry for each point, so I could have 10 playgrounds listed. Then the user has to go one by and select an individual amenity from the list to update the Parks List of that one individual Park. It is a lot of extra steps for the end user to get the Park list to update and it still doesn't give the full effect of showing ALL the parks with that particular amentity. If the Filter widget had a framework then that Park list would automatically update as soon as the filter is applied.
... View more
07-25-2024
07:20 AM
|
3
|
0
|
475
|
|
IDEA
|
Thanks @JeffreyThompson2 never thought to just click that icon next to the name!
... View more
07-17-2024
02:00 PM
|
0
|
0
|
818
|
|
IDEA
|
It would be nice to have the ability to change the widget icon in Experience Builder to make the icon more meaningful to your company. You had that ability in Web App Builder. Why not provide it here too!
... View more
07-17-2024
07:58 AM
|
2
|
5
|
860
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-20-2025 12:40 PM | |
| 2 | 10-24-2025 07:26 AM | |
| 2 | 06-10-2025 09:37 AM | |
| 1 | 05-13-2025 08:38 AM | |
| 1 | 09-14-2020 10:00 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|