mirror of
https://github.com/google/earthengine-api.git
synced 2025-12-08 19:26:12 +00:00
21 lines
634 B
Python
21 lines
634 B
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('GOOGLE/EE/DEMOS/sf-photo-locations')
|
|
bridge_photos = photos_near_sf.filter(
|
|
ee.Filter().Or(ee.Filter.stringContains('title', 'Bridge'),
|
|
ee.Filter.stringContains('title', 'bridge')))
|
|
|
|
ee.mapclient.addToMap(photos_near_sf, {'color': '0040b0'})
|
|
ee.mapclient.addToMap(bridge_photos, {'color': 'e02070'})
|
|
|
|
print('There are {} bridge photos around SF.'
|
|
.format(bridge_photos.size().getInfo()))
|