I had to display thousands of coordinates
I recently pushed some PHP code to cluster coordinates that helped me cope with hundreds of thousands of geographic locations.
Turns out drawing all of those on a map isn’t that trivial…
I recently pushed some PHP code to cluster coordinates that helped me cope with hundreds of thousands of geographic locations.
Turns out drawing all of those on a map isn’t that trivial…
A 2-dimensional location on our earth can be represented via a coordinate system similar to an X & Y-axis. These axes are called latitude (lat) & longitude (lng).
Latitude is the north-south axis with a minimum of -90 (south pole) and maximum of 90 degrees (north pole). The equator is zero degrees latitude.
Longitude is the X-axis equivalent, running around the globe from east to west: from -180 to +180 degrees. The Greenwich meridian is 0 degrees longitude. Everything west and east from it is respectively negative and positive on the longitude scale, up until the middle of the Pacific Ocean, near the International Date Line, where -180° longitude crosses over to 180°.