I want to restrict my feature collection (in red, below) to the conterminous U.S. I found this solution to create a bounding box:

var continentalUS = ee.Geometry.Rectangle(-127.18, 19.39, -62.75, 45);

However I'm perplexed by this because displaying "continentalUS" using Map.addLayer() shows curved latitude lines that are more "curved" further north. The background Google Map, as well as everything else to my understanding, is projected to Mercator before it's displayed, and also before operations in the script are performed. I tried converting "continentalUS" to a feature, and still no luck with the projection matching when added to the map. This curved rectangle doesn't subset the target feature collection as I'd like. Here's what I get when I use .filterBounds() with the above rectangle coordinates: Trying to subset the red feature collection south of the 45th parallel, but this is what I get when I try to create a bounding rectangle using the above coordinates.

I want the 45th parallel to match up with the map and my shapefile, which is automatically projected by Google Earth Engine. Why isn't a geometry created in Google Earth Engine not in Mercator, like everything else?

1 Answer 1

var continentalUS = ee.Geometry.Rectangle([-127.18, 19.39, -62.75, 45], null, false);

See this reference for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.