WSL/SLF GitLab Repository

Commit 2c5fbb8d authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Fixed a bug in gridify(): cells exactly on the upper/right border where not...

Fixed a bug in gridify(): cells exactly on the upper/right border where not marked as invalid (thanks Aurélien!)
parent d43cbfad
......@@ -287,7 +287,7 @@ bool Grid2DObject::WGS84_to_grid(Coords& point) const {
i=0;
status=false;
}
if (i>(signed)getNx()) {
if (i>=(signed)getNx()) {
i=(signed)getNx();
status=false;
}
......@@ -295,7 +295,7 @@ bool Grid2DObject::WGS84_to_grid(Coords& point) const {
j=0;
status=false;
}
if (j>(signed)getNy()) {
if (j>=(signed)getNy()) {
j=(signed)getNy();
status=false;
}
......
......@@ -300,7 +300,7 @@ bool Grid3DObject::WGS84_to_grid(Coords point) const
i=0;
status=false;
}
if (i>(signed)grid3D.getNx()) {
if (i>=(signed)grid3D.getNx()) {
i=(signed)grid3D.getNx();
status=false;
}
......@@ -308,7 +308,7 @@ bool Grid3DObject::WGS84_to_grid(Coords point) const
j=0;
status=false;
}
if (j>(signed)grid3D.getNy()) {
if (j>=(signed)grid3D.getNy()) {
j=(signed)grid3D.getNy();
status=false;
}
......@@ -316,7 +316,7 @@ bool Grid3DObject::WGS84_to_grid(Coords point) const
k=0;
status=false;
}
if (k>(signed)grid3D.getNz()) {
if (k>=(signed)grid3D.getNz()) {
k=(signed)grid3D.getNz();
status=false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment