sul-dlss / earthworks

Geospatial discovery application for Stanford University Libraries.
https://earthworks.stanford.edu
Other
21 stars 3 forks source link

Preview attribute table information on record show page for vector data #1162

Open thatbudakguy opened 2 months ago

thatbudakguy commented 2 months ago

Note: this ticket applies only to Vector datasets (shapefiles, points, polygons, etc.). For the version specific to Raster data, see #1172.

This ticket is for exploring ways to add a preview of attribute table information so that users can get a better sense of what data is contained in the attributes. This is different from inspection ("what info is at the pixel that I clicked?") and is instead intended to represent a general survey or broad understanding of all the data or a preselected sample, to help the user make an informed decision about downloading. It's more accessible and can be displayed without asking the user to pick a point using a mouse.

The goal is to show an example of what features the data contains, as in the mockup:

Screenshot 2024-08-12 at 18 20 39

We could try parsing the ISO 19110 XML linked from the dct_references_s field (if there is one) to get extra information about the naming of the attributes and what they mean.

As noted by the GIS team, some kinds of data (in particular census data) may have polygons that have null attributes associated, so we might need to be a little careful about just picking a feature at random (or the first feature) to display a sample. There might also be another way to give a good summary of what's "in" the data besides just showing the first feature.

thatbudakguy commented 2 months ago

This work could make it upstream to GBL too.

thatbudakguy commented 2 months ago

The current mockup shows this info in a modal, but we could also present it immediately without needing an extra click, below the map. To do that, we'd likely need to make an extra query to GeoServer to get information about the attributes and perhaps pre-select one feature to show its attributes, or show a general summary of all the features/attributes.

dbranchini commented 2 months ago

@thatbudakguy I designed a version like that and Kim and I discussed it and decided against it. We liked the modal better. It's still accessible and it's less clutter on the page.