> 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/markings-gis-maintenance/attribute-rules.md).

# Attribute Rules

## Unique ID Sequence

* Every Markings GIS layer has a unique ID field that will be automatically populated by a Database Sequence&#x20;
  * Markings Specialty Point - MARKINGS\_SPECIALTY\_POINT\_ID
  * Markings Specialty Line - MARKINGS\_SPECIALTY\_LINE\_ID
  * Markings Short Line - MARKINGS\_SHORT\_LINE\_ID
  * Markings Long Line - MARKINGS\_LONG\_LINE\_ID
* Attribute Rule is not Editable
* Triggers - Insert
* Execution - Exclude from application evaluation

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

## Intersection ID

* Every Markings 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.
* 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

* Every Markings 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.
* 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;
```

## CBD - Central Business District

* All Markings GIS layers except Markings Long Line have a CBD field, which is automatically calculated based on the DAPCZ Polygon Layer. If the feature intersects with the Central Sector of the DAPCZ layer, the CBD field is coded to Yes, otherwise No.
* If a feature is moved after it is created, the CBD field will automatically update.
* The CBD field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule.
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

```
var DapczInt = Intersects(FeatureSetByName($datastore, "ATD_ADMIN.dapcz", ["DAPCZ_SECTOR"]), $feature);
for (var fc in DapczInt) {
   if (fc.DAPCZ_SECTOR == 'Central') {
   return 'Y'
   }
   else {
   return 'N'
   }
}
if (Count(DapczInt) == 0) {
return 'N'
}
```

## Signal Intersection

* All Markings GIS layers except Markings Long Line have a SIGNAL\_INTERSECTION field, which is automatically calculated based on a 100' Buffer Polygon layer of the Street Signals and Pedestrian Signals Point layer (Signals turned on only). If the feature intersects with the 100' Buffer Polygon layer, the SIGNAL\_INTERSECTION field is coded to Yes, otherwise No.
* If a feature is moved after it is created, the SIGNAL\_INTERSECTION field will automatically update.
* The SIGNAL\_INTERSECTION field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule.
* Triggers - Insert, Update
* Execution - Exclude application evaluation

```
var fcSignalBuffer = FeatureSetByName($datastore, "Signals_Turned_On_100ft_Buffer", ["OBJECTID"]);
var fcSignalBufferInt = Intersects(fcSignalBuffer, $feature);
var SignalBuffer = First(fcSignalBufferInt);

if (SignalBuffer == null) {
return "N"
}
else
return "Y";
```

## School

* All Markings GIS layers except Markings Long Line have a SCHOOL field, which is automatically calculated based on a 1/4 mile Buffer of the Schools layer located on MAINT. If the feature intersects the layer on creation, the SCHOOL field is calculated to Yes, otherwise No.
* If there are other stipulations for changing the value, the field is editable and can be changed.
* Triggers - Insert
* Execution - Exclude application evaluation

```
var fcSchoolBuffer = FeatureSetByName($datastore, "Schools_1_4_Mile_Buffer", ["OBJECTID"]);
var fcSchoolBufferInt = Intersects(fcSchoolBuffer, $feature);
var SchoolBuffer = First(fcSchoolBufferInt);

if (SchoolBuffer == null) {
return "N"
}
else
return "Y"

// This Rule will be modified after there is a good School Zone Beacons layer.
```

## Bike - Specialty Line

* The BIKE field in the Markings Specialty Line Layer is automatically calculated based on the SPECIALTY\_LINE\_TYPE field in the same layer.
* If the SPECIALTY\_LINE\_TYPE field is edited after it is created, the BIKE field will be updated depending on the change made.
* The BIKE field is not manually editable. If the SPECIALTY\_LINE\_TYPE field is changed by accident, the BIKE field will automatically update based on the Attribute Rule.
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

```
if ($feature.SPECIALTY_LINE_TYPE == 'DELINEATORS') {
return 'Y'
}
else if ($feature.SPECIALTY_LINE_TYPE == 'CONCRETE_DOMES') {
return 'Y'
}
else {
return 'N' }
```

## Bike - Specialty Point

* The BIKE field in the Markings Specialty Point Layer is automatically calculated based on the SPECIALTY\_POINT\_TYPE and SPECIALTY\_POINT\_SUB\_TYPE fields.
* Since there are 6 different Subtypes, 6 separate rules had to be created to correctly calculate the BIKE field depending on which Specialty Point Type is chosen.
* If the SPECIALTY\_POINT\_TYPE or SPECIALTY\_POINT\_SUB\_TYPE fields are edited after the record is created, the BIKE field will be updated depending on the change made.
* The BIKE field is not manually editable. If either the SPECIALTY\_POINT\_TYPE or SPECIALTY\_POINT\_SUB\_TYPE fields are changed by accident, the BIKE field will automatically update based on the Attribute Rules.
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

| Specialty Point Type | Description              |
| -------------------- | ------------------------ |
| 1                    | Word                     |
| 2                    | Arrow                    |
| 3                    | Symbol                   |
| 4                    | Parking                  |
| 5                    | Other                    |
| 6                    | Raised Pavement Markings |

### Word

* Attribute Rule Subtype: Word

| Specialty Point Subtype for BIKE - Word | Description |
| --------------------------------------- | ----------- |
| 14                                      | Bike (word) |

```
if ($feature.SPECIALTY_POINT_SUB_TYPE == 14) {
return 'Y'
}
else {
return 'N'
}
```

### Arrow

* Attribute Rule Subtype: Arrow

| Specialty Point Subtype for BIKE - Arrow | Description |
| ---------------------------------------- | ----------- |
| 11                                       | Bike Arrow  |

```
if ($feature.SPECIALTY_POINT_SUB_TYPE == 11) {
return 'Y'
}
else {
return 'N'
}
```

### Symbol

* Attribute Rule Subtype: Symbol

| Specialty Point Subtype for BIKE - Symbol | Description    |
| ----------------------------------------- | -------------- |
| 1                                         | Bicycle (Bike) |
| 3                                         | Bicyclist      |
| 5                                         | Chevron        |

```
if ($feature.SPECIALTY_POINT_SUB_TYPE == 1) {
return 'Y'
}
else if ($feature.SPECIALTY_POINT_SUB_TYPE == 3) {
return 'Y'
}
else if ($feature.SPECIALTY_POINT_SUB_TYPE == 5) {
return 'Y'
}
else {
return 'N'
}
```

### Other

* Attribute Rule Subtype: Other

| Specialty Point Subtype for BIKE - Other | Description      |
| ---------------------------------------- | ---------------- |
| 1                                        | Green pad        |
| 2                                        | Green launch pad |

```
if ($feature.SPECIALTY_POINT_SUB_TYPE == 1) {
return 'Y'
}
else if ($feature.SPECIALTY_POINT_SUB_TYPE == 2) {
return 'Y'
}
else {
return 'N'
}
```

### Parking

* Attribute Rule Subtype: Parking

| Specialty Point Subtype for BIKE - Parking | Description |
| ------------------------------------------ | ----------- |
| 7                                          | Bicycle     |

```
if ($feature.SPECIALTY_POINT_SUB_TYPE == 7) {
return 'Y'
}
else {
return 'N'
}
```

### Raised Pavement Markings

* Attribute Rule Subtype: Raised Pavement Markings

| Specialty Point Subtype for BIKE - Raised Pavement Markings | Description |
| ----------------------------------------------------------- | ----------- |
| None                                                        | None        |

```
if ($feature.SPECIALTY_POINT_TYPE == 6) {
return 'N'
}
```

## Other Area

* All Markings GIS layers except the Markings Long Line layer have an OTHER\_AREA field, which is automatically calculated based on specific fields depending on the layer.
* If any changes are made to any of the fields that affect the OTHER\_AREA field, it will automatically update as well.
* The OTHER\_AREA field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule.
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

### Short Line

* The OTHER\_AREA field is calculated based on the CBD, SIGNAL\_INTERSECTION, and SCHOOL fields.
* If CBD, SIGNAL\_INTERSECTION, or SCHOOL fields are coded to Yes, then OTHER\_AREA will automatically be coded to No. If all are No, then OTHER\_AREA will be coded to Yes.

```
if ($feature.CBD == 'Y') {
return 'N'
}
else if ($feature.SIGNAL_INTERSECTION == 'Y') {
return 'N'
}
else if ($feature.SCHOOL == 'Y') {
return 'N'
}
else {
return 'Y'
}
```

### Specialty Line / Point

* The OTHER\_AREA field is calculated based on the CBD, SIGNAL\_INTERSECTION, and BIKE fields.
* If CBD, SIGNAL\_INTERSECTION, or BIKE fields are coded to Yes, then OTHER\_AREA will automatically be coded to No. If all are No, then OTHER\_AREA will be coded to Yes.

```
if ($feature.CBD == 'Y') {
return 'N'
}
else if ($feature.SIGNAL_INTERSECTION == 'Y') {
return 'N'
}
else if ($feature.BIKE == 'Y') {
return 'N'
}
else {
return 'Y'
}
```

## Crew Assigned

* All Markings GIS layers except the Markings Long Line layer have a CREW\_ASSIGNED field, which is automatically calculated based on specific fields depending on the layer.
* If any changes are made to any of the fields that affect the CREW\_ASSIGNED field, it will automatically update as well.
* The CREW\_ASSIGNED field is not manually editable. If the field is changed by accident, it will default back based on the Attribute Rule.
* The CREW\_ASSIGNED field is calculated by the following hierarchy:
  * CBD
  * SIGNAL\_INTERSECTION
  * SCHOOL or BIKE
  * OTHER\_AREA
* Triggers - Insert, Update
* Execution - Exclude from application evaluation

### Short Line

* The CREW\_ASSIGNED field is calculated based on the CBD, SIGNAL\_INTERSECTION, SCHOOL, and OTHER\_AREA fields. The hierarchy for which the CREW\_ASSIGNED field is coded is listed above.

```
if ($feature.CBD == 'Y') {
return 'CBD'
}
else if ($feature.SIGNAL_INTERSECTION == 'Y') {
return 'SIGNAL'
}
else if ($feature.SCHOOL == 'Y') {
return 'SCHOOL'
}
else if ($feature.OTHER_AREA == 'Y') {
return 'OTHER'
}
else {
return $feature.CREW_ASSIGNED
}
```

### Specialty Line / Point

* The CREW\_ASSIGNED field is calculated based on the CBD, SIGNAL\_INTERSECTION, BIKE, and OTHER\_AREA fields. The hierarchy for which the CREW\_ASSIGNED field is coded is listed above.

```
if ($feature.CBD == 'Y') {
return 'CBD'
}
else if ($feature.SIGNAL_INTERSECTION == 'Y') {
return 'SIGNAL'
}
else if ($feature.BIKE == 'Y') {
return 'BIKE'
}
else if ($feature.OTHER_AREA == 'Y') {
return 'OTHER'
}
else {
return $feature.CREW_ASSIGNED
}
```

## School Name

* Only the Markings Short Line layer has a SCHOOLNAME field, which is automatically calculated based on a 1/4 mile Buffer of the Schools layer located on MAINT. If the feature intersects the layer on creation, the SCHOOLNAME field is calculated based on the SCHOOL\_NAME field in the 1/4 mile Buffer of the Schools layer.
* If there are other stipulations for changing the value, the field is editable and can be changed.
* Triggers - Insert
* Execution - Exclude application evaluation

```
var fcSchool = Intersects(FeatureSetByName($datastore, "ATD_ADMIN.Schools_1_4_Mile_Buffer", ["SCHOOL_NAME"]), $feature);
var fcSchoolFirst = First(fcSchool);

if (fcSchoolFirst == null) {
return ""
}
else
return fcSchoolFirst.SCHOOL_NAME
```

## High Injury Network

* All layers except the Markings Long Line layer have a HIN field, which is automatically calculated based on the High Injury Network Combined layer located in MAINT. If the feature is within a specified buffer distance, the HIN field is calculated to Yes, otherwise No.
* Since each buffer is not perfect for calculating 100% of the features, the field is editable and can be changed.
* Triggers - Insert
* Execution - Exclude application evaluation

### Short Line

* The Short Line buffer is large as all features located at an intersection where one or both streets are on the High Injury Network are calculated to Yes on the HIN field

```
var HinIntLayer = Intersects(FeatureSetByName($datastore, "ATD_ADMIN.High_Injury_Network_Combined", ['OBJECTID'], true), Buffer($feature, 100, 'feet'));
var HinInt = First(HinIntLayer);

if (HinInt == null) {
return "N"
}
else
return "Y";
```

### Specialty Line / Point

* The attribute rule for calculating the HIN field for Specialty Line and Point is identical

```
var HinIntLayer = Intersects(FeatureSetByName($datastore, "ATD_ADMIN.High_Injury_Network_Combined", ['OBJECTID'], true), Buffer($feature, 50, 'feet'));
var HinInt = First(HinIntLayer)

if (HinInt == null) {
return "N"
}
else
return "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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
