Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 2 additions & 6 deletions functions/src/import-geojson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function importGeoJsonCallback(
}
})
.on('data', (data: any) => {
if (!hasError) onGeoJsonFeature(data, surveyId, jobId);
if (!hasError) onGeoJsonFeature(data, jobId);
})
);
} catch (err) {
Expand Down Expand Up @@ -187,11 +187,7 @@ export function importGeoJsonCallback(
* GeoJSON Feature objects within the file. It checks the feature type, geometry
* validity, and converts the feature to a document data format for insertion.
*/
function onGeoJsonFeature(
geoJsonFeature: any,
surveyId: string,
jobId: string
) {
function onGeoJsonFeature(geoJsonFeature: any, jobId: string) {
if (geoJsonFeature.type !== 'Feature') {
console.debug(
`Skipping Feature with invalid type ${geoJsonFeature.type}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ <h2 mat-dialog-title>
>
</h2>
<mat-dialog-content>
<p
class="format-description"
i18n="@@app.dialogs.importSites.formatDescription"
>
Upload a GeoJSON <code>FeatureCollection</code>. Coordinates must use the
WGS84 (CRS84) coordinate reference system, the only projection currently
supported. Each feature's <code>name</code> property sets the site name,
and the feature's top-level <code>id</code> sets the site ID.
</p>
<form [formGroup]="uploadForm">
<div>
<file-upload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ file-upload {
width: 300px;
}

.format-description {
max-width: 300px;
margin: 0 0 16px;
font-size: 14px;
line-height: 1.4;
color: rgba(0, 0, 0, 0.6);

code {
font-family: monospace;
}
}

.spinner {
margin: 0px auto;
}
1 change: 1 addition & 0 deletions web/src/locale/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"app.labels.termsOfService": "Terms of service",
"app.dialogs.importSites.importingSites": "Importing sites...",
"app.dialogs.importSites.title": "Import data collection sites (.geojson)",
"app.dialogs.importSites.formatDescription": " Upload a GeoJSON {$START_TAG_CODE}FeatureCollection{$CLOSE_TAG_CODE}. Coordinates must use the WGS84 (CRS84) coordinate reference system, the only projection currently supported. Each feature's {$START_TAG_CODE}name{$CLOSE_TAG_CODE} property sets the site name, and the feature's top-level {$START_TAG_CODE}id{$CLOSE_TAG_CODE} sets the site ID. ",
"app.labels.upload": "Upload",
"app.labels.downloadCsv": "Download job data (CSV)",
"app.labels.downloadGeojson": "Download site locations (GeoJSON)",
Expand Down
Loading