<div dir="ltr">You can safely not have the extent constraint in place. The limitation has been removed in 2.2 where we changed how the max extent is computed.<div><br></div><div>-bborie</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Wed, Jul 23, 2014 at 12:45 PM, David Haynes II <span dir="ltr"><<a href="mailto:dahaynes@umn.edu" target="_blank">dahaynes@umn.edu</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"><p class="MsoNormal">Hello,</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I have posted this question on the PostGIS user group unsuccessfully
and I am hoping this question can be answered by this forum. The research project I am working uses rasters with a world
geographic extent. Often we find that when downloading the data the merged
raster tiles extend beyond the defined geographic boundaries. For example, one
landcover dataset (Globcover) has a geographic extent of
-180.0013888888888971,-64.9986111111111171 :
179.9986111111111029,90.0013888888888829. It goes beyond the coordinate system
bounds by approximately half a cell in the north west quadrant. This causes it
fail when using raster2pgsql for ingest. Specifically applying the raster
extent constraint on the built table causes it to fail.</p><p class="MsoNormal"></p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">After much trial and error we can successfully ingest
rasters by using gdalwarp to crop the raster to the bouding coordinates
(-180 90, 180 -90). However the initial issue has returned to us because we are
trying to use MODIS data in its native projection (Sinusoidal). Even when
cropped to the appropriate bounding area the raster still fails on ingest. A
solution was to adjust the raster2pgsql script to use the "-x"
parameter which drops the spatial extent on ingest. </p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Now datasets are loading into our system. However we tried
to go back and set the geographic extent after of the raster were successfully generated, and in doing that we have run into the same problem. We are unable set the spatial extent of the MODIS data.</p><p class="MsoNormal">


</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">SELECT AddRasterConstraints('gis_rasters'::name,
'modis_IGBP_mask'::name, 'rast'::name, 'extent');</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">NOTICE:  Adding
maximum extent constraint</p>

<p class="MsoNormal">NOTICE:  Unable to get
the extent of the raster column. Attempting memory efficient (slower) approach</p>

<p class="MsoNormal">CONTEXT:  PL/pgSQL
function addrasterconstraints(name,name,name,text[]) line 104 at assignment</p>

<p class="MsoNormal">NOTICE:  Still unable
to get the extent of the raster column. Cannot add extent constraint</p>

<p class="MsoNormal">CONTEXT:  PL/pgSQL
function addrasterconstraints(name,name,name,text[]) line 104 at assignment</p>

<p class="MsoNormal">WARNING:  Unable to
add constraint: 'extent'.  Skipping</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">ERROR:  None of the
constraints specified could be added.  Is
the schema name, table name or column name incorrect?</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">The subfunction also returns false</p>

<p class="MsoNormal">SELECT _add_raster_constraint_extent('gis_rasters'::name,
'modis_IGBP_mask'::name, 'rast'::name) FROm gis_rasters.modis_IGBP_mask</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Yet, this function works and returns the bounding
coordinates when using ST_AsText()</p>

<p class="MsoNormal">SELECT ST_ConvexHull(ST_Collect(ST_ConvexHull(rast))) FROM
gis_rasters.modis_IGBP_mask </p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I have read through this ticket, but this seemed to be
solved with a new update. <a href="http://trac.osgeo.org/postgis/ticket/2050" target="_blank">http://trac.osgeo.org/postgis/ticket/2050</a></p>

<p class="MsoNormal">Any help would be appreciated.</p><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div dir="ltr">David Haynes, Ph.D.<div>Research Associate Terra Populous</div><div>Minnesota Population Center</div>

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