You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the angle argument in ST_MAKEELLIPSE might be positive clockwise, relative y-axis north. I decomposed a "4" point ellipse
(really 5 points) in the example below to check how points were constructed by turf.
Example: when degree is 0, point 1 indexed from 0 is oriented north (aka y-axis relative north, or x-axis relative east). And when degree is 90, point 1 indexed from 0 is oriented east. Not quite sure how to "define" this in the doc's though...
But let me know if I misunderstand the behavior
To Reproduce
WITH
DATA AS (
SELECT'5 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, 5, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'45 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, 45, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'90 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, 90, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'135 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, 135, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'180 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, 180, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'-135 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, -135, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'-90 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, -90, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'-45 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, -45, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
UNION ALLSELECT'-5 DEG'AS TYPE, TO_ARRAY(ST_ASGEOJSON(CARTO.CARTO.ST_MAKEELLIPSE(ST_POINT(-70,40), 2, 10, -5, 'kilometers', 4)):coordinates[0]) AS POINT_ARR
)
SELECTD.TYPE, (F.INDEX)::VARCHARAS POINT_INDEX, TO_GEOGRAPHY(OBJECT_CONSTRUCT('type', 'Point', 'coordinates', F.VALUE)) AS GEOG
FROM DATA D,
LATERAL FLATTEN(INPUT=>D.POINT_ARR) F
Screenshots
The text was updated successfully, but these errors were encountered:
Hi @scoddou,
Indeed I would say angle is positive clockwise relative to the y-axis north. So I think with the change done in: #477
Users should be able to understand as it also matches turf docs.
Describe the bug
@vdelacruzb in relation to pull #477
I think the
angle
argument in ST_MAKEELLIPSE might be positive clockwise, relative y-axis north. I decomposed a "4" point ellipse(really 5 points) in the example below to check how points were constructed by
turf
.Example: when degree is 0, point 1 indexed from 0 is oriented north (aka y-axis relative north, or x-axis relative east). And when degree is 90, point 1 indexed from 0 is oriented east. Not quite sure how to "define" this in the doc's though...
But let me know if I misunderstand the behavior
To Reproduce
Screenshots
The text was updated successfully, but these errors were encountered: