Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/MapPopupComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ const getLayerLabel = (layerKey: string): string => {
'ogc-actively-monitored': 'Actively Monitored',
'ogc-springs': 'Springs',
'ogc-project-areas': 'AMP Project Areas',
'ogc-geothermal-wells-bht': 'Geothermal Wells (BHT)',
'ogc-geothermal-wells-temperature-profile': 'Geothermal Wells (Temp-Depth)',
'ogc-bht-measurements': 'BHT Measurements',
'ogc-temp-depth-measurements': 'Temperature-Depth Measurements',
'ogc-heat-flow': 'Heat Flow',
'ogc-dst': 'Drill Stem Tests',
}

return labelByLayer[layerKey] || titleCase(layerKey.replace(/^ogc-/, ''))
Expand Down
86 changes: 86 additions & 0 deletions src/hooks/useThingLayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@ export const useThingLayers = (
'Soil Gas Sample Locations',
'soil_gas_sample_locations',
])
const geothermalWellsBht = resolveCollection(collections, [
'geothermal_wells_bht',
'Geothermal Wells — Bottom-Hole Temperature',
])
const geothermalWellsTemperatureProfile = resolveCollection(collections, [
'geothermal_wells_temperature_profile',
'Geothermal Wells — Temperature-Depth Profile',
])
const bhtMeasurements = resolveCollection(collections, [
'bht_measurements',
'BHT Measurements',
])
const tempDepthMeasurements = resolveCollection(collections, [
'temp_depth_measurements',
'Temperature-Depth Measurements',
])
const heatFlow = resolveCollection(collections, ['heat_flow', 'Heat Flow'])
const drillStemTests = resolveCollection(collections, [
'dst',
'Drill Stem Tests',
])
const latestTdsLayer = useOGCLayer({
collection: latestTds.id,
label: latestTds.label,
Expand Down Expand Up @@ -649,6 +670,47 @@ export const useThingLayers = (
soilGasSampleLocations.exists &&
isLayerActive('ogc-soil-gas-sample-locations'),
})
const geothermalWellsBhtLayer = useOGCLayer({
collection: geothermalWellsBht.id,
label: geothermalWellsBht.label,
color: '#b45309',
enabled:
geothermalWellsBht.exists && isLayerActive('ogc-geothermal-wells-bht'),
})
const geothermalWellsTemperatureProfileLayer = useOGCLayer({
collection: geothermalWellsTemperatureProfile.id,
label: geothermalWellsTemperatureProfile.label,
color: '#d97706',
enabled:
geothermalWellsTemperatureProfile.exists &&
isLayerActive('ogc-geothermal-wells-temperature-profile'),
})
const bhtMeasurementsLayer = useOGCLayer({
collection: bhtMeasurements.id,
label: bhtMeasurements.label,
color: '#ea580c',
enabled: bhtMeasurements.exists && isLayerActive('ogc-bht-measurements'),
})
const tempDepthMeasurementsLayer = useOGCLayer({
collection: tempDepthMeasurements.id,
label: tempDepthMeasurements.label,
color: '#f59e0b',
enabled:
tempDepthMeasurements.exists &&
isLayerActive('ogc-temp-depth-measurements'),
})
const heatFlowLayer = useOGCLayer({
collection: heatFlow.id,
label: heatFlow.label,
color: '#dc2626',
enabled: heatFlow.exists && isLayerActive('ogc-heat-flow'),
})
const drillStemTestsLayer = useOGCLayer({
collection: drillStemTests.id,
label: drillStemTests.label,
color: '#92400e',
enabled: drillStemTests.exists && isLayerActive('ogc-dst'),
})

return useMemo(() => {
const result: Record<string, any> = {}
Expand Down Expand Up @@ -733,6 +795,24 @@ export const useThingLayers = (
soilGasSampleLocations,
soilGasSampleLocationsLayer
)
addLayer(
'ogc-geothermal-wells-bht',
geothermalWellsBht,
geothermalWellsBhtLayer
)
addLayer(
'ogc-geothermal-wells-temperature-profile',
geothermalWellsTemperatureProfile,
geothermalWellsTemperatureProfileLayer
)
addLayer('ogc-bht-measurements', bhtMeasurements, bhtMeasurementsLayer)
addLayer(
'ogc-temp-depth-measurements',
tempDepthMeasurements,
tempDepthMeasurementsLayer
)
addLayer('ogc-heat-flow', heatFlow, heatFlowLayer)
addLayer('ogc-dst', drillStemTests, drillStemTestsLayer)

return result
}, [
Expand All @@ -756,5 +836,11 @@ export const useThingLayers = (
perennialStreamsLayer,
rockSampleLocationsLayer,
soilGasSampleLocationsLayer,
geothermalWellsBhtLayer,
geothermalWellsTemperatureProfileLayer,
bhtMeasurementsLayer,
tempDepthMeasurementsLayer,
heatFlowLayer,
drillStemTestsLayer,
])
}
41 changes: 40 additions & 1 deletion src/pages/ocotillo/collections/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,44 @@ const REGISTERED_MAP_COLLECTIONS: RegisteredMapCollection[] = [
groupKey: 'reference',
candidates: ['Soil Gas Sample Locations', 'soil_gas_sample_locations'],
},
{
layerKey: 'ogc-geothermal-wells-bht',
groupKey: 'geothermal',
candidates: [
'geothermal_wells_bht',
'Geothermal Wells — Bottom-Hole Temperature',
],
displayLabel: 'Geothermal Wells (BHT)',
},
{
layerKey: 'ogc-geothermal-wells-temperature-profile',
groupKey: 'geothermal',
candidates: [
'geothermal_wells_temperature_profile',
'Geothermal Wells — Temperature-Depth Profile',
],
displayLabel: 'Geothermal Wells (Temp-Depth)',
},
{
layerKey: 'ogc-bht-measurements',
groupKey: 'geothermal',
candidates: ['bht_measurements', 'BHT Measurements'],
},
{
layerKey: 'ogc-temp-depth-measurements',
groupKey: 'geothermal',
candidates: ['temp_depth_measurements', 'Temperature-Depth Measurements'],
},
{
layerKey: 'ogc-heat-flow',
groupKey: 'geothermal',
candidates: ['heat_flow', 'Heat Flow'],
},
{
layerKey: 'ogc-dst',
groupKey: 'geothermal',
candidates: ['dst', 'Drill Stem Tests'],
},
]

const trimTrailingSlash = (value: string) => value.replace(/\/+$/, '')
Expand Down Expand Up @@ -314,7 +352,8 @@ const groupCollections = (collections: OgcCollectionRecord[]): CollectionGroup[]
{
key: 'geothermal',
title: 'Geothermal',
description: 'Reserved for geothermal wells and supporting thermal, meteorological, and sample collections when they are published.',
description:
'Geothermal wells with bottom-hole and temperature-depth data, plus the underlying measurements, heat flow, and drill stem tests.',
collections: sortRegisteredCollections(grouped.geothermal),
},
{
Expand Down
13 changes: 13 additions & 0 deletions src/pages/ocotillo/map/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,23 @@ const DEFAULT_EXPANDED_GROUPS = {
groundwater: true,
surfaceWater: true,
climate: true,
geothermal: true,
geoscience: true,
reference: true,
}

const getLayerGroupKey = (
layerKey: string
): keyof typeof DEFAULT_EXPANDED_GROUPS => {
if (
layerKey.includes('geothermal') ||
layerKey.includes('bht') ||
layerKey.includes('temp-depth') ||
layerKey.includes('heat-flow') ||
layerKey === 'ogc-dst'
) {
return 'geothermal'
}
if (
layerKey.includes('water-well') ||
layerKey.includes('actively-monitored') ||
Expand Down Expand Up @@ -156,6 +166,7 @@ const getExpandedGroupsForLayers = (layerKeys: string[]) => {
groundwater: false,
surfaceWater: false,
climate: false,
geothermal: false,
geoscience: false,
reference: false,
}
Expand Down Expand Up @@ -694,6 +705,7 @@ export const MapView: React.FC = () => {
groundwater: 'Groundwater',
surfaceWater: 'Surface Water',
climate: 'Climate',
geothermal: 'Geothermal',
geoscience: 'Geoscience',
reference: 'Reference',
}
Expand All @@ -710,6 +722,7 @@ export const MapView: React.FC = () => {
groundwater: [] as Array<[string, any]>,
surfaceWater: [] as Array<[string, any]>,
climate: [] as Array<[string, any]>,
geothermal: [] as Array<[string, any]>,
geoscience: [] as Array<[string, any]>,
reference: [] as Array<[string, any]>,
}
Expand Down
23 changes: 23 additions & 0 deletions src/test/utils/ogcLayerUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,29 @@ describe('resolveCollection', () => {
expect(resolved.id).toBe('springs')
})

it('matches a title containing an em dash', () => {
const resolved = resolveCollection(
[
collection(
'geothermal_wells_bht',
'Geothermal Wells — Bottom-Hole Temperature'
),
],
['Geothermal Wells — Bottom-Hole Temperature']
)

expect(resolved.id).toBe('geothermal_wells_bht')
})

it('does not confuse dst with collections that contain it', () => {
const resolved = resolveCollection(
[collection('dst', 'Drill Stem Tests'), collection('dst_summary')],
['dst']
)

expect(resolved.id).toBe('dst')
})

it('tries candidates in order', () => {
const resolved = resolveCollection(
[collection('project_area'), collection('project_areas')],
Expand Down
Loading