Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geoserver - How do I draw a geodesic line that represents the great circle between two points

I'm using Geoserver version 2.1.1, Postgres 9 and PostGIS 2.0

What I want to achieve should (i think!) be quite straight forward. I want to render on a map a line that represents the Great Circle between two cities on the earths surface.

My database contains the city locations represented as geography points defined as latitude and lonfitude pairs.

I have a layer defining an SQL view in Geoserver which retrieves a linestring (st_makeline) from the two coordinates for the specified cities. I'm having to type cast the geographies to geometries to get this to work.

But when I draw the returned line on a map what i get is a straight line and not the curved line that I am expecting.

Can someone tell me how I should be going about this?

Thanks!

like image 530
Chris Avatar asked Nov 05 '22 09:11

Chris


1 Answers

PostGIS offers mainly "constructors" of the base geometries point, linestring and polygone, like ST_MakeLine.

And what yo uwant to do depends also on the coordinate reference system you use when displaying your map layers.

Here's a nice trick about great circles or parts of: https://gis.stackexchange.com/questions/5204/curved-point-to-point-route-maps

Yours, Stefan

P.S. Here's some related stuff: Drawing circles on a sphere And here's some math: http://www.mathworks.ch/matlabcentral/newsreader/view_thread/277881

like image 111
Stefan Avatar answered May 17 '23 18:05

Stefan