Opened 9 years ago

Closed 9 years ago

#3029 closed defect (invalid)

[raster] Cleanup duplication of ST_Intersection(raster, geometry) function

Reported by: strk Owned by: Bborie Park
Priority: high Milestone: PostGIS 2.2.0
Component: raster Version: master
Keywords: Cc:

Description

As mentioned in #3028 there are two candidate versions to call for a ST_Intersection(raster,geometry). One takes 2 arguments, the other takes 3 but the third is optional. I woudln't be surprised to have an ERROR at runtime when trying to call them (but I hadn't tried). In any case one of the two seems useless and could as well be removed, or the one with a third argument should mark it as non-optional.

Whatever makes the least problem on upgrade should be done.

Usually (from the ancient past) I preferred _never_ to use DEFAULT arguments, giving precedence to full backward compatibility and easy-to-upgrade (create or replace). But the horse are likely already out here :)

Change History (4)

comment:1 by Bborie Park, 9 years ago

Priority: mediumhigh
Summary: Cleanup duplication of ST_Intersection(raster, geometry) function[raster] Cleanup duplication of ST_Intersection(raster, geometry) function

comment:2 by strk, 9 years ago

Paul, Regina: could you check your test-upgraded-databases for this ? A new install should have a single ST_Intersection(raster,geometry), does an upgraded database also have only one ?

comment:3 by robe, 9 years ago

upgraded from what?

When I install PostGIS 2.1.8 and then upgrade to PostGIS 2.2.0, I still have 14 functions with ST_Intersection in them (before and after)

\df ST_Intersection
                                                                                                  List of functions
 Schema |      Name       | Result data type |                                                                      Argument data types
--------+-----------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------
 public | st_intersection | geography        | geography, geography
 public | st_intersection | geometry         | geom1 geometry, geom2 geometry
 public | st_intersection | SETOF geomval    | geomin geometry, rast raster, band integer DEFAULT 1
 public | st_intersection | SETOF geomval    | rast raster, band integer, geomin geometry
 public | st_intersection | SETOF geomval    | rast raster, geomin geometry
 public | st_intersection | raster           | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision
 public | st_intersection | raster           | rast1 raster, band1 integer, rast2 raster, band2 integer, nodataval double precision[]
 public | st_intersection | raster           | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text DEFAULT 'BOTH'::text, nodataval double precision[] DEFAULT N
 public | st_intersection | raster           | rast1 raster, band1 integer, rast2 raster, band2 integer, returnband text, nodataval double precision
 public | st_intersection | raster           | rast1 raster, rast2 raster, nodataval double precision
 public | st_intersection | raster           | rast1 raster, rast2 raster, nodataval double precision[]
 public | st_intersection | raster           | rast1 raster, rast2 raster, returnband text DEFAULT 'BOTH'::text, nodataval double precision[] DEFAULT NULL::double precision[]
 public | st_intersection | raster           | rast1 raster, rast2 raster, returnband text, nodataval double precision
 public | st_intersection | geometry         | text, text
(14 rows)

I only see one ST_Intersection(raster,geometry) in both

Last edited 9 years ago by robe (previous) (diff)

comment:4 by strk, 9 years ago

Resolution: invalid
Status: newclosed

Well then I guess I was wrong, or it was a glitch during development. Let's just close this out. Thanks for testing!

Note: See TracTickets for help on using tickets.