<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Simon,<br>
<br>
I will try to answer your second question:<br>
<br>
The result PostGIS calculates is perfectly right. This is, because
900913 is a Mercator projection. One characteristic of this projection
is, that it is not equidistant. The scale is only valid along the
equator. Along the meridians, the map gets distorted towards the poles.
PostGIS's transform-function will output the coordinate, but this has
nothing to do with the distance from the equator on the underlying
spheroid. The valid coordinates for the Mercator projection range from
-PI*r to PI*r for longitudes and from negative infinite to positive
infinite for latitudes, i.e. the y-coordinate for the north pole in a
Mercator projection is positive infinite. Google only uses a coordinate
range of approximately +/-20000000 in both directions (North-South and
Est-West). This corresponds to 180°W to 180°E, but only about 85°S to
85°N on the sphere. If you would like to read a bit more, I suggest,
that you search the Internet for "Mercator projection". Wikipedia would
probably be a good start.<br>
<br>
Regarding your forth question:<br>
<br>
<span style="font-family: courier new,monospace;">select
ST_length_spheroid(GeomFromText('LINESTRING(0 45,90
45)',4326),'SPHEROID["WGS 84",6378137,298.257223563]');<br>
</span><span style="font-family: courier new,monospace;">i get </span><span
style="font-family: courier new,monospace;">6690232.93269468 so it is
smaller as should be</span><br>
<br>
The distance is correct. Why do you think it is to small?<br>
<br>
Regards,<br>
Dirk<br>
<br>
<br>
<blockquote
cite="mid:3151e0120811261623o2e583a2fh923d11b89d1f0069@mail.gmail.com"
type="cite"><br>
<u><b>question 2:</b></u><br>
<br>
I always used SRID 4326 for storing data from maps.google (right now i
need an answer for question number 1)<br>
But how can i count distance between two points i my database?<br>
<br>
I read that i need to convert my projection to a meters projection so i
started to looking for some info and i found that google projection is
900913 and it is in meters so ok.<br>
but...<br>
<br>
I create some example in my database<br>
<br>
<span style="font-family: courier new,monospace;">select
AsText(ST_Transform(GeomFromText('POINT(<b>90 0</b>)',4326),900913));</span><br>
<br>
(point 90 0 is on equator)<br>
and i get:<br>
<br>
<span style="font-family: courier new,monospace;">POINT(<b>10018754.1713946</b>
-7.08115455161362e-010)</span><br>
<br>
<span style="font-family: arial,helvetica,sans-serif;">so we know
that equator has 40075km and 360 degrees so after I multiply </span><span
style="font-family: courier new,monospace;"><b
style="font-family: arial,helvetica,sans-serif;"><span
style="font-family: courier new,monospace;">10018754.1713946</span></b><span
style="font-family: arial,helvetica,sans-serif;">m</span><span
style="font-family: arial,helvetica,sans-serif;"> by </span><b
style="font-family: courier new,monospace;">4</b><span
style="font-family: arial,helvetica,sans-serif;"> I get <b
style="font-family: courier new,monospace;">40075016.68</b>m so it is
correct. <br>
<br>
</span></span><span style="font-family: courier new,monospace;">select
AsText(ST_Transform(GeomFromText('POINT(<b>0 45</b>)',4326),900913));</span><br>
<span style="font-family: courier new,monospace;"><br>
</span>i get<br>
<br>
<span style="font-family: courier new,monospace;">POINT(0
5621521.48619207)<br>
<br>
we know that meridians have about </span><font color="#000000"
face="Arial, Helvetica, sans-serif" size="2"><b>20 003</b>km (only 180
degrees) so if we multiply </font><span
style="font-family: courier new,monospace;"><b>5621521.48619207</b>m
by <b>4</b> we get </span><b>22486058.94</b>m hmmmmm so it is too
much. Why?<br>
<br>
<br>
</blockquote>
</body>
</html>