How would PostGIS and MySQL Spatial store the Equator?

toursheet's picture
Point
0% (0 votes)
Line
50% (2 votes)
Polygon
25% (1 vote)
Surface
25% (1 vote)
Ray
0% (0 votes)
Total votes: 4
Login to post comments

Poll Reasoning

toursheet's picture
toursheet - Mon, 2008-12-22 17:22

Let's say for the sake of this poll - You are storing the Equator to determine if a point is on the equator or in the Northern Hemisphere or Southern Hemisphere.


equator = x axis

bec - Tue, 2008-12-23 17:39

Well, you should never need to store the equator. The equator is the X-axis of our latitude/longitude system, so whenever you talk about latitudes, you're already talking about where something is in relation to the equator. To tell whether a point is in the northern or southern hemisphere, you can just look at the latitude: positive or followed by an 'N' means a point is in the northern hemisphere; negative or followed by an 'S' means southern hemisphere.

Chicago, IL:                  41° 53′ 20.36″ N, 87° 37′ 22.2″ W    (decimal:  41.888988, -87.622833)
Quito, Ecuador:               0° 13′ 24.96″ S,  78° 30′ 44.28″ W   (decimal:  -0.2236,   -78.5123)
Johannesburg, South Africa:   26° 12′ 16″ S,    28° 2′ 44″ E       (decimal: -26.204444,  28.045556)

You could store the "northern hemisphere" and "southern hemisphere" as polygons, but it's less efficient and enough of a special case that you might as well just look specifically at points' latitudes.

Aaand that's it for this little geography lesson... :)