> For the complete documentation index, see [llms.txt](https://atd-dts.gitbook.io/atd-geospatial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atd-dts.gitbook.io/atd-geospatial/signs-markings-banners/signs-gis-maintenance/attribute-rules.md).

# Attribute Rules

## Unique ID Sequence

* Every Signs GIS layer has a unique ID field that will be automatically populated by a Database Sequence.
  * Asset Locations - ASSET\_LOCATIONS\_ID
  * Asset Signs Poles - ASSET\_SIGNS\_POLES\_ID
* Attribute Rule is not Editable
* Triggers - Insert
* Execution - Exclude from application evaluation

```
Text(NextSequenceValue("ATD_ADMIN.atd_signs_data_sequence"))
```

## Intersection ID

* Only the Asset Locations GIS layer has the INTERSECTION\_ID field, which is automatically calculated based on a Thiessen Polygon layer of the COA Intersection Points layer. This layer is used to find the closest Intersection point to the new record that has been added.
* If the Intersection ID that is automatically calculated is not the Intersection ID you would like entered, the field is editable where a new Intersection ID can be entered (Editable is checked).
* Triggers - Insert
* Execution - Exclude from application evaluation

```
var intersectLayer = Intersects(FeatureSetByName($datastore, "ATD_ADMIN.COA_Intersection_Points_TP"), $feature);
for (var fc in intersectLayer) {
   return fc.INTERSECTION_ID
}
```

## Segment ID

* Only the Asset Locations GIS layer has the SEGMENT\_ID field, which is automatically calculated based on the ATD Maintained Streets Line layer.
* If the Segment ID is left null or is automatically calculated to a Segment ID that is not ideal, the field is editable where a new Segment ID can be entered (Editable is checked).
* Triggers - Insert
* Execution - Exclude from application evaluation

```
// Get closest feature - populates SEGMENT_ID field based on closest attribute

var searchDist = 1000;
var streets = Intersects(FeatureSetByName($datastore, "ATD_ADMIN.atd_maintained_streets", ['SEGMENT_ID'], true), Buffer($feature, searchDist, "feet"));
var cnt = Count(streets)
var nearestStreet;
var minDist = 250;
for (var f in streets) {
    var streetDist = Round(Distance(f, $feature, "feet"), 2);
    if (streetDist < minDist) {
       nearestStreet = f.SEGMENT_ID;
       minDist = streetDist;
    }
}
return nearestStreet;
```

## Engineering Area

* Only the Asset Locations GIS layer has the ENGINEER\_AREA field, which is automatically calculated based on the Engineering Service Areas polygon layer.
* If a feature is moved after it is created, the ENGINEER\_AREA field will automatically update.
* The ENGINEER\_AREA field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule (Editable is not checked).
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

```
var EngServAreaInt = Intersects(FeatureSetByName($datastore, "ATD_ADMIN.engineering_service_areas", ["ATD_ENGINEER_AREAS"]), $feature);
for (var fc in EngServAreaInt) {
   if (fc.ATD_ENGINEER_AREAS == 'CENTRAL') {
   return 'CENTRAL'
   }
   else if (fc.ATD_ENGINEER_AREAS == 'NORTH') {
   return 'NORTH'
   }
   else if (fc.ATD_ENGINEER_AREAS == 'SOUTH') {
   return 'SOUTH'
   }
   else {
   return ''
   }
}
if (Count(EngServAreaInt) == 0) {
return ''
}
```

## Jurisdiction

* Only the Asset Locations GIS layer has the JURISDICTION field, which is automatically calculated based on the Jurisdictions polygon layer.
* If a feature is moved after it is created, the JURISDICTION field will automatically update.
* The JURISDICTION field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule (Editable is not checked).
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

```
var JurisInt = Intersects(FeatureSetByName($datastore, "BASE_ADMIN.jurisdictions", ["JURISDICTION_TYPE_SPECIFICS"]), $feature);
for (var fc in JurisInt) {
   return fc.JURISDICTION_TYPE_SPECIFICS
}
if (Count(JurisInt) == 0) {
return ''
}
```

## Council District

* Only the Asset Locations GIS layer has the COUNCIL\_DISTRICT field, which is automatically calculated based on the Single Member Districts polygon layer.
* If a feature is moved after it is created, the COUNCIL\_DISTRICT field will automatically update.
* The COUNCIL\_DISTRICT field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule (Editable in not checked).
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

```
var CounDistInt = Intersects(FeatureSetByName($datastore, "BASE_ADMIN.single_member_districts", ["COUNCIL_DISTRICT"]), $feature);
for (var fc in CounDistInt) {
   return fc.COUNCIL_DISTRICT
}
if (Count(CounDistInt) == 0) {
return ''
}
```

## X Coordinate

* Only the Asset Locations GIS layer has the X\_COORDINATE field, which is automatically calculated based on the features location.
* If a feature is moved after it is created, the X\_COORDINATE field will automatically update.
* The X\_COORDINATE field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule (Editable is not checked).
* Coordinates calculated are based on the NAD 1983 State Plane Texas Central FIPS 4203 (US Feet) coordinate system.
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

```
Geometry($feature).x
```

## Y Coordinate

* Only the Asset Locations GIS layer has the Y\_COORDINATE field, which is automatically calculated based on the features location.
* If a feature is moved after it is created, the Y\_COORDINATE field will automatically update.
* The Y\_COORDINATE field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule (Editable is not checked).
* Coordinates calculated are based on the NAD 1983 State Plane Texas Central FIPS 4203 (US Feet) coordinate system.
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

```
Geometry($feature).y
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://atd-dts.gitbook.io/atd-geospatial/signs-markings-banners/signs-gis-maintenance/attribute-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
