[postgis-tickets] [PostGIS] #4640: Update raster docs to explain why ST_Transform using alignment is important

PostGIS trac at osgeo.org
Wed Feb 12 15:43:15 PST 2020


#4640: Update raster docs to explain why ST_Transform using alignment is important
----------------------------+---------------------------
  Reporter:  robe           |      Owner:  robe
      Type:  defect         |     Status:  new
  Priority:  medium         |  Milestone:  PostGIS 3.0.1
 Component:  documentation  |    Version:  master
Resolution:                 |   Keywords:
----------------------------+---------------------------
Description changed by robe:

Old description:

> This one is from IRC
>
> from - Maksim Gomov
>
> source data from - https://www.landfire.gov/fbfm40.php

New description:

 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)
 }}}

--

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4640#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list