5

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!

Chris
  • 85
  • 2
  • 5

2 Answers2

2

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

Community
  • 1
  • 1
Stefan
  • 1,036
  • 1
  • 10
  • 14
0

I had a similar problem in cartodb (which also uses PostGIS); I wanted to get curved lines from straight lines. Maybe this post can help.

Community
  • 1
  • 1
user56591
  • 473
  • 1
  • 4
  • 11