<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Colin,<div><br class="webkit-block-placeholder"></div><div>Okay, I've got a bit closer. The right way to do this is likely a function that computes the route between two points borrowing from some of the formulas here:</div><div><a href="http://williams.best.vwh.net/avform.htm#Crs">http://williams.best.vwh.net/avform.htm#Crs</a> The postgis function that calculates the great circle distance is likely engineered this way, but we'll have to hear from the experts on that.</div><div><br class="webkit-block-placeholder"></div><div>In the meantime, I'm close to a hack that might suffice for you without a custom function.</div><div><br class="webkit-block-placeholder"></div><div>It is:</div><div><br class="webkit-block-placeholder"></div><div>reproject your points > make a line > interpolate points along that line to get the curvature you are after for visual effect.</div><div><br class="webkit-block-placeholder"></div><div>The projection you choose here will impact the route and how much it appears like a great circle.</div><div><br class="webkit-block-placeholder"></div><div>Then plot the resulting line in openlayers with mapserver in WGS 84 proj.</div><div><br class="webkit-block-placeholder"></div><div>This seems to work aside from the problem that the route from hong kong to chicago cross the date line. I think there may be some workarounds for dateline stuff in openlayers, but I'm not sure.</div><div><br></div><div>Here is the code:</div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; color: rgb(0, 0, 204); ">drop<span style="color: #000000"> </span>table<span style="color: #000000"> </span>if<span style="color: #000000"> </span>exists<span style="color: #000000"> airports;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><span style="color: #0000cc">create</span> <span style="color: #0000cc">table</span> airports (<span style="color: #0000cc">id</span> serial,the_geom geometry);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><span style="color: #0000cc">INSERT</span> <span style="color: #0000cc">into</span> airports (the_geom) <span style="color: #0000cc">values</span> (geomfromtext(<span style="color: #ff3399">'Point(-87.904841 41.978603 0)'</span>,4326));</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><span style="color: #0000cc">INSERT</span> <span style="color: #0000cc">into</span> airports (the_geom) <span style="color: #0000cc">values</span> (geomfromtext(<span style="color: #ff3399">'Point(113.914722 22.308889 0)'</span>,4326));</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><font class="Apple-style-span" color="#0000CC"><br class="webkit-block-placeholder"></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><span style="color: #0000cc">drop</span> <span style="color: #0000cc">table</span> <span style="color: #0000cc">if</span> <span style="color: #0000cc">exists</span> eq_dist_airports;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><span style="color: #0000cc">SELECT</span> <span style="color: #0000cc">id</span>, ST_Transform(the_geom, 2163) <span style="color: #0000cc">as</span> the_geom <span style="color: #0000cc">into</span> eq_dist_airports <span style="color: #0000cc">from</span> airports;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; color: rgb(0, 0, 204); "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; color: rgb(0, 0, 204); ">drop<span style="color: #000000"> </span>table<span style="color: #000000"> </span>if<span style="color: #000000"> </span>exists<span style="color: #000000"> route;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><span style="color: #0000cc">select</span> ST_Makeline(the_geom) <span style="color: #0000cc">as</span> the_geom <span style="color: #0000cc">into</span> route <span style="color: #0000cc">from</span> eq_dist_airports;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; color: rgb(0, 0, 204); "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; color: rgb(0, 0, 204); ">drop<span style="color: #000000"> </span>table<span style="color: #000000"> </span>if<span style="color: #000000"> </span>exists<span style="color: #000000"> points;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><span style="color: #0000cc">select</span> line_interpolate_point(the_geom,generate_series(1,100)/100.0) <span style="color: #0000cc">as</span> the_geom <span style="color: #0000cc">into</span> points <span style="color: #0000cc">from</span> route;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; color: rgb(0, 0, 204); "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; color: rgb(0, 0, 204); ">drop<span style="color: #000000"> </span>table<span style="color: #000000"> </span>if<span style="color: #000000"> </span>exists<span style="color: #000000"> great_circle_wgs;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; ">Select ST_Makeline(ST_Transform(the_geom, 4326)) <span style="color: #0000cc">as</span> the_geom <span style="color: #0000cc">into</span> great_circle_wgs <span style="color: #0000cc">from</span> points;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; ">And here is what I get viewing that in uDig:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10.5px/normal 'Lucida Grande'; "><img height="480" width="612" apple-width="yes" apple-height="yes" src="cid:9131366C-6B86-42FF-9D6F-EF615B893DD8@hsd1.wa.comcast.net."></div></div><div><br><div><div>On Feb 21, 2008, at 8:17 PM, Colin Wetherbee wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Dane Springmeyer wrote:<br><blockquote type="cite">cool. I don't know much about how mapserver plays with postgis behind the scenes but I bet that reproject works because postgis is doing it (being ask by mapserver) and then mapserver can handle 4326 WGS 84. Am I understanding right that this is your SQL in your mapserver mapfile?<br></blockquote><br>I tried with SRIDs 4047 and 2163, which seem to be spherical-ish, and those produce straight lines. Your idea about MapServer not interpreting 53027 as valid was probably correct.<br><br>And, yes, that's the SQL from my map file.<br><br>Actually, it's wrapped in stuff like...<br><br>DATA "line FROM (query goes here) AS foo USING UNIQUE uid USING SRID=xxx"<br><br>Colin<br><br></blockquote></div><br></div></body></html>