<div dir="ltr">Hi<div><br></div><div>Am I correct in assuming that you previously ran PostGIS 2.0 and now use 2.1? I'm only speculating as I'm not that familiar with the raster features, but according to the docs (<a href="http://postgis.net/docs/RT_ST_Clip.html">http://postgis.net/docs/RT_ST_Clip.html</a>), st_clip was rewritten in C for the 2.1 version, and the change in behavior probably stems from that. While such undocumented changes between versions are unfortunate, I personally think that explicitly calling the transform function is more in the spirit with how the rest of the PostGIS functions handle srid mismatches.</div>
<div><br></div><div>Åsmund</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 22, 2014 at 5:14 PM, Jayson Gallardo <span dir="ltr"><<a href="mailto:jaysontrades@gmail.com" target="_blank">jaysontrades@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Well, the thing is, that's how it's been for the last year and has worked fine. The difference now is that our server was rebuilt from scratch and I had to reload a dump of our database. The other difference is that the previous database was on PostgreSQL 9.1, and now we're on 9.3. </div>
<div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 21, 2014 at 6:45 PM, Åsmund Tokheim <span dir="ltr"><<a href="mailto:asmundto@gmail.com" target="_blank">asmundto@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>It seems like you transformed the polygon used in the st_intersects function, but the polygon used in the st_clip function still has the 3857 srid.</div>

<div><br></div><div>Åsmund</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Thu, May 22, 2014 at 1:04 AM, Jayson Gallardo <span dir="ltr"><<a href="mailto:jaysontrades@gmail.com" target="_blank">jaysontrades@gmail.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">I was finally able to restore my database dump today. However, upon testing, I get this error:<div>

<br></div>
<div><div><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>
<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">production=# SELECT ST_AsGDALRaster(ST_CLIP(ST_Union(rast), ST_GeomFromText('POLYGON((-10366992.073461 5117898.5805526,-10366635.506271 5117898.5805526,-10366635.506271 5118206.0551587,-10366992.073461 5118206.0551587,-10366992.073461 5117898.5805526))',3857)),'GTiff') FROM "dem_elevation" WHERE ST_Intersects(rast, ST_Transform(ST_GeomFromText('POLYGON((-10366992.073461 5117898.5805526,-10366635.506271 5117898.5805526,-10366635.506271 5118206.0551587,-10366992.073461 5118206.0551587,-10366992.073461 5117898.5805526))',3857),4269));</font></div>



</div><div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">NOTICE:  Geometry provided does not have the same SRID as the raster. Returning NULL</font></div></div></blockquote><div><br></div>



<div>However, all my DEMs are in the raster with SRID 4269. My DEMs have been partitioned however, but the restore should have restored all that back into place, right?</div><div><br></div><div>This is what I have for dem_elevation in pgAdmin:</div>



<div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">-- Table: dem_elevation</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br>



</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">-- DROP TABLE dem_elevation;</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br>



</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">CREATE TABLE dem_elevation</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">(</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  rid integer NOT NULL,</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  rast raster,</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT dem_elevation_pkey PRIMARY KEY (rid)</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">)</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">WITH (</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  OIDS=FALSE</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">);</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">ALTER TABLE dem_elevation</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  OWNER TO postgres;</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">GRANT ALL ON TABLE dem_elevation TO postgres;</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">GRANT SELECT, REFERENCES, TRIGGER ON TABLE dem_elevation TO postgis_reader;</font></div>



</div><div><br></div></blockquote>And one of the dependents:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">-- Table: dem_elevation_n33w090</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br></font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">-- DROP TABLE dem_elevation_n33w090;</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br></font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">CREATE TABLE dem_elevation_n33w090</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">(</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  rid serial NOT NULL,</font></div><div>


<font face="courier new, monospace" style="background-color:rgb(238,238,238)">  rast raster,</font></div>
<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT dem_elevation_n33w090_pkey PRIMARY KEY (rid),</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_height_rast CHECK (st_height(rast) = 50),</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_max_extent_rast CHECK (st_coveredby(st_convexhull(rast), '0103000020AD1000000100000005000000863D2B1A098056C03B126100F5FE3F40863D2B1A098056C09578563412804040CA451840BD3F56C09578563412804040CA451840BD3F56C03B126100F5FE3F40863D2B1A098056C03B126100F5FE3F40'::geometry)),</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_num_bands_rast CHECK (st_numbands(rast) = 1),</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_out_db_rast CHECK (_raster_constraint_out_db(rast) = '{f}'::boolean[]),</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_pixel_types_rast CHECK (_raster_constraint_pixel_types(rast) = '{32BF}'::text[]),</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_same_alignment_rast CHECK (st_samealignment(rast, '010000000097C6CEA0C845183F97C6CEA0C84518BF863D2B1A098056C0957856341280404000000000000000000000000000000000AD10000001000100'::raster)),</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_scalex_rast CHECK (st_scalex(rast)::numeric(16,10) = 0.000092592592593::numeric(16,10)),</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_scaley_rast CHECK (st_scaley(rast)::numeric(16,10) = (-0.000092592592593)::numeric(16,10)),</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_srid_rast CHECK (st_srid(rast) = 4269),</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  CONSTRAINT enforce_width_rast CHECK (st_width(rast) = 50)</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">)</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">INHERITS (dem_elevation)</font></div><div>



<font face="courier new, monospace" style="background-color:rgb(238,238,238)">WITH (</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  OIDS=FALSE</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">);</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">ALTER TABLE dem_elevation_n33w090</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  OWNER TO postgres;</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">GRANT ALL ON TABLE dem_elevation_n33w090 TO postgres;</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">GRANT SELECT, REFERENCES, TRIGGER ON TABLE dem_elevation_n33w090 TO postgis_reader;</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br></font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">-- Index: dem_elevation_n33w090_rast_gist</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br></font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">-- DROP INDEX dem_elevation_n33w090_rast_gist;</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br></font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">CREATE INDEX dem_elevation_n33w090_rast_gist</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  ON dem_elevation_n33w090</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  USING gist</font></div>



<div><font face="courier new, monospace" style="background-color:rgb(238,238,238)">  (st_convexhull(rast));</font></div><div><font face="courier new, monospace" style="background-color:rgb(238,238,238)"><br></font></div>


</div>
</blockquote><font face="arial, helvetica, sans-serif">Thanks for your help in advance,</font></div><div><font face="arial, helvetica, sans-serif">Jayson</font></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">



<div><div><br></div></div></blockquote></div></div>
<br></div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>