# Coordinates for geokit

**URL:** <https://www.ruby-forum.com/t/coordinates-for-geokit/175807>\
**Category:** Rails\
**Created:** [September 20, 2009, 9:12am UTC](https://www.ruby-forum.com/t/coordinates-for-geokit/175807 "2009-09-20T09:12:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [September 20, 2009, 9:12am UTC](https://www.ruby-forum.com/t/coordinates-for-geokit/175807/1 "2009-09-20T09:12:04Z")

</div>

i’m trying geokit and loving it, but i’m seeing really odd stuff on  
distances, I’m wondering about the coordinates i’ve got in my DB. I  
don’t think they’re standard format, they look like this.

east 6’41.6 north 45’24.8

Can anyone advise please ?

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [September 20, 2009, 9:19am UTC](https://www.ruby-forum.com/t/coordinates-for-geokit/175807/2 "2009-09-20T09:19:21Z")

</div>

Someone said i can convert these with a regex ? that right ?

Maybe on the fly ?

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [September 21, 2009, 10:30am UTC](https://www.ruby-forum.com/t/coordinates-for-geokit/175807/3 "2009-09-21T10:30:43Z")

</div>

Ok, thanks, noted re the google group - good point.

Anyone else help on this? Maybe I build a rake task to convert all the  
values to floats with a regex? OR just convert these on the fly to  
floats somehow with a regex.

Either way I could do with a hand, don’t know how to do it.

Quite happy to play around in script/console to check inputs and outputs  
of regex’s.

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [September 20, 2009, 2:21pm UTC](https://www.ruby-forum.com/t/coordinates-for-geokit/175807/4 "2009-09-20T14:21:38Z")

</div>

I think geokit wants lat,lng as floats (or something it can easily  
convert into floats with to\_f). It’s hard to tell from the API whether  
distance\_from is processed in rails or using SQL trig functions. Since  
geokit does a lot of processing on the database side rather than in  
rails, it may be easier if you can find some way to store your data in  
that format.

Also: this may be get you more expert help with geokit:  
[http://groups.google.com/group/geokit](http://groups.google.com/group/geokit)

On Sep 20, 12:19 am, bingo bob [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
