cityofaustin / atd-data-tech

Austin Transportation Data & Technology Services
17 stars 2 forks source link

Generate Steepness Chevrons #5740

Closed alan-deanda closed 3 years ago

alan-deanda commented 3 years ago

We need to generate steepness icons to place along routes in the printed bike map. The existing steepness chevrons were created ~10 years ago, and were likely improvised, as this has been the norm for every new project since with significant steepness. The chevrons are placed at the location in the route in the direction where the steepness occurs, and they roughly communicate the following:

While this is relative, the map is created with a beginners, and all ages and abilities-inclusive audience in mind.

andrewshensky commented 3 years ago

Steps for Calculating Steepness

  1. Query CTN as shown below a. BICYCLE_FACILITY IS NOT NULL Or BIKE_LEVEL_OF_COMFORT IS NOT NULL b. Reduced fields to only include those necessary c. Results in roughly 15K features
  2. Use Generate Points Along Line geoprocessing tool a. Point placement at 25% and include end points -> Generates 5 points per line segment ~~3. Use Elevation contour data from DM (ELEVATION.contours_2017) a. Query CONTOUR_TYPE field to include 2 or 3 (produces 10ft contours) i. CONTOUR_TYPE = 2 Or CONTOUR_TYPE = 3 b. Exporting this data local may improve performance in later steps~~
  3. Use spot elevation data from DM (ELEVATION.land_spot_elevations_2003) a. This data provides better resolution than contours for calculating slopes
  4. Run a spatial join between Point Layer and Contours Spot Elevations a. For Match Option select Closest, and verify elevation field will be pulled into points
  5. Add new field to spatial join output to identify the position of the point on the line (1-5) a. Since each segment has 5 points use formula below to select and calculate the position of the point on the line (points are created sequentially from start of line to end of line) b. MOD(OBJECTID+2n-x, n) = 0 i. n is the every nth record ii. x is the objectid to start from
  6. MOD(OBJECTID+9,5)=0 (selects the first point of every segment)
  7. MOD(OBJECTID+8,5)=0 (selects the second point of every segment) iii. Calculate in selection of features 1-5
  8. Query out features by their position on the line field and export to separate layers a. This will result in 5 separate layers each with its own elevation
  9. In original layer add fields below a. Elevation_1 (elevation for features with position of line of 1) b. Elevation_2 (elevation for features with position of line of 2) c. Elevation_3 (elevation for features with position of line of 3) d. Elevation_4 (elevation for features with position of line of 4) e. Elevation_5 (elevation for features with position of line of 5) f. Slope_1_2 (slope difference between Elevation 1 and 2) g. Slope_2_3 (slope difference between Elevation 2 and 3) h. Slope_3_4 (slope difference between Elevation 3 and 4) i. Slope_4_5 (slope difference between Elevation 4 and 5) j. SubSegmentSlope (All slope differences in one column for symbolizing)
  10. Query original layer for specific point of line and join by project extent ID with matching extract layer a. Query allows for join to be made for field calc to get all elevations in one layer
  11. Field calculate in the elevation from the join table to the associated field in original data a. Elevation from Extract with position on line of 1 should be calced into Elevation_1 field
  12. Calculate absolute value of slope difference between neighboring points a. Slope_1_2 (slope difference between Elevation 1 and 2) b. Slope_2_3 (slope difference between Elevation 2 and 3)
  13. Calculate slope difference values into SubSegmentSlope Field a. This allows slope difference between points to be held in one field for symbolizing
alan-deanda commented 3 years ago

@andrewshensky this looks great, but I would limit the initial search query to simply BIKE_LEVEL_OF_COMFORT IS NOT NULL. There are certain roads that technically have bicycle facilities, but we would never call them out on the bike map. For example, the toll highways all come with what is technically a wide enough shoulder for cycling on, but speed limits are at least 80MPH.

andrewshensky commented 3 years ago

@alan-deanda this is good to know. Modifying that query will also help to limit our feature count and reduce some map clutter. Adjusting the query on the current data will reduce the feature count by 814. *FYI current data is queried to only show features between 5 and 25% slope and has a current feature count of 7,369.

andrewshensky commented 3 years ago

Chevron Orientation to Match Climb Direction

  1. Use slope point layer to generate new lines (Points to Line) a. Line Field: project extend iD b. Sort Field: Point on Line
  2. Split Line at Point a. Search Radius: 5 feet
  3. Split Line at Points Output a. Add field for sequential numbers b. Calculate in sequential numbers in new field
  4. Linear Mean Direction a. Case Field: Sequential number field
  5. Spatial Join with slope point layer a. One to One Join b. Keep all target features c. Match Option: Closest
  6. Spatial Join Output a. Add fields: i. Corrected slope direction: Double ii. InvertSlopeID: Integar
  7. Field Calculate a. CompassA into CorrectedSlope
  8. Select all features with a slope over 0 a. For selected features Field Calculate CorrectedSlope - 180 b. This will allow you to invert slope orientation so all chevrons accurately represent climb
  9. Layer Symbology a. In symbology properties open pane "Vary symbology by attribute" b. Under Rotation select CorrectedSlope field c. Under Rotation Style select Geographic i. This will rotate symbology to accurately display orientation in map
johnclary commented 3 years ago
johnclary commented 3 years ago

Alan is finishing up label placement—should be done after than.

alan-deanda commented 3 years ago

chevron placement is complete on blowup side. closing this issue, and I'll open a new one to track the placement on the full side