You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using 100km-resolution BNG indices in grid_boundary, the tiles "NE", "NW", "SE", and "SW" are interpreted as being a "quadrant" resolution, so are erroneously being given geometries with half dimensions.
To Reproduce
import mosaic as mos
from pyspark.sql import functions as F
# Enable BNG indexing
spark.conf.set('spark.databricks.labs.mosaic.index.system', 'BNG')
mos.enable_mosaic(spark, dbutils)
# Create a dataframe with 4 100km grid references
df = (
spark.createDataFrame([
{'bng': g} for g in ['SE', 'SF', 'NX', 'NW']
])
# Define boundary geometry
.withColumn('grid_boundary', mos.grid_boundary('bng', F.lit('WKT')))
# Measure area of each tile (should be the same for all)
.withColumn('area', mos.st_area('grid_boundary'))
)
df.display()
All rows in the dataframe ought to have the same area of 10^10 m^2, but "SE" and "NW" do not:
Similar results for "NE" and "SW" too.
The text was updated successfully, but these errors were encountered:
When using 100km-resolution BNG indices in
grid_boundary
, the tiles "NE", "NW", "SE", and "SW" are interpreted as being a "quadrant" resolution, so are erroneously being given geometries with half dimensions.To Reproduce
All rows in the dataframe ought to have the same area of 10^10 m^2, but "SE" and "NW" do not:
Similar results for "NE" and "SW" too.
The text was updated successfully, but these errors were encountered: