Hello,<div><br></div><div>I'm somewhat new to GIS and I have a problem that I thought appeared to be simply using a wrong projection or datum, but it seems to be a bit more subtle than that.</div><div><br></div><div>I have a table of cities in the US and I'm trying to find distances between them. When I use a city that is in the northern US, it works fine.  When I try to find the distance between two cities in the Southern US, the distance becomes way off.</div>
<div><br></div><div>I setup a Geometry in my cities table and populated it like the following:</div><div><br></div><div><div>select AddGeometryColumn('cities','geom',32661,'POINT',2);</div><div>UPDATE cities SET  geom=transform(setsrid(makepoint(longitude, latitude),4269), 32661)</div>
</div><div><br></div><div>(I find the latitude and longitude from the Yahoo Geocode service)</div><div><br></div><div>A distance calc from McHenry, IL to Dallas, TX is calculated as:</div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'lucida grande', verdana, helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">select distance( (select geom from cities where id=26251), (select geom from cities where id=67) )*0.000621371192 as miles;</span></div>
<div><font class="Apple-style-span" color="#333333" face="'lucida grande', verdana, helvetica, arial, sans-serif"><span class="Apple-style-span" style="font-size: 14px;"><div>     miles       </div><div>------------------</div>
<div> 996.717850542391</div><div>(Google Maps reads as 972, off by 25 miles or off around 4%)</div><div><br></div><div><br></div><div>But Birmingham, AL, to Miami, FL is calculated as:</div><div><div>leader=# select distance( (select geom from cities where id=26251), (select geom from cities where id=67) )*0.000621371192 as miles;</div>
<div>      miles       </div><div>------------------</div><div> 996.717850542391</div></div><div>(Google Maps reads as 767, off by 120 files, or 13%).</div><div><br></div><div>I can handle a little error, as long as it's somewhat small (<5%).  But this is way off.</div>
<div><br></div><div>Again, it smells to be to be a datum or projection issue to me, but I'm not sure how to find the sweet spot to be accurate everywhere.</div><div><br></div><div>Your input is appreciated.</div><div>
<br></div><div><br></div></span></font>-- <br>Mike Hostetler<br>SquarePeg Systems<br><a href="http://www.squarepegsystems.com">http://www.squarepegsystems.com</a><br>
</div>