[postgis-users] MULTIPOINT geometry variable
Rodrigo Martín LÓPEZ GREGORIO
rodrigomlg at yahoo.com.ar
Thu Feb 15 06:37:36 PST 2007
Thanks for your answer.
I think that GeomUnion could work. However I have a problem. In my function
I have some IF statements that adds points depending on different conditions
to "mymultipoint" variable. So what I had to do to add points to
mymultipoint variable was:
mymultipoint:=GeomUnion(newpoint,mymultipoint);
But if mymultipoint variable has not points yet, this doesnt work so I must
check in every assignment if mymultipoint variable is null or empty or
something like that. However I think that there may be a much simple way to
do that. I think that must be something like
addpoint(mymultipoint,newpoint).
Another solution could be initialize mymultipoint variable in some way that
not implies adding a point.
I don't know if you understand what I'm trying to do... just a function that
returns a MULTIPOINT variable with a undetermined number of points that
depends on some conditions.
Thanks.
Rodrigo.
On 2/14/07, Markus Schaber <schabi at logix-tt.com> wrote:
>
> Hi, Rodrigo,
>
> "Rodrigo Martín LÓPEZ GREGORIO" <rodrigomlg at yahoo.com.ar> wrote:
>
> > I'm creating a postgres function and I need that it returns a multipoint
> > geometry so then I access to the geometry returned using the
> > geometryN(mymultipoint) function.
> >
> > I create "mymultipoint" variable like:
> >
> > mymultipoint geometry;
> >
> > but I could not find the way to add points to that geometry, except
> using a
> > linestring and using the AddPoint() function. I dont know if there is a
> way
> > to add some points to a geometry and then access its using the
> geometryN()
> > function, but that is what I'm looking for.
>
> I see several options:
>
> Use geomunion() or collect() to collect and merge your points.
>
> Create a String representation, and use GeomFromEWKT(), GeomFromText()
> or MPointFromText().
>
>
>
> Regards,
> Markus
>
> --
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf. | Software Development GIS
>
> Fight against software patents in Europe! www.ffii.org
> www.nosoftwarepatents.org
> _______________________________________________
> 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/20070215/7194d94d/attachment.html>
More information about the postgis-users
mailing list