kopia lustrzana https://github.com/OpenDroneMap/WebODM
commit
1c6912a30e
|
@ -121,24 +121,41 @@ class ModelView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadGeoreferencingOffset = (cb) => {
|
loadGeoreferencingOffset = (cb) => {
|
||||||
$.ajax({
|
const geoFile = `${this.assetsPath()}/odm_georeferencing/coords.txt`;
|
||||||
url: `${this.assetsPath()}/odm_georeferencing/odm_georeferencing_model_geo.txt`,
|
const legacyGeoFile = `${this.assetsPath()}/odm_georeferencing/odm_georeferencing_model_geo.txt`;
|
||||||
type: 'GET',
|
const getGeoOffsetFromUrl = (url) => {
|
||||||
error: () => {
|
$.ajax({
|
||||||
console.warn("Cannot find odm_georeferencing_model_geo.txt (not georeferenced?)")
|
url: url,
|
||||||
cb({x: 0, y: 0});
|
type: 'GET',
|
||||||
},
|
error: () => {
|
||||||
success: (data) => {
|
console.warn(`Cannot find ${url} (not georeferenced?)`);
|
||||||
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}`);
|
|
||||||
cb({x: 0, y: 0});
|
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) => {
|
pointCloudFilePath = (cb) => {
|
||||||
|
|
Ładowanie…
Reference in New Issue