locationtech / rasterframes

Geospatial Raster support for Spark DataFrames
http://rasterframes.io
Apache License 2.0
240 stars 46 forks source link

XZ2 indexer should be lenient on coordinate values #531

Closed vpipkt closed 3 years ago

vpipkt commented 3 years ago

If the tile extent is beyond (-180.0, 180.0) latitude or (-90.0, 90.0) longitude the call to GeoMesa XZ2SFC.index will throw because we use lenient=false.

Is there a compelling reason not to allow this index to extend beyond these bounds?

Background, originally reported here:

https://gitter.im/locationtech/geomesa?at=5fecdfc263fe0344962a53db

https://geomesa.atlassian.net/browse/GEOMESA-2974

duncanfwalker commented 3 years ago

By the looks of GeoMesa when we are lenient it clamps the tile extent to the world extent.

I think that means being lenient might result in duplicate indexes. In the case where there are two different tiles that both go beyond the world extent they might the same index eg Tiles with extents (90,91) and (91,92) get clamped to 90 is so get indexed as (90,90) and (90,90).

For the ERA5 use case that's fine because its just the edge tiles that go slightly beyond 90 will get clamped so no risk of a duplicate.

vpipkt commented 3 years ago

@duncanfwalker In my view the incorrect index value in this case should cause no logical errors in the users' programs. It remains to be seen if there is a real performance impact.

It sounds like basically we agree that we should make this change. I'll put up a PR soon.