788 reputation
38
bio website
location Mankato, MN
age 27
visits member for 2 years, 1 month
seen yesterday

Oct
13
comment ArcGIS Python Add-In: Enable snapping for OnLine method?
Ok. That's what I figured. Thanks Jason.
Oct
9
comment How to Determine if Layer is a Point
Same here, although I have never done this in a .pyt, just in normal script tools. I assume it behaves the same though.
Oct
8
comment Calculate Date Field - today's date from datetime.date.today
That is completely understandable. I too feared the cursors when I was first getting started with Python. However, as you get more comfortable with Python, I think you will find the cursors are much more flexible. Also, as I mentioned in my original answer, the cursors have much better performance. At the county I used to work for, a GIS consultant had written a script for a very long process that used the field calculator many times and this took over 2 hours to run. When I got better with Python, I rewrote the script and used cursors instead of the field calc and it ran in under 15 min.
Oct
6
comment Is there a public API that can be accessed with Python and will geocode Points of Interests?
This is pretty cool, I just found a free python api for geocoding and reverse geocoding addresses. Take a look at this page, it should do what you want. I tested with a couple hospital names and it returned coordinates. It uses the google maps Geocoder: code.xster.net/pygeocoder/wiki/Home
Sep
17
comment How I can reverse numbers in a string without reversing any text?
Thanks @mnpeterson...I decided to add an edited version that will ensure that the groups of numbers would be split properly. The way I had it before, all the numbers would have been strung together into one even they were separated in the original text. Props to artwork21 as well.
Sep
17
comment How I can reverse numbers in a string without reversing any text?
wow, we posted almost the exact same answer!
Sep
16
comment georeference a grid by using a script
Can you provide more details? How are the coordinates stored?
Sep
15
comment Is the MakeFeatureLayer temporary location the same as “in_memory”?
@PolyGeo Thanks for the suggestion. I added a screenshot of the code I ran. The copySchema is a custom function that just creates a new fc with the schema of another fc. I had never seen this behavior before, but it seems to only yield the full path to the temp directory when it is referenced by the layer from the TOC, otherwise I get an error that says the in memory fc doesn't exist.
Sep
13
comment Is the MakeFeatureLayer temporary location the same as “in_memory”?
@PolyGeo I have not tested in stand alone, but I was able to return that full path to the in_memory location when ran in ArcMap's python window. That was using version 10.2.2. I was surprised though, I expected the return to be "in_memory\test".
Sep
11
comment Python loop with address locator
Wow, that is funny. I cannot believe that worked. I'm glad you're up and running now.
Sep
11
comment Python loop with address locator
I am not sure why you are getting that error, especially after it completes a few iterations of the loop. Are the few outputs that do get created correct? Maybe you could add a time.sleep(5) after the geocode. Not sure if that would help or not but could be worth a try.
Sep
9
comment List layer names from Map service using python
Hmm, that is strange. I would maybe throw a try/except block in for the list layers part under the if name == 'main'. None is returned if there are no layers in the map service (or perhaps if there is an error). It may be be better to change the default return to an empty list [] so that it is still an iterable and will not bomb out.
Sep
9
comment List layer names from Map service using python
The above code is in Python and requests is a module. All you need to do is download the requests module. There is an install executable from the unofficial binary python packages web page. This will automatically put the requests module in your PYTHONPATH. lfd.uci.edu/~gohlke/pythonlibs
Aug
7
comment Build Network Dataset with python comtypes
Wow, that should have been obvious! I guess I need more coffee. Thanks!
Jul
31
comment Python comtypes and ArcObjects: Snippets GetApp() fails at 10.2
I just wanted to provide an update...I am running 10.2 on a VM using VMWARE and have 10.0 installed on my regular machine. A coworker who is running 10.2.1 as his primary was able to use my code and he did not have any errors. This is either an issue with my VM or the install on my VM.
Jul
31
comment Python comtypes and ArcObjects: Snippets GetApp() fails at 10.2
Unfortunately none of the suggestions in that thread resolved the issue. I have not seen where anyone else has received the same Windows Error I am getting. It doesn't tell me what class is not registered either. I'm not sure what is going on here.
Jul
31
comment Python comtypes and ArcObjects: Snippets GetApp() fails at 10.2
Yes, the GetApp() function is exactly the same as the script in that link you provided and POINTER(BSTR): VT_BYREF|VT_BSTR is in the dictionary in my automation.py module. I am not sure what is causing the problem.
Jul
30
comment Adding a graphic line element to open mxd using python comtypes to access ArcObjects
And if I could bug you one more time, for some reason the pElement.Name property is not being set. I just looked back in the help docs and I see why...That is because apparently I made that up because it has no "Name" property. Any ideas on how to name an element? Or just what interface I'd do that in? I could probably figure it out from there. Once I have the element named, I can get at it with arcpy mapping. Edit - Nevermind, got it! Found the IElementProperties interface! I'm loving the power of ArcObjects...Now I just need to learn C# or VB :)
Jul
30
comment Adding a graphic line element to open mxd using python comtypes to access ArcObjects
Thanks!!! Using IPolyline did it with setting the FromPoint and ToPoint!!! I should have been using IPolyline this whole time I guess. Thanks for the help!
Jul
30
comment Adding a graphic line element to open mxd using python comtypes to access ArcObjects
It is very possible I'm going about this the wrong way. While I am comfortable with Python, I am very new to ArcObjects so I should probably mention I do not really know what I'm doing. The structure of Classes, CoClasses and Interfaces is confusing me.