[postgis-users] st_makeline

Drew Sheedy drew at olvec.net
Sun May 4 16:37:34 PDT 2008


Hi Bob,

I'm new to postgis as well (and am and loving it).

You do have syntax errors in your sql. Note the definitions of the functions
that you are using from the postgis manual:

ST_MakePoint(<x>, <y>, [<z>], [<m>])
ST_MakeLine(geometry set)
ST_MakeLine(geometry, geometry)

So your point sql is valid as it accepts integers, though your line sql is
not because you are not using a geometry type.

Try the following: st_makeLine(st_makePoint(0, 2), st_makePoint(0, 1))

HTH

Drew

On Mon, May 5, 2008 at 8:15 AM, Bob Pawley <rjpawley at shaw.ca> wrote:

> Hi
>
> I am trying to learn the basics of Postgis by populating a table with
> various geometries.
>
> When I run this -
> Insert into graphics.process (the_geom) values (st_makepoint(0 2));
>
> it results in a point which I can see on the viewer.
>
> However, when I run the following, or any variation of coordinate syntax
> to obtain a line, I get a syntax error.
>
> Insert into graphics.process (the_geom) values (st_makeline (0 2), (0 1));
> Or
> Insert into graphics.process (the_geom) values (st_makeline (0 2, 0 1));
> Or
> Insert into graphics.process (the_geom) values (st_makeline (0 2 0 1));
> Or
> Insert into graphics.process (the_geom) values (st_makeline (0, 2, 0, 1));
> Or
> Insert into graphics.process (the_geom) values (st_makeline (0, 2), (0,
> 1));
>
> Any thoughts would be appreciated.
>
> Bob
>
> _______________________________________________
> 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/20080505/5260f364/attachment.html>


More information about the postgis-users mailing list