<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><blockquote type="cite">2008/5/27 MaRcELo PeReiRa <<a href="mailto:marcelops.stuff@gmail.com">marcelops.stuff@gmail.com</a>>:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi there,<br><br>It's my first post in this list, and here is my first question:<br><br>Which is the correct way to store in a table some geografic coordinates???<br><br>I have a point: <br>- S 22º 04' 2,5''<br> - W 46º 50' 34,9''<br><br>How can I store it??? Should I convert it??<br><br>Thanks in advance,<br>Marcelo / Brasil</blockquote></div></blockquote><div><br></div><div><br></div>On May 26, 2008, at 10:37 PM, Mark Leslie wrote:</div><div><blockquote type="cite">Try something along the lines of:<br> <br> CREATE TABLE points (id SERIAL);<br> SELECT addGeometryColumn('points', 'the_geom', 4326, 'POINT', 2);<br> INSERT INTO points (the_geom) VALUES (setSRID(geomFromText('POINT(' || (46 + 50/60.0 + 34.9/360.0) || ' ' || -(22 + 4/60.0 + 2.5/360.0) || ')'), 4326));<br> SELECT id, asText(the_geom) FROM points;<br></blockquote><div><br></div></div>I'll warn that SRID = 4326 refers to one set of geographic coordinates, based on the WGS84 datum, but there are others, so make sure you know which one your data refers to. 0.1" ~ 10 m, a shift I've seen when changing a datum.<div><br></div><div>Cheers,</div><div><br></div><div>-- Andy</div><div><br></div></div></body></html>