Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
caddies
caddies-api
Commits
75be44fa
Commit
75be44fa
authored
Sep 21, 2016
by
mjg226
Browse files
added a function ESRI_ASCIIGrid to retrieve the cell by coordinates
parent
02099f50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
impls/square-cell/vn-neighbours/1-levels/simple/ESRI_ASCIIGrid.hpp
...are-cell/vn-neighbours/1-levels/simple/ESRI_ASCIIGrid.hpp
+29
-2
No files found.
impls/square-cell/vn-neighbours/1-levels/simple/ESRI_ASCIIGrid.hpp
View file @
75be44fa
...
...
@@ -932,9 +932,36 @@ namespace CA {
}
}
// end of copyData
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
inline
T
getCellByCords
(
double
XCord
,
double
YCord
)
{
int
XCol
=
int
(
XCord
-
AsciiGridGeneral
<
T
>::
xllcorner
)
/
AsciiGridGeneral
<
T
>::
cellsize
;
// note , cords go from bottom left and rows,cols go grom top left, therefore need to flip this...
//int YRow = int(YCord - AsciiGridGeneral<T>::yllcorner) / AsciiGridGeneral<T>::cellsize;
int
YRow
=
AsciiGridGeneral
<
T
>::
nrows
-
(
int
(
YCord
-
AsciiGridGeneral
<
T
>::
yllcorner
)
/
AsciiGridGeneral
<
T
>::
cellsize
);
T
returnResult
=
AsciiGridGeneral
<
T
>::
data
[
XCol
+
(
AsciiGridGeneral
<
T
>::
ncols
*
YRow
)];
std
::
cout
<<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
<<
std
::
endl
;
std
::
cout
<<
"Local Cords ["
<<
XCol
<<
","
<<
YRow
<<
"]: "
<<
returnResult
<<
std
::
endl
;
std
::
cout
<<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
<<
std
::
endl
;
return
returnResult
;
}
// end of getCellByCords
//--------------------------------------------------------------------------------------------------------------
};
// end of class
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment