james-willis commented on code in PR #1068: URL: https://github.com/apache/sedona-db/pull/1068#discussion_r3649931698
########## python/sedonadb/tests/functions/test_rs_reprojectmatch.py: ########## @@ -0,0 +1,299 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""RS_ReprojectMatch cross-checked against a rasterio reference implementation. + +Each test writes an input raster and a reference raster (numpy array + GDAL +geotransform + CRS) and reprojects the input onto the reference's grid through +both raster engines from `sedonadb.raster_testing`: + +- **Same-CRS regrid** onto a finer/coarser reference shares GDAL's warp with + rasterio's `reproject`. Nearest-neighbour is integer selection, so pixels are + compared exactly; bilinear accumulates over neighbours so it uses a small + tolerance (rasterio may bundle a different GDAL build). +- **Cross-CRS** (EPSG:4326 -> EPSG:3857) reprojects onto the reference grid; + both engines wrap the same GDAL warp, so nearest-neighbour pixels match + exactly. +- Cells the reprojected input does not cover fill with the input band nodata. + +Both rasters travel as table columns (not literals) so the kernel runs its real +array path. +""" + +import numpy as np +import pyarrow as pa +import pytest + +from sedonadb.raster_testing import ( + Rasterio, + SedonaDB, + decode_raster, + random_raster_data, + write_geotiff, +) + +DTYPES = ["uint8", "uint16", "int16", "int32", "float32", "float64"] Review Comment: never mind, I removed support for int64 and uint64 because they dont return correct results for the type. the only exception is Mode in GDAL 3.13 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
