homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Need to generate correct longitude & latitude .SQL
Need to auto-generate extra coordinate numbers in a .SQL file

Msg#: 4685431 posted 4:02 pm on Jul 6, 2014 (gmt 0)

Hi guys,
I'm not fluent in database programming languages, but I am trying to auto-generate some numbers to put in a .sql file.

The numbers I am trying to auto-generate refer to something that are called rad_latitude and rad_longitude in this particular .SQL file.

See example below:

INSERT INTO `dsb_loc_zips` (`zip_id`, `zipcode`, `fk_country_id`, `fk_state_id`, `fk_city_id`, `latitude`, `rad_latitude`, `longitude`, `rad_longitude`) VALUES

(42789, 'OX1', 217, 63, 212310, 51.729639, 0.9028525214180669, -1.28049, -0.02234876653886219),

51.729639 latitude

0.9028525214180669 rad_latitude

-1.28049 longitude

-0.02234876653886219 rad_longitude

I was able to generate the above code by "manually" entering some location info, including the latitude and longitude numbers into a Admin/CMS area of a website.
... I did not know the "rad_" numbers. The site auto-generated them.

Do you know of any Program, Website or Excel file etc, that by entering a long list of "latitude" and "longitude" numbers... can auto-generate the relevant "rad_latitude" and "rad_longitude" numbers?

Thank you for reading :)



WebmasterWorld Administrator lifeinasia us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Msg#: 4685431 posted 4:50 pm on Jul 6, 2014 (gmt 0)

Converting degrees to radians (and back again) is fairly basic trigonometry- multiply the number of degrees by pi/180.


Msg#: 4685431 posted 9:58 am on Jul 8, 2014 (gmt 0)

Thank you.
Will look into this...

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved