Skip to content

Commit

Permalink
Fix bike lanes
Browse files Browse the repository at this point in the history
They were broken for so long 🥲
  • Loading branch information
golf1052 committed Jun 26, 2024
1 parent a9fd654 commit e14dd46
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SeattleCarsInBikeLanes/Controllers/BikeLanesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace SeattleCarsInBikeLanes.Controllers
[ApiController]
public class BikeLanesController : ControllerBase
{
private const string ExistingBikeLaneFacilitiesUrl = "https://gisrevprxy.seattle.gov/arcgis/rest/services/SDOT_EXT/BikeMap/MapServer/20/query";
private const string MultiUseTrailsUrl = "https://gisrevprxy.seattle.gov/arcgis/rest/services/SDOT_EXT/BikeMap/MapServer/19/query";
private const string ExistingBikeLaneFacilitiesUrl = "https://services.arcgis.com/ZOyb2t4B0UYuYNYH/ArcGIS/rest/services/SDOT_Bike_Facilities/FeatureServer/2/query";
private const string MultiUseTrailsUrl = "https://services.arcgis.com/ZOyb2t4B0UYuYNYH/ArcGIS/rest/services/SDOT_Bike_Facilities/FeatureServer/1/query";

private readonly ILogger<BikeLanesController> logger;
private readonly HttpClient httpClient;
Expand Down Expand Up @@ -86,7 +86,7 @@ private async Task<List<int>> GetObjectIds(string baseUrl)
{
throw new Exception($"Error when fetching object ids for {baseUrl} {responseObject["error"]!["message"]}");
}
return responseObject["objectIds"]!.ToObject<List<int>>()!;
return responseObject["properties"]!["objectIds"]!.ToObject<List<int>>()!;
}

private async Task<JObject> GetGeometry(string baseUrl, List<int> objectIds)
Expand All @@ -97,12 +97,12 @@ private async Task<JObject> GetGeometry(string baseUrl, List<int> objectIds)
}

string outFields = string.Empty;
if (baseUrl.Contains("20"))
if (baseUrl == ExistingBikeLaneFacilitiesUrl)
{
// Bike lanes
outFields = "OBJECTID,UNITID,CATEGORY";
}
else if (baseUrl.Contains("19"))
else if (baseUrl == MultiUseTrailsUrl)
{
// Trails
outFields = "OBJECTID,ORD_STNAME_CONCAT";
Expand Down

0 comments on commit e14dd46

Please sign in to comment.