[postgis-users] Orthographic projection problems
Kevin Jardine
kevin.jardine at int.greenpeace.org
Thu Sep 2 12:15:33 PDT 2004
I'm new to PostGIS and I'm trying to transform a latlong (SRID 4326) map
of the world into an earth-from-space orthographic projection.
I added this Proj 4 definition:
insert into spatial_ref_sys (srid, proj4text) values
(200000,'+proj=ortho +lat_0=%lat +lon_0=%lon +x_0=0.0 +y_0=0.0 +units=m')
where %lat and %lon is the centre point of the orthographic projection.
My first attempts failed because adding something like
where distance(GeometryFromText('POINT(%lon %lat)',4326),the_geom) < 90
to my latlong geom select still selected lots of points that were not
projectable (they are "behind the Earth").
I used the equations here:
http://mathforum.org/library/drmath/view/52049.html
to construct a polygon that I can use in an intersection to filter out
the non-projectable points before the transform.
This works most of the time, but I still sometimes find that either the
intersection or (usually) the transform fails, typically in a nasty way
that crashes my PostgreSQL backend with a Signal 11 :(
I am thinking that surely there is an easier way to use PostGIS to do
orthographic projections.
Any suggestions?
By the way, I am using proj 4.4.8, postgresql 7.4.5, and the latest geos
2 and postgis cvs versions from a couple of days ago on a Linux box with
2 Gb of RAM.
Cheers,
Kevin
--
Kevin Jardine
New Media Campaigner
Greenpeace International
Tel: + 31205148150 (main switchboard)
Mobile: + 31652062980
Become a cyberactivist!
http://act.greenpeace.org/register
More information about the postgis-users
mailing list