<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
ok Paul, progress report and problem. <span class="moz-smiley-s1"><span>
:-) </span></span> <br>
<br>
I am trying to find a conversion for Lon/meters and Lat/meters as you
suggested in a previous post in this thread.  I am using long lats in
Houston, TX.<br>
<br>
Sample sql file:<br>
<br>
-- calculating number of decimal degrees long/meter and decimal number
of degrees lat/meter around the following point:<br>
-- long -95.09846 lat 29.55475<br>
<br>
-- calculating number of decimal degrees long/meter<br>
select length_spheroid( 'LINESTRING( -95.09846 29.55475, -93.09846
29.55475 )', 'SPHEROID["GRS_1980",6378137,298.257222101]' ) AS "Degrees
Longitude Per Meter" ;<br>
<b><br>
This result is always NaN for points with the same latitude.</b><br>
<br>
-- calculating number of decimal number of degrees lat/meter<br>
select length_spheroid( 'LINESTRING( -95.09846 29.55475, -95.09846
27.55475 )', 'SPHEROID["GRS_1980",6378137,298.257222101]' ) AS "Degrees
Latitude Per Meter" ;<br>
<br>
<b>This works just fine.<br>
<br>
<br>
</b>What am I doing wrong?<br>
<br>
-- Hugh W. O'Brien<br>
<br>
<br>
Paul Ramsey wrote:<br>
<blockquote type="cite" cite="mid3DFF5E00.5080508@refractions.net">Then
the fastest way to get something in operation is to calculate the
miles/longitude value for somewhere in the south of Texas and use that
everwhere. Construct query boxes in lat/lon using the (fixed)
miles/latitude and miles/longitude values and then compare distances
using distance_spheroid... the SQL will end up looking something like: <br>
  <br>
select * from postaltable where <br>
  the_geom && BOX3D( X - R * Lon/Miles , Y - R * Lat/Miles ,
etc etc ) <br>
  and <br>
  distance_spheroid( POINT( X Y ) , the_geom , SPHEROID ) < R <br>
  <br>
Note that I have completely bastardized the constructors for the
various objects above in the interests of understandability. I assume
you can fill out the details yourself... <br>
  <br>
P. <br>
  <br>
Hugh W. O'Brien wrote: <br>
  <blockquote type="cite">Unfortunately, I must support all US postal
codes so all of continental US and it's territories.  I might also
have to include support for Canada in the future. <br>
  </blockquote>
  <br>
  <br>
</blockquote>
</body>
</html>