mirror of
https://github.com/google/earthengine-api.git
synced 2025-12-08 19:26:12 +00:00
24 lines
675 B
Python
24 lines
675 B
Python
#!/usr/bin/env python
|
|
"""Count features example.
|
|
|
|
Count Panoramio photos near SF that mention bridges.
|
|
"""
|
|
|
|
import ee
|
|
import ee.mapclient
|
|
|
|
ee.Initialize()
|
|
ee.mapclient.centerMap(-122.39, 37.7857, 12)
|
|
|
|
photos_near_sf = ee.FeatureCollection(
|
|
'ft:1qpKIcYQMBsXLA9RLWCaV9D0Hus2cMQHhI-ViKHo')
|
|
bridge_photos = photos_near_sf.filter(
|
|
ee.Filter().Or(ee.Filter().contains('title', 'Bridge'),
|
|
ee.Filter().contains('title', 'bridge')))
|
|
|
|
ee.mapclient.addToMap(photos_near_sf, {'color': '0040b0'})
|
|
ee.mapclient.addToMap(bridge_photos, {'color': 'e02070'})
|
|
|
|
print ('There are %d bridge photos around SF.' %
|
|
bridge_photos.aggregate_count('.all').getInfo())
|