kopia lustrzana https://github.com/OpenDroneMap/WebODM
Add geolocation file download from map preview
rodzic
a8552b9722
commit
e2eafe0507
|
@ -66,7 +66,7 @@ export default class ExportAssetPanel extends React.Component {
|
|||
},
|
||||
'csv': {
|
||||
label: "CSV",
|
||||
icon: "fa fa-file-text"
|
||||
icon: "fas fa-file-alt"
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -511,6 +511,10 @@ _('Example:'),
|
|||
download = format => {
|
||||
let output = "";
|
||||
let filename = `images.${format}`;
|
||||
if (format === "geo"){
|
||||
filename = "geo.txt";
|
||||
}
|
||||
|
||||
const feats = {
|
||||
type: "FeatureCollection",
|
||||
features: this.exifData.map(ed => {
|
||||
|
@ -538,6 +542,10 @@ _('Example:'),
|
|||
output = `Filename,Timestamp,Latitude,Longitude,Altitude\r\n${feats.features.map(feat => {
|
||||
return `${feat.properties.Filename},${feat.properties.Timestamp},${feat.geometry.coordinates[1]},${feat.geometry.coordinates[0]},${feat.geometry.coordinates[2]}`
|
||||
}).join("\r\n")}`;
|
||||
}else if (format === 'geo'){
|
||||
output = `EPSG:4326\r\n${feats.features.map(feat => {
|
||||
return `${feat.properties.Filename} ${feat.geometry.coordinates[0]} ${feat.geometry.coordinates[1]} ${feat.geometry.coordinates[2]}`
|
||||
}).join("\r\n")}`;
|
||||
}else{
|
||||
console.error("Invalid format");
|
||||
}
|
||||
|
@ -569,6 +577,7 @@ _('Example:'),
|
|||
<li>
|
||||
<a href="javascript:void(0);" onClick={() => this.download('geojson')}><i className="fas fa-map fa-fw"></i> GeoJSON</a>
|
||||
<a href="javascript:void(0);" onClick={() => this.download('csv')}><i className="fas fa-file-alt fa-fw"></i> CSV</a>
|
||||
<a href="javascript:void(0);" onClick={() => this.download('geo')}><i className="fas fa-file-alt fa-fw"></i> Geolocation File</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> : ""}
|
||||
|
|
Ładowanie…
Reference in New Issue