[postgis-tickets] [PostGIS] #4051: Strange result with raster ST_Intersects

PostGIS trac at osgeo.org
Sun Mar 25 14:31:09 PDT 2018


#4051: Strange result with raster ST_Intersects
---------------------+---------------------------
  Reporter:  stev00  |      Owner:  Bborie Park
      Type:  defect  |     Status:  new
  Priority:  medium  |  Milestone:  PostGIS 2.4.4
 Component:  raster  |    Version:  2.4.x
Resolution:          |   Keywords:
---------------------+---------------------------

Comment (by stev00):

 I have done some more tests with the above data. The SQL commands run and
 results are shown below. I guess this is related to precision - it seems
 that ST_Worldtorastercoord gives different results to
 ST_Rastertoworldcoord. Will try and do a bit more digging.

 {{{
 with r as(
 SELECT * from test_raster WHERE rast &&
 ST_SetSRID(ST_GeomFromText('POINT(529004 182915.87)'),27700) AND
 fn_st_intersects_log(rast, ST_SetSRID(ST_GeomFromText('POINT(529004
 182915.87)'),27700), 1)
 )

 -- result columnx=51, rowy=26
 select (ST_worldtorastercoord(rast, 529004, 182915.87)).* from r

 --result st_rastertoworldcoordx=529003.000000106 st_width=50 st_height=56
 st_pixelwidth=1.00000000000698
 select ST_RasterToWorldCoordX(rast, 50),st_width(rast), st_height(rast),
 ST_PixelWidth(rast) from r
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4051#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