[postgis-tickets] [PostGIS] #3924: ST_Project does not project perfectly east-west

PostGIS trac at osgeo.org
Wed Nov 8 06:39:34 PST 2017


#3924: ST_Project does not project perfectly east-west
----------------------+---------------------------
  Reporter:  petermj  |      Owner:  pramsey
      Type:  defect   |     Status:  closed
  Priority:  medium   |  Milestone:  PostGIS 2.4.2
 Component:  postgis  |    Version:  2.4.x
Resolution:  invalid  |   Keywords:
----------------------+---------------------------

Comment (by petermj):

 I agree with you if this were a geometry calculation, but this is a
 geography calculation, where north/south should follow lines of latitude,
 and east/west should follow lines of longitude.

 If I move X degrees east, I would not expect my latitude to vary, the
 ST_Project function projects my movement in metres, so my latitude should
 not vary.

 ---

 Alternatively, you may be saying that this should use a geometry
 calculation, and projecting east, aligned with the cartesian grid, should
 line up with the longitude axis, and only the latitude should change. But
 this also does not work:

 PostGIS does not seem to calculate this differently for the geometry and
 geography types.

 {{{
 SELECT
     -- ST_Project(pt, distance, 0) move pt by distance north
     -- ST_Project(pt, distance, radians(90)) move pt by distance east
     -- ST_Project(pt, distance, radians(180) move pt by distance south
     -- ST_Project(pt, distance, radians(270)) move pt by distance west
 count,
 ST_AsEWKT( ST_Project( ST_Project( st_geogfromtext('SRID=4326; POINT(-4.5
 63)'), count*10000.0, radians(0)), count*10000.0,  radians(90))),
 ST_AsEWKT( ST_Project( ST_Project( st_geogfromtext('SRID=4326; POINT(-4.5
 63)'), count*10000.0, radians(90)), count*10000.0, radians(0))),
 ST_AsEWKT( ST_Project( ST_Project( st_geomfromtext('SRID=4326; POINT(-4.5
 63)'), count*10000.0, radians(0)), count*10000.0,  radians(90))),
 ST_AsEWKT( ST_Project( ST_Project( st_geomfromtext('SRID=4326; POINT(-4.5
 63)'), count*10000.0, radians(90)), count*10000.0, radians(0)))
 FROM generate_series(-5, 5) as count
     ORDER BY count
 }}}

 I feel like one of these geo-systems should allow me to project a point
 purely along an east-west axis, and I am beginning to feel that it is the
 geometry type that should be treating the axes separately, and so the
 st_project function should move in only one axis for azimuth=n*pi/2.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3924#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list