Skip to content

Commit 4970f11

Browse files
committed
added an object types count to the parquet_cesium.qmd file
1 parent e575d45 commit 4970f11

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

tutorials/parquet_cesium.qmd

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ One key development of the iSamples project centers on the demonstration of low-
88
This page demonstrates how geospatial data can be dynamically accessed from a remote parquet file in cloud storage. The page uses Cesium for browser visualization of these spatial data on a 3D global map. The data in this demonstration comes from [Open Context's](https://opencontext.org/) export of specimen (archaeological artifact and ecofact) records for iSamples. However, this demonstration can also work with any other iSamples compliant parquet data source made publicly accessible on the Web.
99

1010

11-
<script src="https://cesium.com/downloads/cesiumjs/releases/1.127/Build/Cesium/Cesium.js"></script>
12-
<link href="https://cesium.com/downloads/cesiumjs/releases/1.127/Build/Cesium/Widgets/widgets.css" rel="stylesheet"></link>
11+
<script src="https://cesium.com/downloads/cesiumjs/releases/1.133/Build/Cesium/Cesium.js"></script>
12+
<link href="https://cesium.com/downloads/cesiumjs/releases/1.133/Build/Cesium/Widgets/widgets.css" rel="stylesheet"></link>
1313
<style>
1414
div.cesium-topleft {
1515
display: block;
@@ -238,6 +238,8 @@ viewof pointdata = {
238238

239239
:::
240240

241+
The number of locations in the file is: ${pointdata.length}.
242+
241243
The click point ID is "${clickedPointId}".
242244

243245
```{ojs}
@@ -249,3 +251,38 @@ ${JSON.stringify(selectedGeoRecord, null, 2)}
249251
```
250252

251253

254+
255+
## Object Type Counts
256+
257+
The distribution of object types (`otype`) in the dataset:
258+
259+
```{ojs}
260+
//| code-fold: true
261+
otypeCounts = {
262+
const query = `SELECT otype, COUNT(*) as count FROM nodes GROUP BY otype ORDER BY count DESC`;
263+
const data = await loadData(query, [], "loading_otype");
264+
return data;
265+
}
266+
```
267+
268+
<div id="loading_otype">Loading object type counts...</div>
269+
270+
```{ojs}
271+
//| code-fold: true
272+
viewof otypeTable = {
273+
const data_table = Inputs.table(otypeCounts, {
274+
header: {
275+
otype: "Object Type",
276+
count: "Count"
277+
},
278+
format: {
279+
count: d => d.toLocaleString()
280+
}
281+
});
282+
return data_table;
283+
}
284+
```
285+
286+
Total records by object type: ${otypeCounts.reduce((sum, row) => sum + row.count, 0).toLocaleString()}
287+
288+

0 commit comments

Comments
 (0)