Re: Latitude and Longitude Functions

From: Patrick Dowler <patrick.dowler-at-nrc-cnrc.gc.ca>
Date: Thu, 15 May 2008 10:03:10 -0700

Hmm, you should be able to apply those functions to POINT(...), to a column of type point, and to CENTROID(...), but you cannot apply them to a geometry in general. The proposed COORDSYS function, on the other hand, can be applied to any geometry. So, the argument to LATITUDE et al should be something like:

<lat_args> ::= <point> | <centroid> | <column_reference>

My understanding is that it is always the case that the BNF does not actually enforce correct column types; the DB has to cast/convert or fail.

pat

On 2008-5-15 07:25, Jeff Lusted wrote:
> Hi Pat!
>
> [My apologies if you get this more than once]
>
> I've been looking at Roy Williams' comments. And pondering Latitude and
> Longitude functions. Have I misunderstood, and is there an unnecessary
> limitation? From the BNF:
>
> <latitude> ::= LATITUDE <left_paren> <point> <right_paren>
>
> and
>
> <point> ::= POINT <left_paren> <coord_sys> <comma> <coordinates>
> <right_paren>
>
> POINT is a geometry expression. You cannot do:
>
> select latitude( a.col1 ) from cata as a ;
>
> Is this a problem?
> Regards
> Jeff

-- 

Patrick Dowler
Tel/Tél: (250) 363-6914                  | fax/télécopieur: (250) 363-0045
Canadian Astronomy Data Centre   | Centre canadien de donnees astronomiques
National Research Council Canada | Conseil national de recherches Canada
Government of Canada                  | Gouvernement du Canada
5071 West Saanich Road               | 5071, chemin West Saanich
Victoria, BC                                  | Victoria (C.-B.)
Received on 2008-05-15Z19:03:40