- Most aggregates (raster and geometry),
and all stable / immutable (raster and geometry) marked as parallel safe
- #2249, ST_MakeEmptyCoverage for raster (David Zwarg, ainomieli)
+ - #3709, Allow signed distance for ST_Project (Darafei Praliaskouski)
* Enhancements *
<para>The distance is given in meters.</para>
<para>Availability: 2.0.0</para>
+ <para>Enhanced: 2.4.0 Allow negative distance and non-normalized azimuth.</para>
</refsection>
double x, y;
POINTARRAY *pa;
LWPOINT *lwp;
-
- /* Check the azimuth validity, convert to radians */
- if ( azimuth < -2.0 * M_PI || azimuth > 2.0 * M_PI )
- {
- lwerror("Azimuth must be between -2PI and 2PI");
- return NULL;
+
+ /* Normalize distance to be positive*/
+ if ( distance < 0.0 ) {
+ distance = -distance;
+ azimuth += M_PI;
}
+
+ /* Normalize azimuth */
+ azimuth -= 2.0 * M_PI * floor(azimuth / (2.0 * M_PI));
/* Check the distance validity */
- if ( distance < 0.0 || distance > (M_PI * spheroid->radius) )
+ if ( distance > (M_PI * spheroid->radius) )
{
- lwerror("Distance must be between 0 and %g", M_PI * spheroid->radius);
+ lwerror("Distance must not be greater than %g", M_PI * spheroid->radius);
return NULL;
}
-- #3704
SELECT '#3704', ST_AsX3D('LINESTRING EMPTY') = '';
+-- #3709
+select '#3709', ST_SnapToGrid(ST_Project('SRID=4326;POINT(1 1)'::geography, 100000, 20)::geometry, 0.0001) = ST_SnapToGrid(ST_Project('SRID=4326;POINT(1 1)'::geography, -100000, 20+pi())::geometry, 0.0001);
+
-- Clean up
DELETE FROM spatial_ref_sys;
#3627a|o}~~|AdshNoSsBgd@eGoBlm@wKhj@~@?
#3627b|t
#3704|t
+#3709|t