pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to use function PointN?
2+ messages / 2 participants
[nested] [flat]

* How to use function PointN?
@ 2007-05-07 08:07 Nemo Terry <ntuser155@hotmail.com>
  2007-05-07 13:13 ` Re: How to use function PointN? Michael Fuhr <mike@fuhr.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Nemo Terry @ 2007-05-07 08:07 UTC (permalink / raw)
  To: pgsql-sql

select PointN(envelope(polyline),1) from highway;
return null,why?

_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com 




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to use function PointN?
  2007-05-07 08:07 How to use function PointN? Nemo Terry <ntuser155@hotmail.com>
@ 2007-05-07 13:13 ` Michael Fuhr <mike@fuhr.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Fuhr @ 2007-05-07 13:13 UTC (permalink / raw)
  To: Nemo Terry <ntuser155@hotmail.com>; +Cc: pgsql-sql

On Mon, May 07, 2007 at 04:07:00PM +0800, Nemo Terry wrote:
> select PointN(envelope(polyline),1) from highway;
> return null,why?

PointN is a PostGIS function; you might get more help on the
postgis-users mailing list.

http://postgis.refractions.net/mailman/listinfo/postgis-users

See also the PostGIS documentation for Envelope and PointN:

http://postgis.refractions.net/docs/ch06.html

Envelope(geometry)

    Returns a POLYGON representing the bounding box of the geometry.

PointN(geometry,integer)

    Return the N'th point in the first linestring in the geometry.
    Return NULL if there is no linestring in the geometry.

You've used Envelope to get a polygon but PointN expects a linestring.
Try using ExteriorRing on Envelope's polygon:

SELECT PointN(ExteriorRing(Envelope(polyline)), 1) FROM highway;

-- 
Michael Fuhr



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-05-07 13:13 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-05-07 08:07 How to use function PointN? Nemo Terry <ntuser155@hotmail.com>
2007-05-07 13:13 ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox