How do I add a unique ID to each feature in a layer?

There are circumstances where it is necessary to have a separate ID assigned to each feature in a layer.   Although Cartographica will display the record ID that it uses internally on the left hand side of the data viewer, that number is only guaranteed to be consistent during a single session inside of Cartographica (opening and closing the map set).

In cases where a more persistent ID is required, the easiest way to add one is to write a small script.  We're including an example here that creates a new column on the selected layer and then copies the current record ID to that column, making a persistent ID out of it.

This is a very simple script, but shows some of the power of using AppleScript with Cartographica.   It's also a good jumping off point for any script to add static or dynamic data permanently to a layer.

To use the script, just download it, open Cartographica and then the document you are working on, and then double-click on the script.   If AppleScript editor doesn't run the script immediately (or if you need to run it again), just click the Run button.

Have more questions? Submit a request

Comments

Powered by Zendesk