Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(website): add GeoParquet datasets #2786

Merged
merged 2 commits into from
Nov 16, 2023
Merged
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
114 changes: 98 additions & 16 deletions examples/website/geospatial/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const INITIAL_MAP_STYLE =
'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json';

export const LOADERS_URI = 'https://raw.githubusercontent.com/visgl/loaders.gl/master';
const DECKGL_DATA_URI = 'https://raw.githubusercontent.com/visgl/deck.gl-data/master';
const PARQUET_PATH = '/formats/geoparquet';

const VIEW_STATE = {
height: 600,
Expand All @@ -28,31 +30,91 @@ export type Example = {
viewState: Record<string, number>;
};

export const EXAMPLES: Record<string, Record<string, Example>> = {
GeoParquet: {
Airports: {
// Add Geoparquet datasets
const GeoParquet: Record<string, Example> = {
Airports: {
format: 'geoparquet',
data: `${LOADERS_URI}/modules/parquet/test/data/geoparquet/airports.parquet`,
viewState: {
...VIEW_STATE,
longitude: -4.65,
latitude: -29.76,
zoom: 1.76
}
},
NZBuildingFootprints: {
format: 'geoparquet',
data: 'https://storage.googleapis.com/open-geodata/linz-examples/nz-building-outlines.parquet',
viewState: {
latitude: 47.65,
longitude: 7,
zoom: 4.5,
maxZoom: 20,
maxPitch: 89,
bearing: 0
}
}
};
const compressions = ['snappy', 'gzip', 'brotli', 'no_compression'];
const PARQUET_VERSION = '0.4.0';
const parquetExtension = '.parquet';
const files = [
{name: 'Countries', urlPrefix: 'countries/countries', hasZstd: true},
{name: 'Major rivers', urlPrefix: 'major-rivers/major-rivers'},
{
name: 'Fort Collins streets',
urlPrefix: 'fort-collins-streets/fort-collins-streets',
hasZstd: true,
viewState: {
longitude: -105.1003626,
latitude: 40.5529294,
zoom: 13
}
},
{
name: 'Fort Collins address',
urlPrefix: 'fort-collins-address/fort-collins-address',
viewState: {
longitude: -105.1003626,
latitude: 40.5529294,
zoom: 13
}
}
];
for (const file of files) {
const {name, urlPrefix, hasZstd, viewState} = file;
for (const compression of compressions) {
const data = `${DECKGL_DATA_URI}${PARQUET_PATH}/${urlPrefix}_${PARQUET_VERSION}_${compression}${parquetExtension}`;
GeoParquet[`${name} (${compression})`] = {
format: 'geoparquet',
data: `${LOADERS_URI}/modules/parquet/test/data/geoparquet/airports.parquet`,
data,
viewState: {
...VIEW_STATE,
longitude: -4.65,
latitude: -29.76,
zoom: 1.76
zoom: 1.76,
...viewState
}
},
NZBuildingFootprints: {
};
}
if (hasZstd) {
const data = `${DECKGL_DATA_URI}${PARQUET_PATH}/${urlPrefix}_zstd${parquetExtension}`;
GeoParquet[`${name} (zstd)`] = {
format: 'geoparquet',
data: 'https://storage.googleapis.com/open-geodata/linz-examples/nz-building-outlines.parquet',
data,
viewState: {
latitude: 47.65,
longitude: 7,
zoom: 4.5,
maxZoom: 20,
maxPitch: 89,
bearing: 0
...VIEW_STATE,
longitude: -4.65,
latitude: -29.76,
zoom: 1.76,
...viewState
}
}
},
};
}
}

export const EXAMPLES: Record<string, Record<string, Example>> = {
GeoParquet,
GeoJSON: {
Vancouver: {
format: 'geojson',
Expand All @@ -62,6 +124,26 @@ export const EXAMPLES: Record<string, Record<string, Example>> = {
latitude: 49.254,
longitude: -123.13
}
},
Countries: {
format: 'geojson',
data: 'http://localhost:5173/countries.geojson',
viewState: {
...VIEW_STATE,
longitude: -4.65,
latitude: -29.76,
zoom: 1.76
}
},
Streets: {
format: 'geojson',
data: 'http://localhost:5173/streets.geojson',
viewState: {
...VIEW_STATE,
longitude: -4.65,
latitude: -29.76,
zoom: 1.76
}
}
},
GeoPackage: {
Expand Down
Loading