[ale] Decimal Degrees in MySQL

Jeff Hubbs hbbs at comcast.net
Fri Mar 14 12:46:27 EDT 2008


FWIW, IIRC, PostgreSQL has a built-in geographic type.  Can't speak as 
to its spatial resolution as applied to Earth (resolution would increase 
as size of celestial body in question decreases).

- Jeff

Greg Freemyer wrote:
> Is it a big deal if the last digit of accuracy changes due to rounding issues?
>
> If so, you need to really test all the corner cases.  ie. Float has a
> real tendency to take  2.999999 and turn it into 3.000000 or 2.999998.
>
> On Fri, Mar 14, 2008 at 10:17 AM, Christopher Fowler
> <cfowler at outpostsentinel.com> wrote:
>   
>> I actually used a signed double(10,2)
>>
>>  It seems to work for now.
>>
>>
>>  On Fri, 2008-03-14 at 10:05 -0400, Chris Kleeschulte wrote:
>>  >
>>  > I am assuming you mean decimal degrees as it relates to GIS to express
>>  > lat and long coordinates. Using a floats can be really really tricky
>>  > if resolution of this magnitude is required. Computers cannot
>>  > represent certain floats accurately just as humans have problems
>>  > computing PI accurately. I would use a string or convert to an integer
>>  > where there is not a chance to loose resolution.
>>  >
>>  >
>>  >
>>  >
>>  > Chris
>>
>>
>>     
>>  >
>>  >
>>  >
>>  > On Mar 12, 2008, at 4:11 PM, Christopher Fowler wrote:
>>  >
>>  > > Can someone tell me the best way to store decimal degrees in MySQL?
>>  > >
>>  > >
>>  > > I want to create columns named ddlat and ddlon.  I'm not sure if I
>>  > > should use a float,double, or just a string.
>>  > >
>>  > >
>>  > > Decimal Degrees is formated like this:
>>  > >
>>  > >
>>  > > (-)XXX.XXXXXX
>>  > >
>>  > >
>>  > > Chris
>>  > >
>>  > >
>>  > >
>>  > >
>>  > > _______________________________________________
>>  > > Ale mailing list
>>  > > Ale at ale.org
>>  > > http://mail.ale.org/mailman/listinfo/ale
>>  >
>>
>>  _______________________________________________
>>  Ale mailing list
>>  Ale at ale.org
>>  http://mail.ale.org/mailman/listinfo/ale
>>
>>     
>
>
>
>   



More information about the Ale mailing list