Opened 13 years ago

Closed 13 years ago

#730 closed defect (fixed)

Raster is broken -- no casts

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc:

Description

This si the first of 2 raster breaks I am noting. Short answer — Paul, raster is pretty much unusable with your new changes.

— I suspect a cast is missing, though its questionable if we should have an auto cast in place or just define functions and operators directly for raster

SELECT ST_Box2D(rast1.rast) FROM (
( SELECT ST_SetSRID(ST_SetValue(
	ST_AddBand(
		 	ST_MakeEmptyRaster( 100, 100, (i-1)*100, (i-1)*100, 0.0005, -0.0005, 0*i, 0*i), '32BF'), 
		 	i, (i+1),-4294),4326) 
		 	As rast 
		 	FROM generate_series(1,10) As i) ) As rast1 
	LIMIT 3;

Change History (16)

comment:1 by robe, 13 years ago

Owner: changed from pracine to pramsey

comment:2 by pramsey, 13 years ago

Try at r6494

comment:3 by robe, 13 years ago

Paul,

No this doesn't fix this particular problem. I see now that this is because raster folks are trying to use deprecated functions you took out.

I should have been paying closer attention to the errors in install. (You fix might fix the second issue I mentioned).

Anyrate this is what I get when trying to install raster (all in rtpostgis.sql)

psql:share/contrib/postgis-2.0/rtpostgis.sql:947: ERROR:  function st_box2d(raster) does not exist
CREATE CAST
CREATE CAST
psql:share/contrib/postgis-2.0/rtpostgis.sql:962: ERROR:  function geometry_overleft(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_overleft($1::geometry, $2::geometry)...
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:967: ERROR:  function geometry_overright(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_overright($1::geometry, $2::geometry...
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:972: ERROR:  function geometry_left(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_left($1::geometry, $2::geometry)'
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:977: ERROR:  function geometry_right(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_right($1::geometry, $2::geometry)'
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:982: ERROR:  function geometry_overabove(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_overabove($1::geometry, $2::geometry...
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:987: ERROR:  function geometry_overbelow(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_overbelow($1::geometry, $2::geometry...
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:992: ERROR:  function geometry_above(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_above($1::geometry, $2::geometry)'
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:997: ERROR:  function geometry_below(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_below($1::geometry, $2::geometry)'
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:1002: ERROR:  function geometry_same(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_same($1::geometry, $2::geometry)'
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:1007: ERROR:  function geometry_contained(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_contained($1::geometry, $2::geometry...
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:1012: ERROR:  function geometry_contain(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_contain($1::geometry, $2::geometry)'
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:1017: ERROR:  function geometry_overlap(geometry, geometry) does not exist
LINE 3:     AS 'select geometry_overlap($1::geometry, $2::geometry)'
                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:share/contrib/postgis-2.0/rtpostgis.sql:1027: ERROR:  function st_left(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1033: ERROR:  function st_overleft(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1039: ERROR:  function st_below(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1045: ERROR:  function st_overbelow(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1051: ERROR:  function st_overlap(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1057: ERROR:  function st_overright(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1063: ERROR:  function st_right(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1069: ERROR:  function st_overabove(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1075: ERROR:  function st_above(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1081: ERROR:  function st_same(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1087: ERROR:  function st_contained(raster, raster) does not exist
psql:share/contrib/postgis-2.0/rtpostgis.sql:1093: ERROR:  function st_contain(raster, raster) does not exist

comment:4 by robe, 13 years ago

Oh forgot this one

CREATE FUNCTION
psql:share/contrib/postgis-2.0/rtpostgis.sql:947: ERROR:  function st_box2d(raster) does not exist
CREATE CAST
CREATE CAST

Which looks like its trying to use the st_box2d you took out (piggy backing on the fact that raster cases to geometry via ST_ConvexHull for raster

comment:5 by mloskot, 13 years ago

Guys,

Perhaps it's our duty to clean the raster part and not to use the deprecated functions?

Mat

comment:6 by robe, 13 years ago

Mat,

fine with me. You know what to take care of? I think st_box2d Paul removed leaving box2d. The other operators we are removing entirely so I think those that are failing can just be deleted unless you see a need for them in which case you should raise it on devel newsgroup.

I'm going to have to revise the docs to remove all these operators for both PostGIS and raster (since a lot of my PostGIS operator tests generated from the docs are failing too).

I'm waiting for final consensus on what we keep and let go before I do that.

comment:7 by mloskot, 13 years ago

Regina,

I don't know what to take care of from top of my head. I guess I would walk through the PostGIS changes, check what has changed and apply corresponding fixes:

  • replace old functions with new ones
  • remove raster stuff corresponding to geometry staff which has been removed
  • etc.

Makes sense?

I have posted call for action, so let's see what others will say.

comment:8 by robe, 13 years ago

Mat,

Sounds like a plan. For starters ST_Box2D → Box2D

I think the other functions you are using are fine.

Operators we are definitely keeping: &&, <, ⇐, =, >, ≥, @, ~ (others are subject to discussion, so if you don't need the others just get rid of them

comment:9 by pramsey, 13 years ago

All the index operators will return for the 2d index. As it stands everything is still there if you're not using the gserialized switch.

comment:10 by pramsey, 13 years ago

With respect to the casts, just do a global search for casting functions this(that) and change st_this(that) to this(that).

If you don't like non-st functions, just use the casting syntax instead… that::this.

comment:11 by jorgearevalo, 13 years ago

Hi,

I got only 2 errors when installing rtpostgis.sql: line 77 and line 947. Both caused by st_box2d(geometry). I commited a new version of rtpostgis.sql.in.c replacing "st_box2d" by "box2d", and I could install rtpostgis.sql fine (r6505)

Regina, your errors were caused by nonexistent functions that do exist (just checked on my /usr/share/contrib/postgresql/8.4/contrib/postgis-2.0/postgis.sql file). Could you be out of sync? Am I missing something?

comment:12 by robe, 13 years ago

No when I was testing I had changed the switch to make gserialized the default behavior (per Paul's request). Sot hat we could slowly pull back the bandages to see what damage was caused by gserialized.

At the time gserialized was set to be 3D index and didn't have all the operators in place that raster was expecting. I think Paul's last change he made gserialized the default, but made it 2D again with all the operators.

comment:13 by robe, 13 years ago

Jorge,

What I was saying above is if you really don't need over left, over right etc. operators. It might be best to remove them. We might remove them before PostGIS 2.0 is out, but it all depends on how much people need them.

comment:14 by pramsey, 13 years ago

FYI, since Mark has professed his love for them, and I have now implemented them, I have dropped any plans to remove the Evil Unused Operators.

comment:15 by pramsey, 13 years ago

Is this issue fixed now?

comment:16 by robe, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.