Geographic Information Systems Asked by Joshua Mincer on February 11, 2021
I did a batch download of the National Hydrography Dataset, and I have reason to believe that many lakes are found in many state datasets due to extending past state boundaries. I want to filter these out to avoid duplicates, but it seems to not work.
Below is a comparison of the sizes:
var nhd = ee.FeatureCollection("users/mincej20/NHD_Filtered_50");
nhd = nhd.sort("AreSqKm", False);
print(nhd.size()) //Returns 104762
print(nhd.size().distinct('NHDPlID')) //Returns 104762
These return the same sizes of featurecollections. However, if I print out the first 20 NHDPlIDs:
nhd = ee.FeatureCollection(nhd.toList(20, 1000));
print(nhd.aggregate_array("NHDPlID");
The following list is returned:
0: 22000600050688
1: 65000300111257
2: 65000300111257
3: 65000300111257
4: 65000200109644
5: 21000300292859
6: 21000100338800
7: 21000100338800
8: 21000500141259
9: 65000300137354
10: 65000300137354
11: 65000300137354
12: 65000200154805
13: 23000300045900
14: 23000300045900
15: 10000200330648
16: 15000300130262
17: 15000300130262
18: 15001700186644
19: 15001700186644
I’m not sure why this doesn’t find distinct NHDPlIDs. I figured that I could find distinct '.geo'
properties, and this seems to work, but I’d still like to figure out why finding distinct NHDPlIDs does not work. Here’s some information about the features:
print(nhd.getInfo().columns);
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP