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

Add GeoParquet link to Data Catalog #16453

Merged
merged 6 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@
</router-link>
</p>
</li>
<li
class="u-mb--32 u-mb--12--tablet"
v-if="hasGeoparquetAvailable"
>
<h4 class="text is-small is-txtSoftGrey u-mb--10">
GeoParquet
</h4>
<p class="text is-caption">
<a class="underline" :href="geoparquetUrl" target="_blank">Download</a>
</p>
</li>
</ul>
</div>
</div>
Expand All @@ -112,13 +123,20 @@ import { temporalAggregationName } from 'new-dashboard/utils/catalog/temporal-ag
import { geometryTypeName } from 'new-dashboard/utils/catalog/geometry-type-name';
import { updateFrequencyName } from 'new-dashboard/utils/catalog/update-frequency-name';
import { sendCustomDimensions } from 'new-dashboard/utils/catalog/custom-dimensions-ga';
import { checkGeoparquetBucket } from 'new-dashboard/utils/catalog/geoparquet';
import CatalogMapPreview from 'new-dashboard/components/Catalog/CatalogMapPreview';

export default {
name: 'CatalogDatasetSummary',
components: {
CatalogMapPreview
},
data () {
return {
hasGeoparquetAvailable: false,
geoparquetUrl: undefined
};
},
watch: {
dataset: {
handler (value) {
Expand Down Expand Up @@ -169,10 +187,16 @@ export default {
id: this.$route.params.entity_id,
type: this.$route.params.entity_type
});
},
async checkIfGeoparquetBucketExists () {
const { ok, url } = await checkGeoparquetBucket(this.$route.params.entity_id);
this.hasGeoparquetAvailable = ok;
this.geoparquetUrl = url;
}
},
mounted () {
this.fetchKeyVariables();
this.checkIfGeoparquetBucketExists();
}
};
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export async function checkGeoparquetBucket (dataset) {
try {
const url = `https://storage.googleapis.com/geoparquet/carto/${dataset}.parquet`;
const response = await fetch(url, { method: 'HEAD' });
return { ok: response.ok, url };
} catch (e) {
return { ok: false };
}
}
Loading