Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#4640 closed defect (fixed)

Update raster docs to explain why ST_Transform using alignment is important

Reported by: robe Owned by: robe
Priority: medium Milestone: PostGIS 3.0.2
Component: documentation Version: master
Keywords: Cc:

Description (last modified by robe)

This one is from IRC

from - Maksim Gomov

source data from - https://www.landfire.gov/fbfm40.php

related thread from IRC http://irclogs.geoapt.com/postgis/%23postgis.2020-02-12.log

22:14:31	reogl:	hi all; I'm trying to transform a raster that's in crs5070 to crs4326, but I am seeing gaps between the raster tiles when I do that
22:15:53	reogl:	i.e. https://i.imgur.com/OFTgXKN.png
22:16:21	reogl:	(my query is a super simple ST_Transform(rast, 4326))
22:19:27	reogl:	I assume it's related to the fact that 5070 is geocentric while 4326 is geodetic, but I'm not sure how to mitigate this on the postgis level (or if it's possible at all)
22:42:53	reogl:	I'm wondering if I should just be reprojecting the data before I import it into the db, but I'd prefer to save a few hours and be able to do it on the db level rather than dropping it all
22:55:48	robe2:	reogl when you are transforming multiple raster tiles, you don't want to use ST_Transform(rast, srid) variant as you often end up with misaligned tiles
22:56:20	robe2:	I'm not sure if it will help your spacing issue, I suspect it will -- if you use the ST_Transform(rast, alignto) variant
22:58:10	reogl:	I'll give that a shot now, thanks; I'm also looking at just reprojecting the whole dataset since we don't need it in the db at 5070 anyways
23:02:01	robe2:	Yah look at the https://postgis.net/docs/RT_ST_Transform.html variant 3 example
23:02:03	sigq:	Title: ST_Transform (at postgis.net)
23:02:27	robe2:	Basically that foo -- you can just replace with your table -- so you can skip the with foo part
23:05:17	reogl:	yep, working on it now, thank you
23:06:18	robe2:	We should have come up with a simpler to understand example 3 - sorry -- not sure if I wrote that or Bborie -- I blame Bborie cause he's not around :)
23:09:08	reogl:	actually it's pretty straightforward to follow, I am trying to coerce it into a table update statement now :)

23:27:23	reogl:	and, by the way, the alignto method works as expected
23:27:46	reogl:	there are a few small artifacts but nothing that I think will affect the data too much when I'm not operating on a pyramid
23:27:48	robe2:	reogl so no gaps
23:27:52	reogl:	correct

23:29:18	reogl:	it would be nice if there was even just a 'gap' keyword in the ST_Transform docs or something to point to the alignto form of ST_Transform
23:29:48	reogl:	(maybe it's my lack of knowledge about CRS and geospatial stuff generally that's made me miss it though)
23:30:06	robe2:	no it's a good point -- I'll add it
23:30:44	robe2:	I think it was pretty unclear to me early on why we needed an align to version -- so people are probably wondering what that example 3 is for
23:31:00	reogl:	here's the reprojected data; you can see some small artifacting especially in the bottom left (the white spots) but for my purposes this will be just fine https://i.imgur.com/BcIORRp.png
23:31:39	reogl:	(and for all I know there is some similar artifacting in the actual data ranges but it's not a concern for me right now)
23:33:10	robe2:	reogl -- is it okay if we use your screen shot in manual
23:33:26	robe2:	thinking visual would be better to explain the difference
23:34:04	robe2:	reogl and if you give me your full name I can credit you
23:34:55	reogl:	sure; Maksim Gomov
23:35:35	reogl:	(the source data is fbfm40 from landfire if you want to pull more examples)
23:36:04	reogl:	https://www.landfire.gov/fbfm40.php
23:36:05	sigq:	Title: LANDFIRE Program: Data Products - 40 Scott and Burgan Fire Behavior Fuel Models (at www.landfire.gov)

Attachments (2)

raster_using_align_transform.png (2.7 MB ) - added by robe 5 years ago.
raster using align transform
raster_using_simple_transform.png (1.1 MB ) - added by robe 5 years ago.
raster using basic transform

Change History (9)

by robe, 5 years ago

raster using align transform

by robe, 5 years ago

raster using basic transform

comment:1 by robe, 5 years ago

Component: postgisdocumentation
Owner: changed from pramsey to robe

comment:2 by robe, 5 years ago

Description: modified (diff)

comment:3 by komzpa, 5 years ago

Milestone: PostGIS 3.0.1PostGIS next

comment:4 by komzpa, 5 years ago

Milestone: PostGIS nextPostGIS 3.0.2

Milestone renamed

comment:5 by Regina Obe <lr@…>, 4 years ago

In 9aaf78d/git:

Prep for PostGIS 3.0.2 release, raster doc update references #4640 for PostGIS 3.0.2

comment:6 by Regina Obe <lr@…>, 4 years ago

Resolution: fixed
Status: newclosed

In b73fc905/git:

raster doc update closes #4640 for PostGIS 3.1.0

comment:7 by Regina Obe <lr@…>, 4 years ago

In 9ef9130/git:

Put phrase 'no gaps' as that is the first thing people will notice. References #4640 for PostGIS 3.1

Note: See TracTickets for help on using tickets.