Skip to content

agrc/raster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

raster.utah.gov

This repository contains the source code for the raster data discovery website maintained by the Utah Geospatial Resource Center (UGRC). The website provides users with tools to discover, visualize, and download various raster datasets relevant to Utah.

Architecture

Models

Product Types

These are the different types of data available through the app. Each of them have corresponding extent and tile indexes feature classes.

  • Aerial Photography
  • Auto-Correlated DEMs
  • Lidar
  • Contours
  • USGS DEMs
  • Topos
Category

Top-level results groups returned in step 3. These come from the Category field in the extents datasets. Products are grouped by category but everything within the curly braces is removed from the label. For example: HRO 2012 (12.5cm) {2012 Remove Me} is labeled as HRO 2012 (12.5cm).

For Lidar, Year_Collected is appended to the category label to provide more context.

Categories are sorted by Estimated_Date in descending order (most recent first). This is done directly in the query to the extents datasets in src/services/search.ts.

Product

Individual results returned in step 3 as cards. Each product is represented by an individual row in the extents datasets.

Products within each category are sorted using a configuration object.

  • Define sort tokens per product type in src/config.ts under PRODUCT_SORT_ORDER.
  • How it works:
    • Sorting is applied only for product types that have an entry in PRODUCT_SORT_ORDER.
    • Each product's Product field is matched case-insensitively against the tokens, using substring matching.
    • Items are ordered by the index of the first matching token in the configured array.
    • Items that don’t match any token will appear after matched items (they keep their relative order among themselves).

To change the ordering, update the token arrays in PRODUCT_SORT_ORDER. If a product type has no entry, its products are shown in their original order.

Tile

A single file that can be downloaded from cloud storage. Each row in the tile indexes datasets represents a single tile.

Datasets

Extents

Currently available as hosted feature services in ArcGIS Online (AGOL) (maintained in internal, pushed to AGOL via Dolly Carton). One service per product type. Stores an extent for each feature along with metadata. These provide the search results (grouped by Category).

Common Fields for Extents

A full analysis of the schema for the extents services can be found in the schema report.

  • Average_File_Size
  • Category
  • Contact
  • Description
  • Estimated_Date
  • FTP_Path
  • File_Extension
  • File_Format
  • FlightDate_Location
  • HTML_Page
  • Horizontal_Accuracy
  • In_House
  • Interval
  • LYR_File
  • Product
  • Resolution
  • SHOW
  • ServiceName
  • Tile_Index (relates to TILE_INDEX field in tile index datasets)
  • Total_Size
  • Total_Square_Miles
  • Upload_Date
  • Vertical_Accuracy
  • Year_Collected

These are only found in Auto-Correlated DEMs, Lidar DEMs, and USGS DEMs:

  • METADATA
  • REPORT

Tile Indexes

Individual tile index data aggregated into six feature classes corresponding with the product types similar to extents above. Maintained exclusively in AGOL. Each row represents a single tile that can be downloaded. These are queried to get the download links for each product.

Common Fields for Tile Indexes

A full analysis of the schema for the tile index services can be found in the schema report.

  • EXT
  • PATH
  • SIZE
  • TILE
  • TILE_INDEX (relates to Tile_Index field in extents datasets)

Data-Driven App Functionality

Staging data prior to making it visible in the app

The app will only show results from the extents datasets where upper(SHOW) = 'Y'. This allows data to be staged in the datasets but not visible to end users until ready.

Preview Button

The preview button is only shown for products that have a value in the ServiceName field. When clicked, the value is used to build a URL to the corresponding discover layer and it is added to the map.

Download Button

The download button is only shown for products where In_House equals Yes.

"web page" Link

The "web page" link is only shown for products where the HTML_Page field contains a valid URL.

Deep links and URL parameters

You can pre-configure the app via the URL to create shareable links that focus the experience on certain products and categories, and optionally set a custom page title. These parameters are read on load and influence both the map and the wizard flow.

Supported query parameters

  • title (string, optional)

    • Sets the large heading in the site header.
    • Example: ?title=Summit%20County%20Raster%20Finder
  • cat (string, optional)

    • A single category to filter results to. Must match a category label from the extents data (see “Category” above). Associated product types will be pre-selected on Step 1.
    • Example: ?cat=Contours
  • catGroup (comma-separated list of strings, optional)

    • Multiple categories to filter to.
    • Example: ?catGroup=Elevation%20Models,Slope%20Maps
  • products (comma-separated list of numbers, optional)

    • Pre-selects product types on Step 1 by index, using the fixed order defined in src/config.ts under PRODUCT_TYPES.
    • Current mapping (index ➜ type):
      • 0 ➜ Aerial Photography (aerialPhotography)
      • 1 ➜ Lidar DEMs (lidar)
      • 2 ➜ USGS DEMs (usgsDem)
      • 3 ➜ Auto-Correlated DEMs (autoDem)
      • 4 ➜ Contours (contours)
      • 5 ➜ USGS Topo Maps (drg)
    • Non-numeric entries and out-of-range indexes are ignored.
    • Example: ?products=1,5

You can combine all of the above, for example:

  • ?title=Summit%20County&cat=Contours&catGroup=Elevation%20Models,Slope%20Maps&products=1,5

Development

Setup

  1. Install dependencies: pnpm install

  2. Copy ArcGIS assets: pnpm copy:arcgis

  3. Create .env file:

    VITE_DISCOVER=<quad-word-token>
    VITE_FIREBASE_CONFIG=<json-config>

Commands

Command Description
pnpm start Start dev server (port 5173)
pnpm build Build for production
pnpm preview Preview production build
pnpm test Run unit tests (watch mode)
pnpm test run Run unit tests (single pass)
pnpm test:e2e Run Playwright tests
pnpm check Type check
pnpm lint Lint code
pnpm format Format code
pnpm storybook Launch Storybook

Both unit and e2e tests can be run via VSCode's test explorer.

Patches

This project uses pnpm's patching feature to apply fixes to dependencies before upstream releases.

Package Issue Fix PR Remove when
@react-aria/disclosure #9004 #9045 Merged and released in react-aria-components

Bug: Collapsed Disclosure content becomes visible when isDisabled toggles from true to false.

See .github/copilot-instructions.md for architecture details.

Qualtrics Survey

The qualtrics survey is controlled via a script tag in index.html and points to a div with a class name of qualtrics-survey in App.tsx. To see the data collected from the survey go to this qualtrics dashboard.

Attribution

This project was developed with the assistance of GitHub Copilot.

About

The website to discover and download raster data within Utah

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages