Skip to content

Commit

Permalink
MMGIS-1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Jul 7, 2020
1 parent 8f71208 commit 5554fd2
Show file tree
Hide file tree
Showing 51 changed files with 29,493 additions and 28,194 deletions.
896 changes: 448 additions & 448 deletions API/Backend/Config/routes/configs.js

Large diffs are not rendered by default.

2,994 changes: 1,497 additions & 1,497 deletions API/Backend/Draw/routes/draw.js

Large diffs are not rendered by default.

3,316 changes: 1,656 additions & 1,660 deletions API/Backend/Draw/routes/files.js

Large diffs are not rendered by default.

149 changes: 87 additions & 62 deletions API/templates/config_template.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module.exports = {
msv: {
mission: "TEMPLATE",
mission: "Test",
site: "",
masterdb: false,
view: ["0", "0", "0"],
radius: {
major: "3396190",
minor: "3396190"
}
minor: "3396190",
},
mapscale: "",
},
projection: {
custom: false,
Expand All @@ -18,33 +19,41 @@ module.exports = {
bounds: ["", "", "", ""],
origin: ["", ""],
reszoomlevel: "",
resunitsperpixel: ""
resunitsperpixel: "",
},
look: {
pagename: "MMGIS",
minimalist: false,
zoomcontrol: false,
graticule: false,
bodycolor: "",
topbarcolor: "",
toolbarcolor: "",
mapcolor: ""
mapcolor: "",
swap: true,
copylink: true,
screenshot: true,
fullscreen: true,
help: true,
logourl: "",
helpurl: "",
},
panels: ["viewer", "map", "globe"],
tools: [
{
name: "Layers",
icon: "buffer",
js: "LayersTool"
js: "LayersTool",
},
{
name: "Legend",
icon: "format-list-bulleted-type",
js: "LegendTool"
js: "LegendTool",
},
{
name: "Info",
icon: "information-variant",
js: "InfoTool"
js: "InfoTool",
},
{
name: "Sites",
Expand All @@ -55,49 +64,30 @@ module.exports = {
{
name: "Site1",
code: "S1",
view: [-4.667975771815966, 137.370253354311, 16]
view: [-4.667975771815966, 137.370253354311, 16],
},
{
name: "Site2",
code: "S2",
view: [-4.667985128408622, 137.3702734708786, 20]
}
]
}
},
{
name: "FileManager",
icon: "folder-multiple",
js: "FileManagerTool"
view: [-4.667985128408622, 137.3702734708786, 20],
},
],
},
},
{
name: "Measure",
icon: "chart-areaspline",
js: "MeasureTool",
variables: {
dem: "Data/missionDEM.tif"
}
name: "Chemistry",
icon: "flask",
js: "ChemistryTool",
},
{
name: "Draw",
icon: "lead-pencil",
js: "DrawTool"
},
{
name: "Chemistry",
icon: "flask",
js: "ChemistryTool"
js: "DrawTool",
},
{
name: "Search",
icon: "eye",
js: "SearchTool",
variables: {
searchfields: {
ChemCam: "(TARGET) round(Sol)",
Waypoints: "round(sol)"
}
}
name: "FileManager",
icon: "folder-multiple",
js: "FileManagerTool",
},
{
name: "Identifier",
Expand All @@ -106,62 +96,82 @@ module.exports = {
variables: {
"Tile with DEM": {
url: "Data/missionDEM.tif",
unit: "m"
}
}
}
unit: "m",
},
},
},
{
name: "Measure",
icon: "chart-areaspline",
js: "MeasureTool",
variables: {
dem: "Data/missionDEM.tif",
},
},
],
layers: [
{
name: "A Header",
type: "header",
initialOpacity: 1,
sublayers: [
{
name: "S1 Drawings",
kind: "none",
type: "vector",
url: "Drawn/S1_speDrawings.geojson",
tms: true,
visibility: false,
initialOpacity: 1,
togglesWithHeader: true,
style: {
className: "s1drawings",
color: "undefined",
fillColor: "undefined",
weight: null,
fillOpacity: 1,
opacity: 1
opacity: 1,
},
radius: 1
variables: {},
radius: 1,
},
{
name: "S2 Drawings",
kind: "none",
type: "vector",
url: "Drawn/S2_speDrawings.geojson",
tms: true,
visibility: false,
initialOpacity: 1,
togglesWithHeader: true,
style: {
className: "s2drawings",
color: "undefined",
fillColor: "undefined",
weight: null,
fillOpacity: 1,
opacity: 1
opacity: 1,
},
radius: 1
variables: {},
radius: 1,
},
{
name: "ChemCam",
kind: "none",
type: "vector",
url: "Layers/ChemCam/chemcam.json",
tms: true,
visibility: true,
visibilitycutoff: 17,
initialOpacity: 1,
togglesWithHeader: true,
style: {
className: "chemcam",
color: "prop:color1",
fillColor: "prop:color3",
weight: 2,
fillOpacity: 1,
opacity: 1
opacity: 1,
},
variables: {
useKeyAsName: "TARGET",
Expand All @@ -173,72 +183,87 @@ module.exports = {
"MgO",
"Na2O",
"SiO2",
"TiO2"
]
"TiO2",
],
search: "(TARGET)",
},
radius: 5
radius: 5,
},
{
name: "Waypoints",
kind: "none",
type: "vector",
url: "Layers/Waypoints/waypoints.json",
legend: "Layers/Waypoints/legend.csv",
tms: true,
visibility: true,
initialOpacity: 1,
togglesWithHeader: true,
style: {
className: "waypoints",
color: "white",
fillColor: "#000",
weight: 2,
fillOpacity: 1,
opacity: 1
opacity: 1,
},
radius: 8
variables: {},
radius: 8,
},
{
name: "Polygon",
kind: "none",
type: "vector",
url: "Layers/Polygon/polygon.geojson",
tms: true,
visibility: false,
initialOpacity: 1,
togglesWithHeader: true,
style: {
className: "polygon",
color: "prop:somecolor",
fillColor: "prop:fill",
weight: 2,
fillOpacity: 0.7,
opacity: 1
opacity: 1,
},
radius: 4
variables: {},
radius: 4,
},
{
name: "Line",
kind: "none",
type: "vector",
url: "Layers/Line/line.json",
tms: true,
visibility: false,
initialOpacity: 1,
togglesWithHeader: true,
style: {
className: "line",
color: "white",
fillColor: "white",
weight: 5,
fillOpacity: 1,
opacity: 1
opacity: 1,
},
radius: 1
variables: {},
radius: 1,
},
{
name: "Tile with DEM",
type: "tile",
url: "Layers/TilewithDEM/Gale_HiRISE/{z}/{x}/{y}.png",
demtileurl: "Layers/TilewithDEM/Gale_HiRISE_DEM/{z}/{x}/{y}.png",
tms: true,
visibility: true,
initialOpacity: 1,
togglesWithHeader: true,
minZoom: 16,
maxNativeZoom: 17,
maxZoom: 22
}
]
}
]
maxZoom: 22,
},
],
},
],
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Spatial Data Infrastructure for Planetary Missions

1. Run `install.sh` within `/`
`./install.sh`
(If you can't run install, just copy `/prepare/base/Missions` to `/Missions`)
(If you can't run install, just copy `/prepare/base/Missions` to `/Missions` and copy `/prepare/base/config/configconfig.json` to `/config/configconfig.json`)

1. Copy `/sample.env` to `.env`
`cp sample.env .env`
Expand Down
63 changes: 63 additions & 0 deletions auxiliary/populateMosaics/populateMosaics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// node populateMosaics.js [input json] [mosaic parameters csv] [url prefix] [output json]
// [input json] is a geojson where each feature has the properties "sol", "site" and "pos"
// [mosaic parameters csv] has the following header: mos_name,rows,columns,azmin,azmax,elmin,elmax,elzero
// [url prefix]
// [output json] writes the mosaic features[i].properties.images
//
// use npm to install csv-parser

const csv = require("csv-parser");
const fs = require("fs");

const input = process.argv[2];
const parameters = process.argv[3];
const prefix = process.argv[4];
const output = process.argv[5];

let csvrows = {};

fs.createReadStream(parameters)
.pipe(csv())
.on("data", (row) => {
const sol = parseInt(row.mos_name.substr(7, 4));
const site = parseInt(row.mos_name.substr(15, 3));
const pos = parseInt(row.mos_name.substr(24, 4));
const id = sol + "_" + site + "_" + pos;

csvrows[id] = row;
})
.on("end", () => {
let geojson = JSON.parse(fs.readFileSync(input, "utf8"));

geojson.features.forEach((element) => {
const p = element.properties;

const sol = parseInt(p.sol);
const site = parseInt(p.site);
const pos = parseInt(p.pos);
const id = sol + "_" + site + "_" + pos;

p.images = p.images || [];

if (csvrows[id]) {
const c = csvrows[id];
// delete the existing image with same url if any
p.images = p.images.filter((v) => v.name != c.mos_name);
p.images.push({
name: c.mos_name,
isPanoramic: true,
url: prefix + c.mos_name + ".jpg",
rows: c.rows,
columns: c.columns,
azmin: c.azmin,
azmax: c.azmax,
elmin: c.elmin,
elmax: c.elmax,
elzero: c.elzero,
});
}
});
fs.writeFile(output, JSON.stringify(geojson), "utf8", () => {
console.log("Successfully populated mosaic images into " + output + "!");
});
});
Loading

0 comments on commit 5554fd2

Please sign in to comment.