943 reputation
39
bio website
location Mankato, MN
age 27
visits member for 2 years, 2 months
seen yesterday

Nov
21
comment Converting personal geodatabase .mdb file to .gdb
You should be able to do this without any scripting. Just create a new file geodatabase, and by using ArcCatalog you can select all the feature data sets/feature classes in the personal gdb and copy and paste them into the new file gdb.
Nov
18
comment Why is the result of a raster calculation integer when it should be decimal?
It would help if you posted your Raster Calculator expression.
Nov
14
comment Measuring distance between two points?
if you have ArcInfo, you can use the Near tool. Otherwise, some basic geometry with the coordinates works too.
Nov
14
comment findAndReplaceWorkspacePaths does not work for sde files so as to change datasouce (geodatabase)
Hmm, maybe try using the path r"Database Connections\DB1.sde". This is an alias for the exact same path you are using, but maybe some stuff under the hood will validate it properly.
Nov
13
comment Is there a Python script to identify which database features are in Map/Feature Services?
I don't have any examples using xml.tree readily available, but I do know that module is pretty straightforward to use. I did edit my response to add some code for how to unzip a file. Honestly, I think the easiest way would be to just loop through the mxd that was used to create the service if you know where those are.
Nov
7
comment Problem writing list of features to text file
One thing that would also be more efficient would be to just write a new txt file instead of opening and appending the file at each iteration. You could use a with statement with the 'w' mode.
Oct
31
comment set extent for jpeg programmatically
That almost worked...Unfortunately, the returned images from the REST API do not seem to match the extent that is returned with the image. I tried to shift by the upper left corner (xMin, yMax) and it is off by about 35 meters on the y-axis.
Oct
30
comment set extent for jpeg programmatically
Yes, the coordinates come in at 0,0.
Oct
30
comment set extent for jpeg programmatically
Right, I am able to set the projection and I even tried to run the convert raster to other format tool with an output extent environment set to the extent shown in the picture above. No dice. I should also add that these services do not support rendering/raster functions so I cannot use the Clip shown here: resources.arcgis.com/en/help/arcgis-rest-api/index.html#//…
Oct
28
comment Best way to get a bounding polygon of all features in a file .gdb
No problem, saving files "in_memory" creates temporary gdb's in the RAM. It is supposed to be automatically deleted after the script runs. The help docs explain it better than I can: resources.arcgis.com/en/help/main/10.2/index.html#//…
Oct
28
comment Best way to get a bounding polygon of all features in a file .gdb
I should add the "CONVEX_HULL" geometry type can only be used at the ArcInfo license level, but using one of the rectangle options can be used at all license levels.
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".