rx integer;
ry integer;
BEGIN
- IF (st_geometrytype(pt) != 'ST_Point') THEN
+ IF st_geometrytype(pt) != 'ST_Point' THEN
RAISE EXCEPTION 'Attempting to compute raster coordinate with a non-point geometry';
END IF;
+ IF ST_SRID(rast) != ST_SRID(pt) THEN
+ RAISE EXCEPTION 'Raster and geometry do not have the same SRID';
+ END IF;
+
SELECT rc.columnx AS x, rc.rowy AS y INTO columnx, rowy FROM _st_world2rastercoord($1, st_x(pt), st_y(pt)) AS rc;
RETURN;
END;
IF ( st_geometrytype(pt) != 'ST_Point' ) THEN
RAISE EXCEPTION 'Attempting to compute raster coordinate with a non-point geometry';
END IF;
+ IF ST_SRID(rast) != ST_SRID(pt) THEN
+ RAISE EXCEPTION 'Raster and geometry do not have the same SRID';
+ END IF;
SELECT columnx INTO xr FROM _st_world2rastercoord($1, st_x(pt), st_y(pt));
RETURN xr;
END;
IF ( st_geometrytype(pt) != 'ST_Point' ) THEN
RAISE EXCEPTION 'Attempting to compute raster coordinate with a non-point geometry';
END IF;
+ IF ST_SRID(rast) != ST_SRID(pt) THEN
+ RAISE EXCEPTION 'Raster and geometry do not have the same SRID';
+ END IF;
SELECT rowy INTO yr FROM _st_world2rastercoord($1, st_x(pt), st_y(pt));
RETURN yr;
END;
NOTICE: Latitude and longitude required for computing pixel row and column of a rotated raster
test 2.4|2|1217x1156, ip:782325.5,26744042.5 scale:5,-5 skew:3,3 srid:9102707 width:1217 height:1156
test 2.4|4|6000x6000, ip:-75.5533328537098,49.2824585505576 scale:0.000805965234044584,-0.00080596523404458 skew:0.000211812383858707,0.000211812383858704 srid:4326 width:6000 height:6000
+ERROR: Raster and geometry do not have the same SRID
+ERROR: Raster and geometry do not have the same SRID
+ERROR: Raster and geometry do not have the same SRID
NOTICE: Latitude and longitude required for computing pixel row and column of a rotated raster
NOTICE: Latitude and longitude required for computing pixel row and column of a rotated raster
test 5.4|2|1217x1156, ip:782325.5,26744042.5 scale:5,-5 skew:3,3 srid:9102707 width:1217 height:1156
test 5.4|4|6000x6000, ip:-75.5533328537098,49.2824585505576 scale:0.000805965234044584,-0.00080596523404458 skew:0.000211812383858707,0.000211812383858704 srid:4326 width:6000 height:6000
+ERROR: Raster and geometry do not have the same SRID
+ERROR: Raster and geometry do not have the same SRID
+ERROR: Raster and geometry do not have the same SRID
NOTICE: Pixel row and column required for computing longitude and latitude of a rotated raster
NOTICE: Pixel row and column required for computing longitude and latitude of a rotated raster
test 8.3|2|1217x1156, ip:782325.5,26744042.5 scale:5,-5 skew:3,3 srid:9102707 width:1217 height:1156