Example #1
0
int msProjectRect(projectionObj *in, projectionObj *out, rectObj *rect)
{
#ifdef notdef
  return msProjectRectTraditionalEdge( in, out, rect );
#else
  char *over = "+over";
  int ret;
  projectionObj in_over,out_over,*inp,*outp;
  /* 
   * Issue #4892: When projecting a rectangle we do not want proj to wrap resulting
   * coordinates around the dateline, as in practice a requested bounding box of
   * -22.000.000, -YYY, 22.000.000, YYY should be projected as
   * -190,-YYY,190,YYY rather than 170,-YYY,-170,YYY as would happen when wrapping (and
   *  vice-versa when projecting from lonlat to metric).
   *  To enforce this, we clone the input projections and add the "+over" proj 
   *  parameter in order to disable dateline wrapping.
   */ 
  if(out) {
    msInitProjection(&out_over);
    msCopyProjectionExtended(&out_over,out,&over,1);
    outp = &out_over;
  } else {
    outp = out;
  }
  if(in) {
    msInitProjection(&in_over);
    msCopyProjectionExtended(&in_over,in,&over,1);
    inp = &in_over;
  } else {
    inp = in;
  }
  ret = msProjectRectAsPolygon(inp,outp, rect );
  if(in)
    msFreeProjection(&in_over);
  if(out)
    msFreeProjection(&out_over);
  return ret;
#endif
}
Example #2
0
int msCopyProjection(projectionObj *dst, projectionObj *src)
{
  return msCopyProjectionExtended(dst,src,NULL,0);
}