[postgis-users] Why doesn't startpoint work? (and X() for that matter)

Ethan Alpert ealpert at digitalglobe.com
Mon Dec 27 16:14:51 PST 2004



>From the docs:

X(geometry)
Find and return the X coordinate of the first point in the geometry.
Return NULL if there is no point in the geometry.

StartPoint(geometry)
Returns the first point of the geometry as a point.

spatialdb=> select startpoint(the_geom),X(the_geom),the_geom from snaps
where catalogid ='101001000379CE01';
-[ RECORD 1]
startpoint | 
x          | 
the_geom   | SRID=4326;POLYGON((73.2565444444444
45.141725,73.4717277777778 45.1421555555556,73.4707527777778
44.9756666666667,73.257175 44.975625,73.2565444444444 45.141725))

So what gives?! Why do these return NULL? Is there a better reference
doc somewhere?

While we're on the subject how can I convert between geometry types? I'd
like to turn some polygons into lines.

-e



More information about the postgis-users mailing list