Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ags_grabber
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Larkin Heintzman
ags_grabber
Commits
515ff84a
Commit
515ff84a
authored
Oct 29, 2020
by
Larkin Heintzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
terrain collection bug fixes
parent
84ddfa50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
31 deletions
+23
-31
arcgis_terrain.py
arcgis_terrain.py
+7
-4
feature_set.py
feature_set.py
+16
-27
No files found.
arcgis_terrain.py
View file @
515ff84a
...
...
@@ -177,14 +177,17 @@ def get_terrain_map(lat_lon = [0,0], sample_dist = 10, extent = 100, heading = 0
qs
=
np
.
stack
([
xs
.
reshape
(
len
(
elv_samples
)),
ys
.
reshape
(
len
(
elv_samples
))])
.
T
es
=
es
.
reshape
(
len
(
elv_samples
))
# data came back in weird ordering, need to re-order
#
print("re-ordering data ...")
print
(
"re-ordering data ..."
)
es_square
=
np
.
zeros
([
sc
,
sc
])
for
scx
in
range
(
sc
):
for
scy
in
range
(
sc
):
# maybe the least efficient way to do this
idx
=
np
.
where
(
np
.
all
(
qs
==
np
.
asarray
([
X
[
scx
,
scy
],
Y
[
scx
,
scy
]]),
axis
=
1
))
es_square
[
scx
,
scy
]
=
es
[
idx
]
idx
=
np
.
where
(
np
.
all
(
np
.
abs
(
qs
-
np
.
asarray
([
X
[
scx
,
scy
],
Y
[
scx
,
scy
]]))
<=
1e-9
,
axis
=
1
))
try
:
es_square
[
scx
,
scy
]
=
es
[
idx
]
except
ValueError
as
e
:
print
(
"hellfire"
)
es
=
es_square
#
print("done re-ordering")
print
(
"done re-ordering"
)
# then just the tuple of all
data_temp
=
[]
...
...
feature_set.py
View file @
515ff84a
...
...
@@ -38,6 +38,7 @@ def grab_features(anchor_point, extent, sample_dist = 10, heading = 0, save_file
gis
=
GIS
(
username
=
"larkinheintzman"
,
password
=
"Meepp97#26640"
)
# linked my arcgis pro account
ap_meters
=
lat_lon2meters
(
anchor_point
[
0
],
anchor_point
[
1
])
# print(ap_meters)
scale_factor
=
3
/
20
# factor to get 6.66667m mapping from 1m mapping (1/6.6667)
scaled_extent
=
np
.
ceil
(
scale_factor
*
extent
)
.
astype
(
np
.
int
)
...
...
@@ -228,31 +229,18 @@ def grab_features(anchor_point, extent, sample_dist = 10, heading = 0, save_file
if
__name__
==
"__main__"
:
# read in ics from csv sheet
# ics = []
# with open('lp_data/DD.DDD WGS Coordinates_cleaned.xlsx - DD Format.csv') as f:
# reader = csv.reader(f)
# for row_num, row in enumerate(reader):
# if 'Hiker' in row[8]:
# # check for nearby find point
# init = lat_lon2meters(float(row[19]), float(row[20]))
# find = lat_lon2meters(float(row[21]), float(row[22]))
# if np.linalg.norm(np.array(find) - np.array(init)) <= 5000:
# ics.append([row[19], row[20], row_num+1])
# ics = [[36.660460, -81.543921, 'grayson'],
# [37.197730, -80.585233, 'kentland'],
# [36.891640, -81.524214, 'hmpark']]
# BrownMtn-hiker VA hikers -78.65848 38.29288 495 -78.65809 38.29254 2 people
# DevilsDitch_hikers VA Hikers -78.46993 38.44706 653 -78.43693 38.44311 2 people
# Punchbowl_hiker VA Hiker -79.33887 37.67752 593 -79.40187 37.6163
# BiscuitRun_hikers VA Hikers -78.52798 37.99092 55 -78.52562 37.98698 2 people
ics
=
[[
-
78.65848
,
38.29288
,
'BrownMtn'
],
[
-
78.46993
,
38.44706
,
'DevilsDitch'
],
[
-
79.33887
,
37.67752
,
'Punchbowl'
],
[
-
78.52798
,
37.99092
,
'BiscuitRun'
]]
ics
=
[
[
38.29288
,
-
78.65848
,
'BrownMtn-hiker'
],
[
38.44706
,
-
78.46993
,
'DevilsDitch_hikers'
],
[
37.67752
,
-
79.33887
,
'Punchbowl_hiker'
],
[
37.99092
,
-
78.52798
,
'BiscuitRun_hikers'
],
[
38.24969
,
-
78.39555
,
'Quinque_dementia'
],
[
38.55209
,
-
78.32099
,
'OldRag'
],
[
38.20656
,
-
78.67878
,
'BrownsCove'
],
[
38.02723
,
-
78.45076
,
'Charlottesville_dementia'
],
[
34.12751
,
-
116.93247
,
'SanBernardinoPeak'
]
,
]
base_dir
=
'C:/Users/Larkin/ags_grabber'
eng
=
matlab
.
engine
.
start_matlab
()
# engine for running matlab
...
...
@@ -260,7 +248,7 @@ if __name__ == "__main__":
for
i
,
ics_pt
in
enumerate
(
ics
):
anchor_point
=
[
float
(
ics_pt
[
0
]),
float
(
ics_pt
[
1
])]
extent
=
1
0
e3
extent
=
1
5
e3
save_flag
=
True
plot_flag
=
False
file_extension
=
'temp'
...
...
@@ -273,7 +261,8 @@ if __name__ == "__main__":
time
.
sleep
(
1
)
# wait for... files to settle?
# run matlab
res
=
eng
.
importmap_py
(
str
(
ics_pt
[
2
]),
base_dir
)
if
save_flag
:
res
=
eng
.
importmap_py
(
str
(
ics_pt
[
2
]),
base_dir
)
print
(
"------- total time = {} seconds, iteration {}/{} ------"
.
format
(
time
.
time
()
-
start_time
,
i
,
len
(
ics
)))
eng
.
quit
()
\ No newline at end of file
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