-
-
Save mbforr/dd9d8df1f91a9934a78f313b57fa4770 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
state_name, state | |
from | |
`bigquery-public-data.geo_us_boundaries.states` | |
# our first spatial sql function - st_area | |
# this function takes the geometry and returns the area in sq. meters | |
# we will look for states where the area is greater or equal to 200k sq. km (2e+11) | |
# we can also use different operators in our where clause | |
# https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_area | |
# https://cloud.google.com/bigquery/docs/reference/standard-sql/operators | |
where st_area(state_geom) >= 2e+11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment