1,801 reputation
314
bio website
location Mankato, MN
age 28
visits member for 2 years, 9 months
seen 15 hours ago

LinkedIn

Recently developed a python package to interact with the ArcGIS REST API


16h
comment Determining the cosine of the angles between two lines using dot product
I should clarify that gets you the angle between two points.
1d
comment Checking for overlaps using python
Are you using ArcGIS 10.0? If you are at 10.1 or beyond, I would suggest switching to the arcpy.da.SearchCursor. I have noticed geometry operations seemed a little buggy at version 10 with the old Search Cursor. It seemed like I was always getting the ever so helpful ERROR 999999.
May
19
comment Set polygon boarders to transparent in python
You cannot control the symbology explicitly with arcpy. What you can do is save a Layer File (.lyr) with that symbology and then use arcpy.management.ApplySymbologyFromLayer where you would reference your .lyr file.
May
15
comment How to edit PostgreSQL geodatabase table using ArcPy?
Thank you for posting this...This is definitely something ESRI needs to put in their documentation.
May
12
comment Unable to add attachment to ArcGIS Online feature service using Python and REST API
I agree, the help on adding attachments was not very useful. I just happened to get lucky and find the Multi-Part Encoded file help in the requests documentation. If you haven't used Fiddler, I would recommend it. Very useful for inspecting web traffic, especially when making calls with Python as there is no web interface.
May
12
comment Unable to add attachment to ArcGIS Online feature service using Python and REST API
I edited my answer to include a link to my restapi repo on GitHub. This provides a much easier interface. Once you make a reference to a FeatureLayer, you can simply pass in an OID and path to an attachment when calling the addAttachment method.
May
11
comment Efficient ways to read table data from a large feature layer?
Why not use the arcpy.da.UpdateCursor? They are pretty fast.
May
6
comment How to remove a specific unique value with arcpy
If the values are always the same, couldn't you just make a new .lyr file with the same symbology but remove the unique value of 70? Then you can use the arcpy.management.ApplySymbologyFromLayer() function to overwrite the symbology.
May
5
comment Deleting output shapefiles which have no data/features using ArcPy?
Weird try explicitly checking to see if the count is greater than 0: if int(arcpy.management.GetCount(fc).getOutput(0)) > 0:
Apr
30
comment Export geodatabase relationship to shapefile
The parameters are defined at the top of the function in the doc string. However, after seeing the post where this issue was addressed earlier, I would abandon this script. All you have to do is join your features to the related table using the "Keep only matching" option, and then use the Copy Features tool from the data management toolbox. That will automatically create duplicate features.
Apr
29
comment Export geodatabase relationship to shapefile
It works for me every time. This needs to be made into a script tool or you can run the function in the ArcMap Python window, but you need to pass in the parameters yourself. What error message do you get?
Apr
16
comment Memory issue inserting a large dataset in GDB with ArcObjects
I second what @nef001 suggested, it may help to flush the features at every n number of rows. At this years dev summit, an esri geodatabase developer suggested to flush at every 1000 features. Maybe try that instead of 2000? I would think 2000 would be a safe number though.
Apr
15
comment ArcGIS/arcpy: add field to table iteration
IMO, you should reformat your table to have each region be a separate column and have the rainfall for each be a record. It would be easier to handle 50 region fields with 50K records rather than 50K fields with only 50 records. Also, could you include your full code that shows your hh variable and loop? If you are using a DBF, you are limited to only 255 fields and even with a file geodatabase you are getting kind of close to pushing the limits of 65,534 fields. It could cause slow performance.
Apr
2
comment arcpy.da.SearchCursor ignores the where_clause parameter?
I have had this happen randomly before too. Seems like there could be some kind of bug. what is even more strange is even your if row[0] is not None: didn't properly filter the results either.
Mar
31
comment Can't retrieve data from featureLayer
Ah, yes. I think that sounds more like the culprit. It probably is not correctly initiating as a feature layer without the Feature Access Capability. We constantly get errors when publishing services as well, but sometimes it gets published correctly even when there are errors so we always verify by checking the REST endpoints after we publish a service.
Mar
30
comment Script not processing shapefiles from one folder to another
Good to know, glad I was able to help!
Mar
30
comment Can't retrieve data from featureLayer
Maybe try removing the port from the REST endpoint URL?
Mar
30
comment Script not processing shapefiles from one folder to another
No problem. Unfortunately, I cannot help you there. I am not familiar with qgis. I just noticed the issue at the end with how the output path was being constructed. Hopefully someone who is familiar with this plug in can chime in.
Mar
25
comment ArcGIS JS API: parse GP Service messages
Yeah, I am not going to go the parsing route. I don't want to expose the info messages. I am experimenting with an output parameter (arcpy.SetParameter(3, OUT_URL)) right before the script ends with the hyperlink URL.
Mar
25
comment ArcGIS JS API: parse GP Service messages
Thanks Kevin, I'll give this a try! I actually got the idea of parsing the arguments from your GP Session at the Dev Summit a few weeks ago :) Glad to know this is a better solution.