kopia lustrzana https://github.com/OpenDroneMap/WebODM
commit
1c6912a30e
|
@ -121,24 +121,41 @@ class ModelView extends React.Component {
|
|||
}
|
||||
|
||||
loadGeoreferencingOffset = (cb) => {
|
||||
$.ajax({
|
||||
url: `${this.assetsPath()}/odm_georeferencing/odm_georeferencing_model_geo.txt`,
|
||||
type: 'GET',
|
||||
error: () => {
|
||||
console.warn("Cannot find odm_georeferencing_model_geo.txt (not georeferenced?)")
|
||||
cb({x: 0, y: 0});
|
||||
},
|
||||
success: (data) => {
|
||||
const lines = data.split("\n");
|
||||
if (lines.length >= 2){
|
||||
const [ x, y ] = lines[1].split(" ").map(parseFloat);
|
||||
cb({x, y});
|
||||
}else{
|
||||
console.warn(`Malformed odm_georeferencing_model_geo.txt: ${data}`);
|
||||
const geoFile = `${this.assetsPath()}/odm_georeferencing/coords.txt`;
|
||||
const legacyGeoFile = `${this.assetsPath()}/odm_georeferencing/odm_georeferencing_model_geo.txt`;
|
||||
const getGeoOffsetFromUrl = (url) => {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
error: () => {
|
||||
console.warn(`Cannot find ${url} (not georeferenced?)`);
|
||||
cb({x: 0, y: 0});
|
||||
},
|
||||
success: (data) => {
|
||||
const lines = data.split("\n");
|
||||
if (lines.length >= 2){
|
||||
const [ x, y ] = lines[1].split(" ").map(parseFloat);
|
||||
cb({x, y});
|
||||
}else{
|
||||
console.warn(`Malformed georeferencing file: ${data}`);
|
||||
cb({x: 0, y: 0});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "HEAD",
|
||||
url: legacyGeoFile
|
||||
}).done(() => {
|
||||
// If a legacy georeferencing file is present
|
||||
// we'll use that
|
||||
getGeoOffsetFromUrl(legacyGeoFile);
|
||||
}).fail(() => {
|
||||
getGeoOffsetFromUrl(geoFile);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
pointCloudFilePath = (cb) => {
|
||||
|
|
Ładowanie…
Reference in New Issue