Displaying rasters with Cesium #36
banesullivan
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@marySalvi and @annehaley, I thought I'd share how to use the RGD endpoints to display a raster in the Cesium viewer here. Figured a Discussion is more appropriate than an issue.
Access Raster Metadata
You'll want to use the
/rgd_imagery/raster/{spatial_id}
endpoint which serializes aRasterMeta
model. Here is an example response from that endpoint: https://www.resonantgeodata.com/api/rgd_imagery/raster/9That's the information to display in a table view.
Displaying image tiles in the Cesium Viewer
In order to display the raster in the cesium viewer, the user will need to select a single image from the list of images in parent_raster->image_set->images. Once you have an image ID, you will use that ID to fetch a bit of metadata about the image with the endpoint
/image_process/imagery/{id}/tiles
and also generate a template for the/image_process/imagery/{id}/tiles/{z}/{x}/{y}.png
endpoint. The formatting of this 2nd endpoint is a special case -- we only need to fill in the ID field and pass this URL template on to Cesium'sUrlTemplateImageryProvider
class. We'll do this in the following manner:That should be all you need to display an image from a raster in the CesiumViewer.
Beta Was this translation helpful? Give feedback.
All reactions