This sample uses the ParquetLayer to display a sample parquet file in a Map. The ParquetLayer enables visualization of Parquet files and is a columnar storage format optimized for efficiently handling big data and distributed environments. Its columnar structure, compression capabilities, and schema support make it ideal for analytics and query-heavy workloads.
Creating a ParquetLayer
To create a ParquetLayer, set the urls property to one or more Parquet files that share the same geometry type and column schema. Parquet files must use either GZIP or Snappy compression, or be uncompressed.
The geometry encoding is automatically detected if the file contains Geoparquet metadata. If metadata is not present, the layer attempts to infer geometry from columns latitude and longitude values. If this automatic detection fails, the encoding must be specified manually.
In this example, we load a GZIP-compressed Parquet file containing LONGITUDE
and LATITUDE
fields for each water well in Kansas. Given the clear definition of these fields, the geometry is automatically detected, and the layer is configured seamlessly.
// create a ParquetLayer instance and add it to the map
// kansas water wells parquet file (gzip compressed and location encoded)
const layer = new ParquetLayer({
urls: [
"https://jsapi.maps.arcgis.com/sharing/rest/content/items/6ab6f959c1684eb5a54db91644a89747/data",
],
title: "Kansas water wells",
orderBy: [
{
field: "DEPTH_OF_COMPLETED_WELL",
order: "descending",
},
],
effect: "drop-shadow(2px, 2px, 2px, lightgray)",
renderer: createClassBreaksRenderer(),
popupTemplate: {
title: "Water well info",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "COUNTY",
label: "County",
},
{
fieldName: "LOCATION_DIRECTIONS",
label: "Directions to location",
},
{
fieldName: "STATUS",
label: "Status",
},
{
fieldName: "USE_DESC",
label: "Usage description",
},
{
fieldName: "ESTIMETED_YIELD",
label: "Estimated yield",
},
{
fieldName: "DEPTH_OF_COMPLETED_WELL",
label: "Depth of well (ft)",
},
{
fieldName: "FILE_URL",
label: "Well file",
},
{
fieldName: "KGS_URL",
label: "Kansas Geological Survery info",
},
],
},
],
},
});