|
POST
|
I'm trying to call the updateFeature() method on a FeatureLayer (Esri Leflet v2.2.3 and Leaflet JS v1.3.1). Although the operation is actually successful, I'm getting this console error:
FeatureLayer.js:156 Uncaught TypeError: Cannot read property 'removeLayer' of undefined
at e.removeLayers (FeatureLayer.js:156)
at e.<anonymous> (FeatureManager.js:531)
at e.<anonymous> (FeatureLayerService.js:54)
at e.<anonymous> (Service.js:98)
at XMLHttpRequest.s.onreadystatechange (Request.js:75)
The biggest problem with this is that this error isn't allowing me to resolve or reject the Promise because nothing comes back for error or response in the callback. Any thoughts on what is causing this or how I can work around it?
... View more
03-18-2020
11:01 AM
|
0
|
1
|
1307
|
|
POST
|
The suggestions from Jeff Kling are effective but be careful catching and passing on a wide range of errors because you'll never know if there's a different problem you actually need to address.
... View more
03-18-2020
08:16 AM
|
1
|
0
|
4998
|
|
POST
|
On Windows 10 with ArcGIS 10.5.1, run from VS Code --- import arcpy overhead: 0:00:02.766314
=== Total Elapsed Time: 0:00:02.768425
... View more
03-05-2020
02:17 PM
|
0
|
1
|
2595
|
|
POST
|
You want to copy the value from the source if it's different than the destination value? How many rows are you working with? If it's a reasonable amount of data (less than 10000 maybe) I would just update everything no matter the value. If you always want the destination to match the source, just truncate and append everything. If you can't do that, just join the two and field calc the destination field to equal the source field.
... View more
03-04-2020
12:19 PM
|
0
|
1
|
3109
|
|
POST
|
Have you tried making a copy of the feature class to use in the spatial join instead of using the same input feature class twice?
... View more
02-26-2020
01:10 PM
|
0
|
1
|
1384
|
|
POST
|
Here's an article that goes a little more in-depth on how to save the files so they can be imported. https://stackabuse.com/python-modules-creating-importing-and-sharing/#usingamodule
... View more
02-26-2020
08:54 AM
|
1
|
0
|
1882
|
|
POST
|
You can indeed create your own modules and import them just like you do with the built-in modules. Python Modules: Learn to Create and Import Custom and Built-in Modules The location of the file needs to be in the module search path if the computer's Python environment.
... View more
02-26-2020
07:55 AM
|
1
|
2
|
1882
|
|
POST
|
Could you post a sample (or representation) of your data? Also, if all you want is a count of distinct values in a field, have you considered using the Frequency tool?
... View more
02-26-2020
07:51 AM
|
0
|
3
|
1384
|
|
POST
|
Try using SetLogHistory() at the beginning of the script arcpy.SetLogHistory(False)
... View more
02-26-2020
07:48 AM
|
1
|
0
|
1144
|
|
POST
|
Dan Patterson Has an interesting solution here. You can also check out this solution for rotating polygons as it should be the same. Here's another discussion That might be helpful. In short, there doesn't appear to be a single tool that will rotate a vector feature. Another discussion proposed converting the feature to a raster and using the Rotate tool, then converting back to a vector shape but I you'd lose precision along the way.
... View more
02-24-2020
02:24 PM
|
1
|
1
|
5608
|
|
POST
|
Dan Patterson recently created a poll on this topic and there's a lot of great information in the comments.
... View more
01-30-2020
09:19 AM
|
0
|
0
|
8983
|
|
POST
|
Multiline strings with the triple quotes is a common method for this type of thing. Typically, triple double quotes """content""" is used for docstrings that describe the use of functions so I use triple single quotes '''contnent''' Alternatively, you could use join and format string methods with a list of field names. fields = ["one", "two", "three", "four"]
sql = "select {} from table_name".format(",".join(fields)) Going one step further, you can dynamically get the list of fields with arcpy.ListFields() fields = [f.name for f in arcpy.ListFields(r"path\to\my\data")]
sql = "select {} from table_name".format(",".join(fields))
... View more
01-30-2020
07:30 AM
|
0
|
0
|
13519
|
|
POST
|
Applying this logic to your code would be something like this. import arcpy
arcpy.env.workspace = r"C:\Users\paperspace\Google Drive\QTA\19010_PDX Zoning\PDXZoning\PDX_Kerns.gdb"
fieldNames = ['TLID', 'RNO']
find_string = "-STR"
with arcpy.da.SearchCursor("taxlots_Kerns", fieldNames) as tlidList:
for tlid, rno in tlidList:
if find_string in tlid:
print(tlid)
... View more
01-15-2020
03:57 PM
|
0
|
0
|
1487
|
|
POST
|
The slowness is not coming from your logic but rather the time it takes for ArcPy to "open" each MXD and look at all the data sources. If you have any missing data sources, that will cause the MXD to open more slowly. Also, if there are just a lot of layers from many different sources, that will also cause it to open slowly.
... View more
01-10-2020
07:34 AM
|
0
|
2
|
2741
|
|
POST
|
The parameter dir2 is in refers to the expression of the calculate field. In other words, Work_order = expression Refer to the documentation for more information. If you just want it to write a hard-coded string, you have to format it with an extra set of quotes like arcpy.CalculateField_management(fc, "Work_order", "'dir2'", "PYTHON_9.3") That will just write the string dir2 in the Work_order field of every affected record. If, however, you want to write the value of the variable dir2, then you should be able to just remove all the quotes. arcpy.CalculateField_management(fc, "Work_order", dir2, "PYTHON_9.3") Just ensure that the value of the dir2 variable matches the datatype of the Work_order field. In your case, I see you're defining dir2 as a string "Vista_" + dir_list2 so it should work. Also, I noticed you are importing string, shutil, and sys but I don't see them actually used anywhere. You should keep that clean and remove imported libraries you don't use. I also recommend being consistent and using all Python or all VB for your calculate field expression type. Python is the more supported language so stick with PYTHON_9.3 So if you want to calculate the current date/time in your Date_time field (assuming the field is actually a date data type), you should import datetime library and then change line 66 to be arcpy.CalculateField_management(fc, "Date_time", datetime.datetime.now(), "PYTHON_9.3")
... View more
01-10-2020
07:07 AM
|
1
|
1
|
3005
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month 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 |