{ "layers": [ { "currentVersion": 11.1, "cimVersion": "3.1.0", "id": 1, "name": "Leak Status", "type": "Feature Layer", "description": "", "geometryType": "esriGeometryPolyline", "sourceSpatialReference": { "wkid": null, "xyTolerance": 1.0E-6, "zTolerance": 0.001, "mTolerance": 0.001, "falseX": -4.50359960495E7, "falseY": -4.50359960495E7, "xyUnits": 10000000, "falseZ": -100000, "zUnits": 10000, "falseM": -100000, "mUnits": 10000 }, "copyrightText": "", "parentLayer": null, "subLayers": [], "minScale": 0, "maxScale": 0, "referenceScale": 0.0, "drawingInfo": { "renderer": { "type": "uniqueValue", "valueExpression": "//playground test variables. Use $feature. notation when implementing\n\n// var to test if inspection exists\nvar ParentGUID = $feature.ParentGUID // null = no inspection exists, otherwise an inspection exist and proceed to check next conditions\n\n//vars to test if leak is probable and if inspection is stale based on install year\nvar Leak_Status = $feature.Leak_Status // 'Probable Leak' -> RED, 'Inconclusive' -> YELLOW\n\n// vars to test if inspection is stale\nvar Install_Year = Date(Number($feature.INSTALL_YR), 0, 1) // pipe install year - this will determine the staling rate for inspections\nvar inspection_date = $feature.created_date //e.g. test value: Date(2019,3,5) - inspection year. month integer ranges from 0-11, which is not intuitive. 0 is January. adjust date in statement as required\nvar todays_date = Date() // current year\nvar inspection_age = DateDiff(todays_date, inspection_date, 'years')\nvar pipe_age = DateDiff(todays_date, Install_Year, 'years')\n\n//compare the inspection year to the current year and return true (stale) if difference is greater or equal to 5 years (pipes aged 0-10 years), 3 years (pipes aged 10-35 years), or 1 year (pipes older than 35 years)\nvar stale_inspection = false\nif (pipe_age <= 10){\n if (inspection_age >= 5){\n var stale_inspection = true}\n}\nif (pipe_age > 10 && pipe_age <= 35){\n if (inspection_age >= 3){\n var stale_inspection = true}\n}\nif (pipe_age > 35){\n if (inspection_age >= 1){\n var stale_inspection = true}\n}\n\n//check if main should be flagged as red (leak probable)\nvar RED_check = false\nif (Leak_Status == \"Probable Leak\"){\n var RED_check = true}\n\nvar YELLOW_check = false\nif (Leak_Status == \"Inconclusive\"){\n var YELLOW_check = true}\n\nWhen(RED_check, \"Probable Leak\",\nYELLOW_check, \"Inconclusive\",\nIsEmpty(ParentGUID) || stale_inspection, \"Inspection Not Started/Stale\",\n\"No Probable Leak\") //last argument is default value if no expression/result pair evaluates to true", "valueExpressionTitle": "Custom", "defaultSymbol": { "type": "esriSLS", "style": "esriSLSSolid", "color": [ 170, 255, 0, 255 ], "width": 2.6 }, "defaultLabel": "No Probable Leak", "uniqueValueInfos": [ { "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "color": [ 255, 0, 0, 255 ], "width": 2.6 }, "value": "Probable Leak", "label": "Probable Leak" }, { "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "color": [ 255, 255, 0, 255 ], "width": 2.6 }, "value": "Inconclusive", "label": "Inconclusive" }, { "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "color": [ 108, 171, 231, 255 ], "width": 2.6 }, "value": "Inspection Not Started/Stale", "label": "Inspection Not Started/Stale" } ], "fieldDelimiter": ",", "authoringInfo": { "colorRamp": { "type": "multipart", "colorRamps": [ { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 215, 232, 252, 255 ], "toColor": [ 215, 232, 252, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 222, 252, 179, 255 ], "toColor": [ 222, 252, 179, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 252, 182, 244, 255 ], "toColor": [ 252, 182, 244, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 252, 188, 179, 255 ], "toColor": [ 252, 188, 179, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 184, 185, 252, 255 ], "toColor": [ 184, 185, 252, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 179, 252, 223, 255 ], "toColor": [ 179, 252, 223, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 252, 237, 212, 255 ], "toColor": [ 252, 237, 212, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 252, 207, 232, 255 ], "toColor": [ 252, 207, 232, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 252, 245, 179, 255 ], "toColor": [ 252, 245, 179, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 230, 252, 212, 255 ], "toColor": [ 230, 252, 212, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 184, 248, 252, 255 ], "toColor": [ 184, 248, 252, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 182, 211, 252, 255 ], "toColor": [ 182, 211, 252, 255 ] }, { "type": "algorithmic", "algorithm": "esriCIELabAlgorithm", "fromColor": [ 226, 207, 252, 255 ], "toColor": [ 226, 207, 252, 255 ] } ] } } }, "scaleSymbols": true, "transparency": 0, "labelingInfo": [ { "labelExpressionInfo": { "expression": "$feature.ASSET_ID", "title": "Custom" }, "labelPlacement": "esriServerLinePlacementAboveAlong", "textLayout": "followFeature", "deconflictionStrategy": "dynamic", "allowOverrun": true, "repeatLabel": false, "lineConnection": "minimizeLabels", "stackLabel": false, "removeDuplicates": "none", "useCodedValues": true, "maxScale": 0, "minScale": 1600, "name": "Class 1", "priority": -1, "symbol": { "type": "esriTS", "color": [ 0, 112, 255, 255 ], "backgroundColor": null, "borderLineColor": null, "borderLineSize": null, "verticalAlignment": "bottom", "horizontalAlignment": "left", "rightToLeft": false, "angle": 0, "xoffset": 0, "yoffset": 0, "kerning": true, "haloColor": [ 255, 255, 255, 255 ], "haloSize": 1, "font": { "family": "Fieldwork Geo Regular", "size": 9, "style": "normal", "weight": "normal", "decoration": "none" } } } ] }, "defaultVisibility": true, "extent": { "xmin": -4.50359960495E7, "ymin": -4.50359960495E7, "xmax": 8.55683929424599E8, "ymax": 8.55683929424599E8, "spatialReference": { "wkid": 102187, "latestWkid": 3776, "xyTolerance": 0.001, "zTolerance": 0.001, "mTolerance": 0.001, "falseX": -5622600, "falseY": -10001100, "xyUnits": 10000, "falseZ": -100000, "zUnits": 10000, "falseM": -100000, "mUnits": 10000 } }, "hasAttachments": false, "htmlPopupType": "esriServerHTMLPopupTypeAsHTMLText", "displayField": "ASSET_ID", "typeIdField": null, "subtypeFieldName": null, "subtypeField": null, "defaultSubtypeCode": null, "fields": [ { "name": "GlobalID", "type": "esriFieldTypeGUID", "alias": "GlobalID", "length": 38, "domain": null }, { "name": "OBJECTID", "type": "esriFieldTypeInteger", "alias": "OBJECTID", "domain": null }, { "name": "ASSET_ID", "type": "esriFieldTypeString", "alias": "ASSET_ID", "length": 16, "domain": null }, { "name": "Status", "type": "esriFieldTypeString", "alias": "Status", "length": 8, "domain": null }, { "name": "INSTALL_YR", "type": "esriFieldTypeDouble", "alias": "INSTALL_YR", "domain": null }, { "name": "MATERIAL", "type": "esriFieldTypeString", "alias": "MATERIAL", "length": 10, "domain": null }, { "name": "DMTR_MM", "type": "esriFieldTypeDouble", "alias": "DMTR_MM", "domain": null }, { "name": "FAC", "type": "esriFieldTypeString", "alias": "FAC", "length": 6, "domain": null }, { "name": "SHAPE", "type": "esriFieldTypeGeometry", "alias": "SHAPE", "domain": null }, { "name": "ParentGUID", "type": "esriFieldTypeGUID", "alias": "ParentGUID", "length": 38, "domain": null }, { "name": "Operator", "type": "esriFieldTypeString", "alias": "Operator", "length": 100, "domain": null }, { "name": "Leak_Status", "type": "esriFieldTypeString", "alias": "Leak_Status", "length": 200, "domain": null }, { "name": "Comments", "type": "esriFieldTypeString", "alias": "Comments", "length": 400, "domain": null }, { "name": "created_user", "type": "esriFieldTypeString", "alias": "created_user", "length": 255, "domain": null }, { "name": "created_date", "type": "esriFieldTypeDate", "alias": "created_date", "length": 8, "domain": null }, { "name": "last_edited_user", "type": "esriFieldTypeString", "alias": "last_edited_user", "length": 255, "domain": null }, { "name": "last_edited_date", "type": "esriFieldTypeDate", "alias": "last_edited_date", "length": 8, "domain": null }, { "name": "ESRI_OID", "type": "esriFieldTypeOID", "alias": "ESRI_OID", "domain": null } ], "geometryField": { "name": "SHAPE", "type": "esriFieldTypeGeometry", "alias": "SHAPE" }, "indexes": [ { "name": "FDO_GlobalID", "fields": "GlobalID", "isAscending": true, "isUnique": true, "description": "" } ], "subtypes": [], "relationships": [], "canModifyLayer": true, "canScaleSymbols": false, "hasLabels": true, "capabilities": "Map,Query,Data", "maxRecordCount": 2000, "supportsStatistics": true, "supportsExceedsLimitStatistics": true, "supportsAdvancedQueries": true, "hasM": true, "supportedQueryFormats": "JSON, geoJSON, PBF", "isDataVersioned": false, "ownershipBasedAccessControlForFeatures": {"allowOthersToQuery": true}, "useStandardizedQueries": true, "supportedSpatialRelationships": [ "esriSpatialRelIntersects", "esriSpatialRelContains", "esriSpatialRelCrosses", "esriSpatialRelEnvelopeIntersects", "esriSpatialRelIndexIntersects", "esriSpatialRelOverlaps", "esriSpatialRelTouches", "esriSpatialRelWithin", "esriSpatialRelRelation" ], "advancedQueryCapabilities": { "useStandardizedQueries": true, "supportsStatistics": true, "supportsPercentileStatistics": true, "supportsHavingClause": true, "supportsOrderBy": true, "supportsDistinct": true, "supportsCountDistinct": true, "supportsPagination": true, "supportsLod": false, "supportsQueryWithLodSR": false, "supportsTrueCurve": true, "supportsQueryWithDatumTransformation": true, "supportsReturningQueryExtent": true, "supportsQueryWithDistance": true, "supportsSqlExpression": true, "supportsTimeRelation": true, "supportsSqlFormat": false, "supportsQueryAnalytic": true }, "supportsDatumTransformation": true, "advancedQueryAnalyticCapabilities": { "supportsLinearRegression": true, "supportsAsync": false, "supportsPercentileAnalytic": true }, "dateFieldsTimeReference": { "timeZone": "UTC", "respectsDaylightSaving": true }, "preferredTimeReference": { "timeZone": "Mountain Standard Time", "respectsDaylightSaving": true }, "datesInUnknownTimezone": false, "hasMetadata": true, "isDataArchived": false, "archivingInfo": { "supportsQueryWithHistoricMoment": false, "startArchivingMoment": -1 }, "supportsCoordinatesQuantization": true, "supportsDynamicLegends": true, "serviceItemId": "c1ece7be9dbe44ed878783804f7682ac" } ], "tables": [] }