RE: Storing co-ordinate / spatial information in non-GIS systems

  • From: "David Wendelken" <davewendelken@xxxxxxxxxxxxx>
  • To: "'oracle-l'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 15 Aug 2005 07:31:31 -0400

>
>What I am grappling with is how to keep the co-ordinate pair 
>"atomic".  If I used separate fields for the latitude and 
>longitude, an unknown point would have two nulls, a known 
>point two values ... one of each would be "verboten", and hard 
>to protect against using normal check constraints (or maybe 
>I'm just having a senior moment).  

I vote for senior moment. :)

Use a check constraint on the table:

(latitude is not null and longitude is not null) or (latitude is null and
longitude is null).

Of course, if you were storing true historical data, only knowing the
latitude would be perfectly correct.  
(But I digress...)


--
//www.freelists.org/webpage/oracle-l

Other related posts: