Ticket #490 (closed defect: fixed)

Opened 2 years ago

Last modified 3 months ago

[raster] raster casts to geometry and box3d should be assignment not implicit?

Reported by: robe Owned by: dustymugs
Priority: low Milestone: PostGIS 2.0.0
Component: raster Version: trunk
Keywords: Cc:

Description

It appears I can do this:

SELECT ST_SRID(rast) As srid, ST_AsText(ST_Union(rast)) AS wktrast
FROM dummy_rast
GROUP BY ST_SRID(rast);

SELECT ST_SRID(rast) As srid, ST_Extent(rast) AS extrast
FROM dummy_rast
GROUP BY ST_SRID(rast);

Which at first glance I thought was cool, but then realized its probably not cool. I'm still thinking about why this is bad. For geography we decided this was bad because geography aren't cartesian coords so the answer is technically wrong. In case of raster its not quite so clear. I guess I think all non-trivial implicit casts are bad, but that's the database purist in me talking.

So consider this just a flagging of questionable behavior. Not necessarily that I am disagreeing with it.

Change History

Changed 2 years ago by robe

  • summary changed from raster casts to geometry and box2d should be assignment not implicit? to [wktraster] raster casts to geometry and box2d should be assignment not implicit?

Changed 21 months ago by pracine

I guess the results are of some value until we get ST_Union working on the raster type.

What's wrong with the second example? You got the total extent of the raster coverage, right?

Changed 21 months ago by pracine

  • owner changed from pracine to robe
  • milestone changed from WKTRaster 0.1.6 to PostGIS 2.0.0

Changed 21 months ago by pracine

  • summary changed from [wktraster] raster casts to geometry and box2d should be assignment not implicit? to [raster] raster casts to geometry and box2d should be assignment not implicit?

Changed 17 months ago by robe

It's fine. I was more bothered by the autocast. Actually the main reason I was bothered is going to be more of an issue anyway. I think we'll just have to change people's behavior relying on autocasts as now that we have 3 versions of ST_Intersection .. anybody typing in , :geometry etc. is going to get an ambiguous function error message as I already experienced with topology.

The hack we put in place when we introduced geography by defining an ST_Intersection(text,text) and others so that unknowns fall into that function will only get us so far and I'd much prefer people just not relying on them so we don't have the issue in the first place.

Changed 5 months ago by dustymugs

  • summary changed from [raster] raster casts to geometry and box2d should be assignment not implicit? to [raster] raster casts to geometry and box3d should be assignment not implicit?

Changed 4 months ago by pracine

Any development here?

Changed 4 months ago by pramsey

Any development here?

Changed 3 months ago by strk

Any development here? (infinite loop detected?)

Changed 3 months ago by robe

  • milestone changed from PostGIS 2.0.0 to PostGIS 2.1.0

How about we just push this to the next and end this infinite loop until some other day. I don't think there are too many cases where its an issue as much as it was with geometry / geography.

Changed 3 months ago by dustymugs

Now that I actually read and thought a bit about the description, I prefer assignment (explicit?) rather than implicit. If it remains implicit, debugging complex queries can be a nightmare.

Changed 3 months ago by dustymugs

  • milestone changed from PostGIS 2.1.0 to PostGIS 2.0.0

Changed 3 months ago by dustymugs

  • owner changed from robe to dustymugs
  • status changed from new to assigned

Changed 3 months ago by dustymugs

I've tested changing the CASTs from IMPLICIT to ASSIGNMENT, upgraded an existing database and haven't had any issues with the change. I did have to update some usage of "raster && geometry" in rtpostgis.sql.in.c to be explicit.

I'll commit if no one has any issues.

Changed 3 months ago by dustymugs

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r9282

Note: See TracTickets for help on using tickets.