diff --git a/app/controllers/ProjectSidewalkAPIController.scala b/app/controllers/ProjectSidewalkAPIController.scala index c05ba66681..19851e295a 100644 --- a/app/controllers/ProjectSidewalkAPIController.scala +++ b/app/controllers/ProjectSidewalkAPIController.scala @@ -566,7 +566,7 @@ class ProjectSidewalkAPIController @Inject()(implicit val env: Environment[User, val minLng: Double = min(lng1.getOrElse(cityMapParams.lng1), lng2.getOrElse(cityMapParams.lng2)) val maxLng: Double = max(lng1.getOrElse(cityMapParams.lng1), lng2.getOrElse(cityMapParams.lng2)) - val streetAccessScores: List[AccessScoreStreet] = getAccessScoreStreetsGeneric(minLat, maxLat, minLng, maxLng, version = 2) + val streetAccessScores: List[AccessScoreStreet] = getAccessScoreStreetsGeneric(minLat, minLng, maxLat, maxLng, version = 2) // In CSV format. if (filetype.isDefined && filetype.get == "csv") { val file = new java.io.File("access_score_streets.csv") diff --git a/app/views/developer.scala.html b/app/views/developer.scala.html index 511242fbb4..9edacfac13 100644 --- a/app/views/developer.scala.html +++ b/app/views/developer.scala.html @@ -36,7 +36,42 @@

Access APIs

-

Access Attributes

+
+

Access Attributes

+
+ + Download Access Attribute Data + + + +
+
@@ -60,47 +95,32 @@

Access Attributes

@@ -125,18 +145,18 @@

Access Attributes

- @@ -151,7 +171,26 @@

Access Attributes

-

Access Score: Streets

+
+

Access Score: Streets

+ +
@@ -49,7 +84,7 @@

Access Attributes

URL - /v2/access/attributes
+ /v2/access/attributes
/v2/access/attributesWithLabels
Parameters -
-
Required:
-
- You need to pass a pair of latlng coordinates to define a bounding box, which is - used to specify where you want to query the data from. -
    -
  • - lat1=[double]
    -
  • -
  • - lng1=[double]
    -
  • -
  • - lat2=[double]
    -
  • -
  • - lng2=[double]
    -
  • -
- If you need data for the entire city, you can use the parameters below. But note - that the query could take a long time to complete, or even fail on very large - datasets (we're working on improving performance!).
- -
-
Optional:
- You can pass a specific severity to look for and/or a specific filetype for the - returned dataset. Severity can be an integer value from 1-5 or "none" to represent - data without a severity rating. You can pass a filetype that can be a string "csv" - to represent data returned in CSV format, "geojson" for the GeoJSON format, or - "shapefile" for the ShapeFile format. The GeoJSON format is returned by default. -
    -
  • - severity=[int|string]
    -
  • -
  • - filetype=csv|shapefile|geojson
    -
  • -
+

+ You can pass a pair of latlng coordinates to define a bounding box, which is + used to specify where you want to query the data from. If you need data for the + entire city, you can use the download button above, or you can simply exclude + the lat/lng parameters. Note that the query could take a long time to complete + if you are requesting all the data for this city.
+ lat1=[double]
+ lng1=[double]
+ lat2=[double]
+ lng2=[double]
+

+

+ You can filter for a specific severity rating in the returned dataset using the + "severity" parameter. Severity can be an integer from 1-5 or "none" to represent + data without a severity rating.
+ severity=[int|string] +

+

+ You can choose the file type for the data using the "filetype" parameter. The + valid options are "csv", "geojson", or "shapefile". The GeoJSON format is + returned by default.
+ filetype=csv|shapefile|geojson +

Examples + -
- - -
+
- - - +
+ + +
+ +
@@ -218,17 +242,17 @@

Access Score: Streets

The API returns the streets that have been audited at least once as a Feature Collection of LineString features. - Each LineString include the street geometry and the corresponding Access Score. + Each LineString includes the street geometry and the corresponding Access Score. -
@@ -170,41 +209,26 @@

Access Score: Streets

Parameters -
-
Required:
-
- You need to pass a pair of latlng coordinates to define a bounding box, which is - used to specify where you want to query the data from. -
    -
  • - lat1=[double]
    -
  • -
  • - lng1=[double]
    -
  • -
  • - lat2=[double]
    -
  • -
  • - lng2=[double]
    -
  • -
- If you need data for the entire city, you can use the parameters below. But note - that the query could take a long time to complete.
- -
-
Optional:
- You can pass a filetype that can be a string "csv" to represent data returned in CSV - format, "geojson" for the GeoJSON format, or "shapefile" for the ShapeFile format. - The GeoJSON format is returned by default. -
    -
  • - filetype=csv|shapefile|geojson
    -
  • -
+

+ You can pass a pair of latlng coordinates to define a bounding box, which is + used to specify where you want to query the data from. If you need data for the + entire city, you can use the download button above, or you can simply exclude + the lat/lng parameters. Note that the query could take a long time to complete + if you are requesting all the data for this city.
+ lat1=[double]
+ lng1=[double]
+ lat2=[double]
+ lng2=[double]
+

+

+ You can choose the file type for the data using the "filetype" parameter. The + valid options are "csv", "geojson", or "shapefile". The GeoJSON format is + returned by default.
+ filetype=csv|shapefile|geojson +

Examples + -
+
@@ -248,7 +272,26 @@

Access Score: Streets

Map
-

Access Score: Neighborhood

+
+

Access Score: Neighborhood

+ +
@@ -322,10 +350,10 @@

Access Score: Neighborhood

-
@@ -267,41 +310,26 @@

Access Score: Neighborhood

Parameters -
-
Required:
-
- You need to pass a pair of latlng coordinates to define a bounding box, which is - used to specify where you want to query the data from. -
    -
  • - lat1=[double]
    -
  • -
  • - lng1=[double]
    -
  • -
  • - lat2=[double]
    -
  • -
  • - lng2=[double]
    -
  • -
- If you need data for the entire city, you can use the parameters below. But note - that the query could take a long time to complete.
- -
-
Optional:
- You can pass a filetype that can be a string "csv" to represent data returned in CSV - format, "geojson" for the GeoJSON format, or "shapefile" for the ShapeFile format. - The GeoJSON format is returned by default. -
    -
  • - filetype=csv|shapefile|geojson
    -
  • -
+

+ You can pass a pair of latlng coordinates to define a bounding box, which is + used to specify where you want to query the data from. If you need data for the + entire city, you can use the download button above, or you can simply exclude + the lat/lng parameters. Note that the query could take a long time to complete + if you are requesting all the data for this city.
+ lat1=[double]
+ lng1=[double]
+ lat2=[double]
+ lng2=[double]
+

+

+ You can choose the file type for the data using the "filetype" parameter. The + valid options are "csv", "geojson", or "shapefile". The GeoJSON format is + returned by default.
+ filetype=csv|shapefile|geojson +

Examples + -
+
@@ -355,10 +383,10 @@

General Project Sidewalk Stats API

/v2/overallStats -
+
/v2/overallStats?filterLowQuality=true -
+
/v2/overallStats?filetype=csv @@ -390,7 +418,7 @@

Users API

/v2/userStats -
+
/v2/userStats?filetype=csv @@ -426,6 +454,8 @@

Changes in API v2

/v1/access/features or /v1/access/attributes.
  • We've added a new /v2/access/attributesWithLabels endpoint, which gives access to the individual labels that are clustered into accessibility attributes.
  • +
  • Coordinate query parameters are optional, unspecified coordinate parameters will default to + the edge coordinates of the designated city.
  • @@ -484,6 +514,9 @@

    License

    margin: 25px 0 0 0; height: 300px; width: 100%; + }, + #access-streets-dropdown { + margin-top: 13px; } diff --git a/public/javascripts/developer.js b/public/javascripts/developer.js index 78fd976c5d..c1ea1b20e7 100644 --- a/public/javascripts/developer.js +++ b/public/javascripts/developer.js @@ -28,29 +28,46 @@ function Developer () { minZoom: 9 }).addLayer(L.mapbox.styleLayer(i18next.t('common:map-url-streets'))); + // Assign URLs to download buttons to get citywide data. + $('#city-attributes-csv').attr({ 'href': '/v2/access/attributes?filetype=csv' }); + $('#city-attributes-shapefile').attr({ 'href': '/v2/access/attributes?filetype=shapefile' }); + $('#city-attributes-geojson').attr({ 'href': '/v2/access/attributes?filetype=geojson' }); + + $('#city-attributes-label-csv').attr({ 'href': '/v2/access/attributesWithLabels?filetype=csv' }); + $('#city-attributes-label-shapefile').attr({ 'href': '/v2/access/attributesWithLabels?filetype=shapefile' }); + $('#city-attributes-label-geojson').attr({ 'href': '/v2/access/attributesWithLabels?filetype=geojson' }); + + $('#city-streets-csv').attr({ 'href': '/v2/access/score/streets?filetype=csv' }); + $('#city-streets-shapefile').attr({ 'href': '/v2/access/score/streets?filetype=shapefile' }); + $('#city-streets-geojson').attr({ 'href': '/v2/access/score/streets?filetype=geojson' }); + + $('#city-neighborhood-csv').attr({ 'href': '/v2/access/score/neighborhoods?filetype=csv' }); + $('#city-neighborhood-shapefile').attr({ 'href': '/v2/access/score/neighborhoods?filetype=shapefile' }); + $('#city-neighborhood-geojson').attr({ 'href': '/v2/access/score/neighborhoods?filetype=geojson' }); + // Use parameters to fill in example URLs. - var fullBBox = `lat1=${data.southwest_boundary.lat}&lng1=${data.southwest_boundary.lng}&lat2=${data.northeast_boundary.lat}&lng2=${data.northeast_boundary.lng}`; var attributesURL = `/v2/access/attributes?lat1=${data.attribute.lat1}&lng1=${data.attribute.lng1}&lat2=${data.attribute.lat2}&lng2=${data.attribute.lng2}`; var attributesURLCSV = `/v2/access/attributes?lat1=${data.attribute.lat1}&lng1=${data.attribute.lng1}&lat2=${data.attribute.lat2}&lng2=${data.attribute.lng2}&filetype=csv`; - var attributesURLShapeFile = `/v2/access/attributes?lat1=${data.attribute.lat1}&lng1=${data.attribute.lng1}&lat2=${data.attribute.lat2}&lng2=${data.attribute.lng2}&filetype=shapefile`; - var attributeWithLabelsURL = `/v2/access/attributesWithLabels?lat1=${data.attribute.lat1}&lng1=${data.attribute.lng1}&lat2=${data.attribute.lat2}&lng2=${data.attribute.lng2}&severity=3`; + var attributesURLSeverity = `/v2/access/attributes?lat1=${data.attribute.lat1}&lng1=${data.attribute.lng1}&lat2=${data.attribute.lat2}&lng2=${data.attribute.lng2}&severity=3`; + var attributeWithLabelsURL = `/v2/access/attributesWithLabels?lat1=${data.attribute.lat1}&lng1=${data.attribute.lng1}&lat2=${data.attribute.lat2}&lng2=${data.attribute.lng2}`; + var streetsURL = `/v2/access/score/streets?lat1=${data.street.lat1}&lng1=${data.street.lng1}&lat2=${data.street.lat2}&lng2=${data.street.lng2}`; var streetsURLCSV = `/v2/access/score/streets?lat1=${data.street.lat1}&lng1=${data.street.lng1}&lat2=${data.street.lat2}&lng2=${data.street.lng2}&filetype=csv`; var streetsURLShapeFile = `/v2/access/score/streets?lat1=${data.street.lat1}&lng1=${data.street.lng1}&lat2=${data.street.lat2}&lng2=${data.street.lng2}&filetype=shapefile`; + var regionsURL = `/v2/access/score/neighborhoods?lat1=${data.region.lat1}&lng1=${data.region.lng1}&lat2=${data.region.lat2}&lng2=${data.region.lng2}`; var regionsURLCSV = `/v2/access/score/neighborhoods?lat1=${data.region.lat1}&lng1=${data.region.lng1}&lat2=${data.region.lat2}&lng2=${data.region.lng2}&filetype=csv`; var regionsURLShapeFile = `/v2/access/score/neighborhoods?lat1=${data.region.lat1}&lng1=${data.region.lng1}&lat2=${data.region.lat2}&lng2=${data.region.lng2}&filetype=shapefile`; // Fill in example URLs in HTML. - $('.api-full-bbox').html(fullBBox); $('#attributes-link').attr('href', attributesURL); $('#attributes-code').html(attributesURL); - $('#attributes-with-labels-link').attr('href', attributeWithLabelsURL); - $('#attributes-with-labels-code').html(attributeWithLabelsURL); $('#attributes-link-CSV').attr('href', attributesURLCSV); $('#attributes-code-CSV').html(attributesURLCSV); - $('#attributes-link-shapefile').attr('href', attributesURLShapeFile); - $('#attributes-code-shapefile').html(attributesURLShapeFile); + $('#attributes-link-severity').attr('href', attributesURLSeverity); + $('#attributes-code-severity').html(attributesURLSeverity); + $('#attributes-with-labels-link').attr('href', attributeWithLabelsURL); + $('#attributes-with-labels-code').html(attributeWithLabelsURL); $('#streets-link').attr('href', streetsURL); $('#streets-code').html(streetsURL); $('#streets-link-CSV').attr('href', streetsURLCSV); diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 2406fb4b32..09c4dac5c3 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -22,6 +22,7 @@ #user-table_wrapper { -webkit-transform: rotateX(180deg); /* Adding scrollbar flips all text, this flips it back. */ font-size: 12px; + min-height: 290px; } .stats-grid{ diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 07404060b6..93e28df841 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -560,6 +560,10 @@ kbd { position: relative; } +.dropdown-toggle { + margin-top: 13px; +} + /*Overlay box - start*/ #area-completion-overlay-wrapper, #already-completed-neighborhood-overlay,