[postgis-users] typecast from point to geometry for distance_sphere

Markus Schaber schabi at logix-tt.com
Mon Jan 16 09:13:29 PST 2006


Hi, Assad,

Assad Jarrahian wrote:

> SELECT distance_sphere((point(12,23)), point(12,24));
>
> So I guess I need a type cast (how do I do that?) or maybe I am doing
> something wrong (I noticed all the methods that take any spatial
> argument are of type geometry).
> I thought that point was of geometry type, I guess I maybe wrong.

Point is a PostgreSQL provided geometry data type that currently is not
feasible for GIS work.

Geometry is the PostGIS datatype that is used for all GIS geometry data,
you can use makepoint() to create it.

IMHO, it would make sense to provide casts between PostgreSQL and
PostGIS geometry objects, but no one has provided them yet.

HTH,
Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-users mailing list