Skip to content

Commit

Permalink
Allow .geoparquet extension
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Jul 20, 2023
1 parent 0c09045 commit 083056f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class Upload extends LitElement {
@change="${this._handleChange}"
type="file"
type="file"
accept=".parquet, .geojson, .json, application/json"
accept=".parquet, .geoparquet, .geojson, .json, application/json"
aria-label="File upload"
/>
<span class="file-custom"></span>
Expand Down Expand Up @@ -379,7 +379,7 @@ class Converter extends LitElement {

this._working = `Converting ${file.name} (${formatSize(file.size)})...`;
try {
if (file.name.endsWith('.parquet')) {
if (file.name.endsWith('parquet')) {
output = fromParquet(await getParquetData(file));
extension = '.geojson';
blobOptions = {type: 'application/geo+json'};
Expand All @@ -394,7 +394,9 @@ class Converter extends LitElement {
const plural = output.records === 1 ? '' : 's';
summary = `${output.records} row${plural}, ${size}`;
} else {
throw new Error('Only works with .parquet, .geojson, and .json files');
throw new Error(
'Only works with .parquet, .geoparquet, .geojson, and .json files'
);
}
} catch (err) {
this._error = err;
Expand Down

0 comments on commit 083056f

Please sign in to comment.