[postgis-users] plpgsql build BOX3D
Miguel de la Fuente
mjdelafuente at gmail.com
Fri Nov 4 08:27:52 PST 2005
Thank you very much. The first solution still doesn't work, but the second
does.
Miguel
On 11/3/05, Markus Schaber <schabi at logix-tt.com> wrote:
>
> Hi, Miguel,
>
> Miguel de la Fuente wrote:
>
> > RETURN 'BOX3D('||($1-100)::VARCHAR ||'
> > '||($2-100)::varchar||','||($1+100)::VARCHAR||'
> > '||($2+100)::varchar||')'::BOX3D;
>
> Your ::BOX3D cast tries to cast the last string ')' to a Box3d due to
> operator precedence (just like the ::varchar casts).
>
> Try the following:
>
> RETURN ('BOX3D('||($1-100)::VARCHAR ||' '||($2-100)::varchar||','||
> ($1+100)::VARCHAR||''||($2+100)::varchar||')' ) ::BOX3D;
>
> Or some more readable:
>
> RETURN expand(makepoint(23,42),100)::box3d;
>
> HTH,
> Markus
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20051104/44399fac/attachment.html>
More information about the postgis-users
mailing list