-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add raster zxy function doc and test
- Loading branch information
1 parent
3c24ae2
commit ae352e6
Showing
4 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DROP FUNCTION IF EXISTS public.function_zxy_raster; | ||
|
||
CREATE OR REPLACE FUNCTION public.function_zxy_raster(z integer, x integer, y integer) RETURNS bytea AS $$ | ||
DECLARE | ||
mvt bytea; | ||
BEGIN | ||
with rast as ( | ||
SELECT st_transform(rast,3857) as bands from public.landcover where rast && st_transform( st_tileenvelope(z,x,y),32644) | ||
) | ||
SELECT into mvt ST_AsJPEG(st_tile(bands,512,512)) from rast; | ||
return mvt; | ||
END | ||
$$ LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
create extension postgis_raster; | ||
-- ALTER SYSTEM SET postgis.gdal_enabled_drivers TO 'GTiff PNG JPEG'; | ||
-- ALTER SYSTEM postgis.enable_outdb_rasters = true; | ||
-- SELECT pg_reload_conf(); |
Binary file not shown.