Hi Dimitri, I used your 5x5 filter on an RGB satellite image which is in a Lambert Conformal Conic projection. The "prj" file has the following information for the TIFF file: PROJCS["NAD_1983_CSRS_Northwest_Territories_Lambert", GEOGCS["GCS_North_American_1983_CSRS",DATUM["D_North_American_1983_CSRS", SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0], UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"], PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0], PARAMETER["Central_Meridian",-112.0],PARAMETER["Standard_Parallel_1",62.0], PARAMETER["Standard_Parallel_2",70.0],PARAMETER["Latitude_Of_Origin",0.0], UNIT["Meter",1.0],AUTHORITY["EPSG",3581]] The "TFW" file has the following information: 1.500000000000000 0.000000000000000 0.000000000000000 -1.500000000000000 -890657.2500000000 9225632.2500000000 When I run your routine on the data set, it comes out as psuedo mercator in the wrong place in the world, when I change the projection to lambert conformal conic it still is not in the right place in the world. There was a series of GDAL errors when I imported that TIFF file and the rest in group of images. 2019-02-12 13:40:39 ** ASCII value for tag "GDALNoDataValue" contains null byte in value; value incorrectly truncated during reading due to implementation limitations 2019-02-12 13:40:39 ** ASCII value for tag "GDALNoDataValue" contains null byte in value; value incorrectly truncated during reading due to implementation limitations 2019-02-12 13:40:39 ** ASCII value for tag "GDALNoDataValue" contains null byte in value; value incorrectly truncated during reading due to implementation limitations 2019-02-12 13:40:39 ** ASCII value for tag "GDALNoDataValue" contains null byte in value; value incorrectly truncated during reading due to implementation limitations 2019-02-12 13:41:12 -- Import: S:\SPOT_150cm_NWT_Mosaic_2017\107B\107B07_rgb.tif (32.812 sec) The nice thing is that the 2.57 GB RGB image only took ~92-94 seconds with different runs to process with this filter. I'm hoping to be able to use these and other filters at this speed to process imagery if need be and obviously I'd like the images to show up in the correct locations. I'm including my edits of your code so you can see if there's any errors: -- $manifold$ -- -- Template for custom RGB 3x3, 5x5, etc filters -- using parameters for filter and radius, and two functions -- -- RGB Unsharp 5x5 VALUE @filter TILE = StringJsonTile('[ -0.00391, -0.01563, -0.02344, -0.01563, -0.00391, -0.01563, -0.06250, -0.09375, -0.06250, -0.01563, -0.02344, -0.09375, 1.85938, -0.09375, -0.02344, -0.01563, -0.06250, -0.09375, -0.06250, -0.01563, -0.00391, -0.01563, -0.02344, -0.01563, -0.00391 ]', 5, 5, 1, true); VALUE @radius UINT8 = 2; CREATE TABLE [107B07_RGB_Unsharp] ( [X] INT32, [Y] INT32, [Tile] TILE, [mfd_id] INT64, INDEX [mfd_id_x] BTREE ([mfd_id]), INDEX [X_Y_Tile_x] RTREE ([X], [Y], [Tile] TILESIZE (128,128) TILETYPE FLOAT64x3), PROPERTY 'FieldTileSize.Tile' '[ 128, 128 ]', PROPERTY 'FieldTileType.Tile' 'float64x3' ); -- Do not forget to change the Rect values when using other images CREATE IMAGE [107B07_RGB_Unsharp Image] ( PROPERTY 'Table' '[107B07_RGB_Unsharp]', PROPERTY 'FieldTile' 'Tile', PROPERTY 'FieldX' 'X', PROPERTY 'FieldY' 'Y', PROPERTY 'Rect' '[ 0, 0, 32868, 27993 ]' ); FUNCTION processtile(@t TILE, @r UINT8, @f TILE) TILE AS ( TileFilter(@t, @r, @f) ) END; FUNCTION processRGB(@t TILE, @r UINT8, @f TILE) TILE AS ( TileChannelsConcat( processtile(TileChannel(@t,0), @r, @f), TileChannelsConcat( processtile(TileChannel(@t,1), @r, @f), processtile(TileChannel(@t,2), @r, @f))) ) END; PRAGMA ('progress.percentnext' = '100'); INSERT INTO [107B07_RGB_Unsharp] ( [X], [Y], [Tile] ) SELECT [X], [Y], CASTV ((TileRemoveBorder(processRGB(TileCutBorder([107B07_rgb], VectorMakeX2([X], [Y]), @radius), @radius, @filter), @radius)) AS FLOAT64) FROM [107B07_rgb] THREADS SystemCpuCount(); TABLE CALL TileUpdatePyramids([107B07_RGB_Unsharp Image]);
|