Reputation
4,326
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
4 19
Newest
 python
Impact
~59k people reached

21h
comment Delete table rows in non-spatial database using arcpy
You don't need to specify a rowid column. As mentioned by both @Vince and @Stephen Lead, you should connect to the database table via pyodbc and execute this statement DELETE * FROM table_name; to delete all rows.
Apr
23
comment Any suggestions for offline maps for Windows laptops?
Have you looked into the ArcGIS Runtime SDK for WPF? It supports offline editing.
Apr
20
comment Using Editor tools in Arcpy script
Yep, that wouldn't be hard to work in, the above is just demonstrating a simple geometry merge. If the user is just adding some values, at each iteration in the top loop (not the parts), they could append the values to a list and run a sum().
Apr
14
comment Spatial Reference not working with If-Else
it needs to be srcDesc.spatialReference.Name with the "S" being lowercase as it is a class property.
Apr
8
comment Public transport offline routing
I just added an answer that has some links. I hope it helps.
Apr
7
comment Public transport offline routing
Ah, I missed that detail when I read your post. You can do this with public transport routing, you would just need to build the network yourself. In the sample I posted, Esri has created a network for the streets of San Francisco and published it as a tile package.
Apr
7
comment Public transport offline routing
Yes, I would recommend having a look at the ArcGIS Runtime SDK for iOS, it supports fully offline routing and geocoding. Here is a sample from their GitHub page. They have samples in both Swift and Objective-C.
Apr
5
comment How can I change number format and alias in javascript API legend?
I think if you set the labels up for the symbology of the feature class within the MXD you are publishing from, that should automatically carry over to the JS API for the Legend.
Apr
1
comment Fiona: get each feature extent (bounds)
+1, this is brilliantly efficient.
Apr
1
comment How can I change number format and alias in javascript API legend?
You'll have to stop the Service and then you can use either Alter Field or you can do this in the Feature Class properties in the Fields tab.
Mar
28
comment Can a tab masquerade as a space in a unicode string?
That makes sense. The problem was you were referencing the whole row object, which is either a list or tuple that gets returned from the cursor. To set individual field values, you need to reference that value by the index that matches the field.
Mar
24
comment Fill in NoData gaps in raster using ArcGIS for Desktop?
you could set an environment to clip to the extent of the original raster. Assuming in_raster is a Raster object, you can do this before executing the line above: arcpy.env.extent = in_raster.extent and it should clip it to the original extent.
Mar
23
comment Loop over pixel data using Python in ArcMap
Have you looked into converting the raster into numpy arrays?
Mar
22
comment ArcGIS 10.2 Custom Tool Sort Drop-Down-List by another field of table
I'm not sure I understand how you want to order the drop down. Can you edit your question to show what the code field looks like? The way you are setting down your drop down will always be an unordered list because you are getting the unique values by casting to a set.
Mar
17
comment Wrap text element labels
@Midavalo beat me to it :)
Mar
17
comment Wrap text element labels
No, 15 is the max amount of characters per line. You can set this to whatever you need. This number will vary based on your font size. I'd check out the documentation. There are also options for breaking long words with hyphens and other things.
Mar
4
comment Use arcpy to Import Symbology instead of Apply Symbology?
For that case, using arcpy will always work well. You will only need ArcObjects when the field names don't match since there is no option to choose a target field in the Apply Symbology tool or if you need to change symbology types. I have been frustrated for a long time that GP tool doesn't let you pick a target field name so I will probably invest some more time to make the ArcObjects solution work with other symbology types.
Mar
4
comment Use arcpy to Import Symbology instead of Apply Symbology?
I have added an ArcObjects Python sample. So far this only has support for Class Breaks Symbology, but it wouldn't be too difficult to do Unique Values or other ones as well.
Mar
4
comment Use arcpy to Import Symbology instead of Apply Symbology?
This cannot be done with arcpy. To truly replicate the import button, you would have to use ArcObjects, which is possible with Python. This post is a good start. Also, it is worth noting that if the only problem you are seeing from ApplySymbologyFromLayer is different class breaks, you can use arcpy to to adjust these after you apply the symbology.
Mar
2
comment Enabling or disabling WMS capabilities with python
@Dan, see my edit # 2. I just pushed some new changes to the repo on GitHub to include functionality shown above. This should greatly simplify editing extension settings and service properties in general.