[postgis-users] Rast index : Could not get raster's convex hull

Bborie Park bkpark at ucdavis.edu
Sun Dec 2 19:03:00 PST 2012


Hi Hugues,

Congrats on the new family member.

I'd guess that the error is happening to the rasters being generated
within the function.  Beyond that, I can't say more without being able
to recreate the situation.

-bborie

On Sun, Dec 2, 2012 at 2:17 PM, Francois Hugues
<hugues.francois at irstea.fr> wrote:
> Hello,
>
> Hello,
>
> Thanks for your answer Bborie and, please, excuse me for the time it took me to reply, but a new born girl arrived in my family on last Tuesday.
>
> Your query returns no line and that's normal since I deleted all lines where st_height = 0. I had already done that when I sent my first mail.
>
> Anyway I was unable to reproduce strictly the same error :
> 1. I tried one more time to run the index creation query and... Tadam ! It worked
> 2. In fact, I'm trying to create a function to create a new complete tiled raster of slopes from an original tiled raster (to avoid no data at borders of tiles) and tried to  make the index on the table in creation into the function. I got the "could not get raster's convexhull error". I assume, I'm missing something here. The function is attached to this mail.
> 3. I(re)tried to create the new table without gist index to create it after function processed as I did the first time numerous times. Index query worked each time... Don't understand why it didn't the first time.
>
> If you want to try the function : select tiledslopes('your_schema','your_tiled_raster table', 'new_table_name', 'tile_size (ex: 128x128)').
> You will need the other function attached (makegrid).
>
> Hugues.
>
> --
>
>
>
> Hugues FRANÇOIS
>
> IR - UR DTM
>
>
>
> Cemagref - IRSTEA Grenoble
>
> 2, rue de la papeterie
>
> Domaine universitaire
>
> 38402 Saint-Martin-d'Hères CEDEX
>
>
>
> 04.76.76.27.44
>
> 06.77.66.21.31
>
>
>
> hugues.francois at irstea.fr
>
>
> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Bborie Park
> Sent: Thursday, November 29, 2012 4:42 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Rast index : Could not get raster's convex hull
>
> Hi Hugues,
>
> In looking at the convex hull code under the hood, I think the only way for you to be getting that error is that at least one record's raster has a width or height of zero.  So, try something like...
>
> WITH foo AS (
> SELECT rid, ST_Metadata(rast) As meta FROM rasters.slopes.alpes
> )
> SELECT rid, (rast).width, (rast).height FROM foo WHERE (rast).width <
> 1 OR (rast).height < 1
>
> -bborie
>
> On Thu, Nov 29, 2012 at 12:20 AM, Francois Hugues <hugues.francois at irstea.fr> wrote:
>> Hello,
>>
>> Here it is ! Sorry I have forgotten it the first time.
>>
>> "POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.1, released 2012/05/15" LIBXML="2.7.8" TOPOLOGY RASTER"
>>
>> Hugues.
>>
>>
>> --
>> Hugues FRANÇOIS
>> Ingénieur recherche
>>
>> Irstea Grenoble
>> 2 rue de la papeterie
>> 38400 Saint-Martin d'Hères
>>
>> tel : +33 (0)4.76.76.27.44
>> port : +33 (0)6.77.66.21.31
>> fax : +33 (0)4.76.51.38.03
>>
>>
>> -----Message d'origine-----
>> De : postgis-users-bounces at lists.osgeo.org
>> [mailto:postgis-users-bounces at lists.osgeo.org] De la part de Bborie
>> Park Envoyé : jeudi 29 novembre 2012 02:20 À :
>> postgis-users at lists.osgeo.org Objet : Re: [postgis-users] Rast index :
>> Could not get raster's convex hull
>>
>> Hey Hugues,
>>
>> What is your output for
>>
>> SELECT postgis_full_version()
>>
>> -bborie
>>
>> On 11/26/2012 08:01 AM, Francois Hugues wrote:
>>> Hello,
>>>
>>> Here is an error I don't understand when I want to index som tiles
>>> from a raster table :
>>> ERROR:  RASTER_convex_hull: Could not get raster's convex hull
>>>
>>> Here is the query which does not work:
>>> create index slopes_alpes_rast on rasters.slopes_alpes using
>>> gist(st_convexhull(rast));
> create index slopes_alpes_rast on rasters.slopes_alpes using gist (st_convexhull(rast))
>>>
>>> Here are queries that does work without any error :
>>>
>>> 1. simple select give me a geometry for all of my tiles and no one is
>>> null:
>>>
>>> select rid, st_convexhull(rast) from rasters.slopes_alpes
>>>
>>> 2. simple select + index on newly created table :
>>>
>>> create table rasters.tmp_index_gist as select rid,
>>> st_convexhull(rast) geom from rasters.slopes_alpes create index
>>> tmp_idx on rasters.tmp_index_gist using gist(geom)
>>>
>>> It's weird, isn't it ? Any idea of what's happening ? Where do I make
>>> a mistake or what is wrong with my data ?
>>>
>>> Hugues.
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>
>>
>> --
>> Bborie Park
>> Programmer
>> Center for Vectorborne Diseases
>> UC Davis
>> 530-752-8380
>> bkpark at ucdavis.edu
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
>
> --
> Bborie Park
> Programmer
> Center for Vectorborne Diseases
> UC Davis
> 530-752-8380
> bkpark at ucdavis.edu
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu


More information about the postgis-users mailing list