Revealing hiding regions - ProjectSidewalk/SidewalkWebpage GitHub Wiki

This is a guide for revealing or hiding regions (neighborhoods) on a running Project Sidewalk server. If the street/region data are not already present in the database, then this method will not work.

Revealing new regions

  1. First, we want to check for streets in the new regions that do not have GSV imagery. We have a script for that, but we need to get the street data first. Run the following query and save it in a file named street_edge_endpoints.csv and put it in the root directory of the Project Sidewalk repo in your local dev environment. Make sure to fill in the region_id filter with the IDs of the regions you want to add.

    SELECT street_edge.street_edge_id, region_id, x1, y1, x2, y2, geom
    FROM street_edge
    INNER JOIN street_edge_region ON street_edge.street_edge_id = street_edge_region.street_edge_id
    WHERE street_edge.deleted = TRUE
        AND region_id IN (TODO);
    
  2. Run make dev and then python3 check_streets_for_imagery.py in that container (you don't need to do it in this container, but all the Python libraries are already installed there so this is easiest if you have the dev environment set up already). This could take awhile, but progress is shown in the terminal and is saved periodically. If it stops progressing, just restart it. It outputs streets_with_no_imagery.csv in the db/ directory.

  3. Now in the root Project Sidewalk directory (not within a Docker shell) run the following command. The script will request the necessary info in order to add the region(s).

    make reveal-or-hide-neighborhoods
    
  4. Load the landing page and check that the region(s) were added successfully. You may want to adjust the centering and zoom of the map at this point. You can do that by running the following queries:

    UPDATE config SET default_map_zoom = TODO;
    UPDATE config SET city_center_lat = TODO;
    UPDATE config SET city_center_lng = TODO;
    
  5. Log in and go to the admin dashboard. Click the Clear Play cache button. This will reset the cached value for the full distance for the city. The percent complete on the landing page should now be correct.

  6. You can then delete the street_edge_endpoints.csv and streets_with_no_imagery.csv files.

Hiding regions

  1. Hiding regions is more simple. It should be as easy as running the following script in the root Project Sidewalk directory. The script will request the necessary info in order to hide the region(s).

    make reveal-or-hide-neighborhoods
    
  2. Load the landing page and check that the region(s) were successfully hidden. You may want to adjust the centering and zoom of the map at this point. You can do that by running the following queries.

    UPDATE config SET default_map_zoom = TODO;
    UPDATE config SET city_center_lat = TODO;
    UPDATE config SET city_center_lng = TODO;
    
  3. Log in and go to the admin dashboard. Click the Clear Play cache button. This will reset the cached value for the full distance for the city. The percent complete on the landing page should now be correct.

⚠️ **GitHub.com Fallback** ⚠️