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
Bryson Howell
ags_grabber
Commits
acb5bb2d
Commit
acb5bb2d
authored
Jul 18, 2024
by
Bryson Howell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying to get feature layers to query.
parent
1bf267c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
feature_set.py
feature_set.py
+5
-1
lpm_maps.py
lpm_maps.py
+12
-0
No files found.
feature_set.py
View file @
acb5bb2d
...
...
@@ -44,7 +44,10 @@ def grab_features(anchor_point, extent, sample_dist = 10, case_name = 'blah', he
name_list
=
[
'rivers_bdd'
,
'rivers'
,
'roads'
,
'lakes'
,
'powerlines'
,
'railroads'
,
'trails'
]
inac_layers
=
[
'rivers_bdd'
,
'lakes'
]
gis
=
GIS
(
api_key
=
"AAPKe7cb1ab4f2ba44748cf53ac4f30d0caavu5t_-uMdWP8SRjtoea3s66-cRyFZmMTNx4rqy2w5sjwegU_tbJyBesd0LCMmdtV"
)
# linked Bryson's pro account
ky
=
"AAPKe7cb1ab4f2ba44748cf53ac4f30d0caavu5t_-uMdWP8SRjtoea3s66-cRyFZmMTNx4rqy2w5sjwegU_tbJyBesd0LCMmdtV"
tkn
=
"3NKHt6i2urmWtqOuugvr9ZEfiuh0-3Amg_JW92hWw6MrRjQKzJfjBbFhwGtOqYD3IEnYsljGDxUWTXa4b2HGR9WawiS9jXoVzqX7qF3-y5y3jPSTTL5TYKO8tHiitpqK"
gis
=
GIS
(
token
=
tkn
,
api_key
=
ky
)
#gis = GIS(api_key="AAPKe7cb1ab4f2ba44748cf53ac4f30d0caavu5t_-uMdWP8SRjtoea3s66-cRyFZmMTNx4rqy2w5sjwegU_tbJyBesd0LCMmdtV") # linked Bryson's pro account
ap_meters
=
lat_lon2meters
(
anchor_point
[
0
],
anchor_point
[
1
])
...
...
@@ -75,6 +78,7 @@ def grab_features(anchor_point, extent, sample_dist = 10, case_name = 'blah', he
while
type
(
q
)
==
list
and
query_cnt
<=
30
:
# have to do this because arcgis is sketchy as hell and doesnt always come back
try
:
print
(
"querying {} layer..."
.
format
(
name_list
[
i
]))
print
(
lyr
)
query_starttime
=
time
.
time
()
q
=
lyr
.
query
(
return_count_only
=
False
,
return_ids_only
=
False
,
return_geometry
=
True
,
...
...
lpm_maps.py
View file @
acb5bb2d
...
...
@@ -68,6 +68,10 @@ def collect_terrain():
n_clusters
=
10
#Number of areas to download
count_thres
=
2
#Minimum number of points needed for a large download
#Parameters for feature_set
res
=
25
folder
=
'trust'
#Collection of map centers, in meters. Use to check if we need to download a new area
ipp_list
=
[]
...
...
@@ -156,12 +160,20 @@ def collect_terrain():
incidents
.
insert
(
0
,
'area'
,
keys
)
#Now, if there's only one key in an area we can avoid downloading a lot.
#Need to ouput data in a way that indicates if an IPP is a big area or not...
max_down
=
1
#Maximum number of things to download
count
=
0
do_plot
=
True
for
i
in
range
(
0
,
len
(
ipp_list
)):
print
(
"Collecting GIS data
%
d/
%
d"
%
(
i
,
len
(
ipp_list
)))
#Download local map
if
(
keys
.
count
(
i
)
<=
count_thres
):
size
=
extent_test
else
:
size
=
extent_download
if
(
count
<
max_down
):
count
=
count
+
1
grab_features
(
ipp_list
[
i
],
extent_download
,
sample_dist
=
res
,
case_name
=
folder
,
save_files
=
True
,
save_to_folder
=
True
,
file_id
=
str
(
count
),
plot_data
=
do_plot
)
#For visualizing
...
...
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