|
POST
|
The <= and >= you used in your original code should work for querying a date range. Just get rid of all trailing spaces.
... View more
08-10-2021
11:41 AM
|
0
|
4
|
5259
|
|
POST
|
For your text based where clauses, you'll need single quotes around the text value. For example: Material_where_Clause = "Material = '{}'".format(Material) The date expressions are failing because you have a trailing space. INSTALLATIONDATE = datetime.strptime("1935-01-01", "%Y-%m-%d")
... View more
08-10-2021
09:34 AM
|
0
|
6
|
5268
|
|
POST
|
Maybe checkboxes would work better than a dropdown. <div class="checkboxContainer">
<input type="checkbox" id="online" name="online">
<label for="online">Online</label> <br />
<input type="checkbox" id="poweredOff" name="poweredOff">
<label for="poweredOff">Powered Off</label> <br />
<input type="checkbox" id="linkDown" name="linkDown">
<label for="linkDown">Link Down</label> <br />
<input type="checkbox" id="gemPacketLoss" name="gemPacketLoss">
<label for="gemPacketLoss">GEM Packet Loss</label> <br />
<input type="checkbox" id="lowOpticalPower" name="lowOpticalPower">
<label for="lowOpticalPower">Low Optical Power</label> <br />
</div> If you have a big list of options, you can make it scrollable. .checkboxContainer {
border:2px solid #ccc;
width:200px;
height: 100px;
overflow-y: scroll;
}
... View more
08-10-2021
07:29 AM
|
0
|
3
|
3834
|
|
POST
|
I also came up with a script that will delete unused domains. It should be a good starting point for doing the other things you mentioned. Delete Unused Domains - Esri Community
... View more
08-09-2021
07:52 AM
|
0
|
0
|
2851
|
|
DOC
|
@JesseHandler We had a similar issue that was caused by running the script as a different user. The issue was caused by the licensing of ArcGIS Pro being saved in a user's profile and the user running the script had not opened ArcGIS Pro and set the licensing.
... View more
08-06-2021
08:29 AM
|
0
|
0
|
68032
|
|
POST
|
What about using enumerate() to get sequential numbers in a loop. for enum, cable in enumerate(myValues):
arcpy.management.SelectLayerByAttribute(fiber, "NEW_SELECTION", f"cable_name = '{cable}'", None)
arcpy.management.CalculateField(
in_table=fiber,
field="SegmentID",
expression=enum,
expression_type="PYTHON3"
)
... View more
07-19-2021
03:04 PM
|
2
|
0
|
3503
|
|
POST
|
It's hard to get the full picture of what's happening with this screenshot. It would help if you could post the raw text of a few rows (with header row). From what I can see here, column A is your "Id" field? Is there a variable number of point coordinate columns? Also, I see you're creating a "SHAPE@" field in the shapefile. That's not how that's intended to work. It's what's called a field token. It's not a field name that actually exists. InsertCursor—ArcMap | Documentation (arcgis.com) Here's some updated code but I'm not certain it will solve your problem. import csv
import arcpy
import traceback
#Create Polygon layer from csv table
csvfile = r'C:\Geography\Spatial Python\final\Final_Ex\Buildings_alternative_2.csv'
outpath = r'C:\geography\Spatial Python\final'
outshp = 'test.shp'
try:
outshp = arcpy.CreateFeatureclass_management(
outpath, outshp, geometry_type='POLYGON',
spatial_reference=arcpy.SpatialReference(4326)
)
arcpy.AddField_management (outshp, 'Id', "TEXT")
arcpy.AddField_management (outshp, 'Floor_area', "DOUBLE")
with open(csvfile, "r") as csv_reader:
with arcpy.da.InsertCursor(outshp, ["Id", "Floor_area", 'SHAPE@']) as cur:
for csv_line in csv_reader:
polygon_points = []
for point in line[1:]:
x, y = point.split(",")
point_geometry = arcpy.Point(x, y)
polygon_points.append(point_geometry)
polygon_geometry = arcpy.Polygon(arcpy.Array(polygon_points))
polygon_geometry_sqft = polygon_geometry.getArea(units="SQUAREFEET")
cur.insertRow((csv_line[0], polygon_geometry_sqft, polygon_geometry))
except:
traceback.print_exc() Try grabbing a single row of point coordinates from your CSV and hard coding them into your script (no CSV looping). Use those values to try inserting a single record into the shapefile. Start small to troubleshoot.
... View more
07-14-2021
10:51 AM
|
1
|
1
|
2198
|
|
POST
|
Your fc path includes the feature dataset but when you use os.path.dirname() it steps up to the feature dataset. You need to use the geodatabase as your workspace for Editor, not the feature dataset. Try something like this workspace = r"C:\Users\***\AppData\Roaming\ESRI\Desktop10.8\ArcCatalog\***_***_***.sde"
fc = os.path.join(geodatabase, "***.***.TEST", "C***.***.Test")
edit = arcpy.da.Editor(workspace)
... View more
07-14-2021
09:39 AM
|
0
|
3
|
5898
|
|
POST
|
If you add SHAPE@ to the InsertCursor, you'll also need to include a value for that when you call insertRow(). Line 13 should be cur.insertRow((csv_line[0], polygon_geometry_sqft, polygon_geometry)) As for the TypeError: Invalid geometry type for method, make sure the points in your CSV make a valid polygon. Alternatively, just leave out Floor_area completely, then calculate that field after you've inserted all the new features.
... View more
07-14-2021
09:06 AM
|
0
|
0
|
3871
|
|
POST
|
Checking the console log, you are getting errors in the geometry engine, which would only be in your createBuffer() function. In there, you have a schoolPoints parameter that you need to use in geodesicBuffer(). However, there are a couple places you call createBuffer without any arguments; lines 142 and 245.
... View more
07-14-2021
07:57 AM
|
1
|
0
|
7262
|
|
POST
|
First, I recommend using a with statement for opening files and cursors so they get closed automatically when exiting (with or without an error). Second, it looks like you're trying to insert a row with polygon geometry (shape) without specifying a shape field when you open the cursor. If Floor_area is just that, a double field representing the area measurement of a polygon, that's what you need to insert. try:
cnt = 0
with open(file, "r") as csv_reader:
with arcpy.da.InsertCursor(outshp, ["Id", "Floor_area"]) as cur:
for csv_line in csv_reader:
polygon_points = []
for point in line[1:]:
x, y = point.split(",")
point_geometry = arcpy.Point(x, y)
polygon_points.append(point_geometry)
polygon_geometry = arcpy.Polygon(arcpy.Array(polygon_points))
polygon_geometry_sqft = polygon_geometry.getArea(units="SQUAREFEET")
cur.insertRow((csv_line[0], polygon_geometry_sqft))
cnt += 1
except:
traceback.print_exc() If you do want to insert the polygon shape, you'll need to include "SHAPE@" in the fields and add the polygon_geometry into the values for insertRow().
... View more
07-14-2021
07:39 AM
|
0
|
2
|
3889
|
|
POST
|
There's a lot going on here that needs to be addressed. From my first pass, here are some basic issues I noticed. You reference a variable "SchoolsTypeSelect" that does not exist. Probably should be SchoolTypeSelect var schoolTypeSelect = document.getElementById("TypeOfEs_1"); There is no element with an id = "TypeOfEs_1" The URL defined for BrownfieldsUrl is incomplete. Maybe it should be https://services3.arcgis.com/htbSquWCstgNlzeK/ArcGIS/rest/services/Brownfield_master_layer_v2_LivClip/FeatureServer/0 I'll take another look if you're able to resolve those issues.
... View more
07-13-2021
10:08 AM
|
0
|
3
|
7289
|
|
POST
|
@RPGIS wrote: I still don't fully understand some of the intricacies of python and so I am still learning what is possible and what isn't. Me too! By the time you think you're sitting pretty, something new comes out and changes your entire perspective and methodology. You'll always be learning new ways to do things, no matter what level you're at. Keep at it!
... View more
07-09-2021
01:58 PM
|
0
|
0
|
3091
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |