Use ArcPy to Connect to SDE and Versions

This post will discuss how to use ArcPy to Connect to SDE, create a new version, and switch to that version all inside a Python script. At first glance this should be pretty straight forward – provide some connection details and a version name. Well, ArcPy isn’t really designed for that approach. There currently isn’t an ArcPy function to connect to SDE within code, or to deal with new/changing versions. The current documented approach is to use Toolbox tools or create the version in advance, create a connection file pointing to a version, and use this as a reference […]

Multiple Field Key to Single Field Key for Relates using ArcPy

An issue with multi-field unique keys (composite key) is that we can’t use them to setup a join or relate between objects (Feature Classes or Tables) in ArcMap. In this article we will use Python and the ArcPy module to update a unique Multiple Field Key to Single Field Key for Relates using ArcPy.
Multiple Field Key to Single Field Key for Relates using ArcPy?
Python scripting isn’t the only way to do this as there are some OOTB tool combinations that can give us the same result. As well, there are some ArcMap/Pro tricks and database objects that can all […]

By |January 4th, 2018|Developer|Comments Off on Multiple Field Key to Single Field Key for Relates using ArcPy

ArcMap Layers to LYR Files with Python

A tiny Python script to show how to export ArcMap Layers to LYR Files with Python. Although it’s a short script, it shows how easy it is to use Python with ArcPy to jump into ArcMap layer properties. To add some variation, we will only export layers that sit at the root level of the map’s table of contents. The child layers are still exported inside their parent LYR file.
Pretty basic requirements for this task and based on using almost any version of ArcGIS 10.x (tested on 10.3.1 and 10.5). The goal is to export LYR files by looping through […]

By |October 30th, 2017|Developer|Comments Off on ArcMap Layers to LYR Files with Python

Secure Map Service to Shapefile with Python Part 3

This post is inspired by the many emails I’ve received on the first two posts in this series. This article will address the most most popular question so far: How to work with a secure map service to Shapefile. Short answer, tokens!
Before We Begin
We aren’t covering Part 1 or Part 2 again, but we will continue to build on those concepts. Secure services use the same approach as before with one additional parameter that passes a security token with each request. So once we have the token, the original posts can be used for the rest of the plumbing.
What Are […]

ArcGIS Javascript API 3.20

Phew. The long hiatus of posting updates is over. As expected, the world continued to move on without me. This includes an update to Esri’s ArcGIS Javascript API 3.20.
ArcGIS JavaScript API 3.20 is Here
Not too much in this release, although I always appreciate bug fixes! But let’s start with the unique alien updates.

Starting at ArcGIS JavaScript API 3.20 there are Planetary measurements and scale bars. You read correctly. I can’t find a reference on the ideas page to see how many up-votes this had, but I guess there must be some demand. That’s right, you can now use many […]

By |March 20th, 2017|Developer|Comments Off on ArcGIS Javascript API 3.20

ArcGIS JavaScript API 3.19

As we are all waiting in line at the mall to buy some final holiday gifts, ArcGIS JavaScript API 3.19 and 4.2 were released so we could start updating our code while sipping back some rum and eggnog (eggnog is optional).
What’s New in ArcGIS JavaScript API 3.19
A few of the bigger changes include more support for vector tiles and the additional of Arcade expression language.

Vector Tiles are now supported in all ArcGIS-supported spatial references. This addition will help more of us get starting using the vector tile approach as it seems to be the future of basemaps. One downside – you […]

By |December 22nd, 2016|Developer|Comments Off on ArcGIS JavaScript API 3.19

Map Service to Shapefile with Python Part 2 – Iteration

This post builds on the previous “Extract a Map Service Layer to Shapefile using Python” post. It seems as though many are interested in getting past the pesky limits ArcGIS Server has on querying/extracting data to a shapefile. The initial post does mention this limitation, which is typically 1000 or 5000 features by default depending on the version (and configurable by admins). Part 2 will focus on getting past that limitation to all the juicy goodness… errr, all the data.

Note 2016-10-31: Sample code updated to sort objectIDs before creating groups.
Before We Begin
It might be a good idea to refresh on the details of part 1 as […]

By |September 29th, 2016|Developer|2 Comments

ArcGIS JavaScript API 3.18

ArcGIS JavaScript API 3.18 was released by Esri last week. Great news for those still using the 3 series – and FYI, ArcGIS JavaScript API 4.1 was also release last week.
What’s New in ArcGIS JavaScript API 3.18
The biggest update in ArcGIS JavaScript API 3.18 looks to be an overhaul of the FeatureTable Widget. There are lots of new and improved features, including the long anticipated support for related records. Selection behaviour in the table has been improved, but if you have been leveraging this in the past you might want to test first, as there are some major changes here.

Another big update […]

By |September 26th, 2016|Developer|Comments Off on ArcGIS JavaScript API 3.18

Use Bootstrap to Customize Esri’s JavaScript InfoWindow Icons

I was recently working a small web mapping application and wanted to use Bootstrap to customize Esri’s JavaScript InfoWindow icons to match the style of the application. If you were unaware, this usually involves finding the sprite (image) file and making modifications or creating a new sprite. In this case, I was already using Bootstrap, so I wanted to use Glyphicons instead.

If you are interested in using the sprite approach, or just want to change the popup look/feel, there is a great blog article for your reference on Making Your Pop-up Pop.
Use Bootstrap to Customize Esri’s JavaScript InfoWindow Icons
This […]

By |July 2nd, 2016|Developer|Comments Off on Use Bootstrap to Customize Esri’s JavaScript InfoWindow Icons

Extract a Map Service Layer to Shapefile using Python

How easy/hard is it to extract a Map Service layer to Shapefile using Python? Not as hard as you would think. Is it legal? Not as easy as you would think! And before I get into this any further, there are also ways of doing this directly in ArcMap – but that wouldn’t be very Pythonic now would it.

UPDATE: Part 2 is now available – Map Service to Shapefile with Python Part 2 – Iteration
Legal Schmegal (and a brief disclaimer)
I’m not a lawyer – but I have watched many TV shows where someone else played one. Oh, and I’ve actually […]

By |March 28th, 2016|Developer|Comments Off on Extract a Map Service Layer to Shapefile using Python