Commit 8b932894 authored by Paul Ramsey's avatar Paul Ramsey

move center point of regression tests a little off-center to hopefully avoid...

move center point of regression tests a little off-center to hopefully avoid platform specific disagreements about which edge is "nearest"
parent ecae381d
Pipeline #144195796 failed with stage
in 5 minutes and 55 seconds
SELECT 'mic-box' AS name, st_astext(center) AS center,
st_astext(nearest) AS nearest,
SELECT 'mic-box' AS name,
st_astext(st_snaptogrid(center, 0.0001)) AS center,
st_astext(st_snaptogrid(nearest, 0.0001)) AS nearest,
round(radius::numeric,4) AS radius
FROM ST_MaximumInscribedCircle('Polygon((0 0, 100 0, 100 100, 0 100, 0 0))'::geometry);
FROM ST_MaximumInscribedCircle('Polygon((0 0, 100 0, 99 98, 0 100, 0 0))'::geometry);
SELECT 'mic-empty' AS name, st_astext(center) AS center,
st_astext(nearest) AS nearest,
SELECT 'mic-empty' AS name,
st_astext(st_snaptogrid(center, 0.0001)) AS center,
st_astext(st_snaptogrid(nearest, 0.0001)) AS nearest,
round(radius::numeric,4) AS radius
FROM ST_MaximumInscribedCircle('Polygon Empty'::geometry);
SELECT 'mic-null' AS name, center, nearest, radius
FROM ST_MaximumInscribedCircle(NULL);
SELECT 'mic-line' AS name, st_astext(center) AS center,
st_astext(nearest) AS nearest,
SELECT 'mic-line' AS name,
st_astext(st_snaptogrid(center, 0.0001)) AS center,
st_astext(st_snaptogrid(nearest, 0.0001)) AS nearest,
round(radius::numeric,4) AS radius
FROM ST_MaximumInscribedCircle('LINESTRING(0 0, 100 0, 100 100, 0 100, 0 0)'::geometry);
FROM ST_MaximumInscribedCircle('LINESTRING(0 0, 100 0, 99 98, 0 100, 0 0)'::geometry);
SELECT 'mic-mpoint' AS name, st_astext(center) AS center,
st_astext(nearest) AS nearest,
SELECT 'mic-mpoint' AS name,
st_astext(st_snaptogrid(center, 0.0001)) AS center,
st_astext(st_snaptogrid(nearest, 0.0001)) AS nearest,
round(radius::numeric,4) AS radius
FROM ST_MaximumInscribedCircle('MULTIPOINT(0 0, 100 0, 100 100, 0 100, 0 0)'::geometry);
FROM ST_MaximumInscribedCircle('MULTIPOINT(0 0, 100 0, 99 98, 0 100, 0 0)'::geometry);
SELECT 'mic-point' AS name, st_astext(center) AS center,
st_astext(nearest) AS nearest,
SELECT 'mic-point' AS name,
st_astext(st_snaptogrid(center, 0.0001)) AS center,
st_astext(st_snaptogrid(nearest, 0.0001)) AS nearest,
round(radius::numeric,4) AS radius
FROM ST_MaximumInscribedCircle('POINT(0 0)'::geometry);
WITH p AS (
SELECT 'Polygon((0 0, 100 0, 100 100, 0 100, 0 0))'::geometry AS ply
SELECT 'Polygon((0 0, 100 0, 99 98, 0 100, 0 0))'::geometry AS ply
)
SELECT 'mic-cte' AS name, ST_AsText((ST_MaximumInscribedCircle(ply)).center)
SELECT 'mic-cte' AS name, ST_AsText(st_snaptogrid((ST_MaximumInscribedCircle(ply)).center,0.001))
FROM p;
mic-box|POINT(50 50)|POINT(50 0)|50.0000
mic-box|POINT(49.5117 49.5117)|POINT(50.5111 98.9796)|49.4779
mic-empty|POINT EMPTY|POINT EMPTY|0.0000
mic-null|||
mic-line|POINT(50 50)|POINT(50 0)|50.0000
mic-mpoint|POINT(50 50)|POINT(0 0)|70.7107
mic-line|POINT(49.5117 49.5117)|POINT(50.5111 98.9796)|49.4779
mic-mpoint|POINT(48.584 49.9512)|POINT(99 98)|69.6453
mic-point|POINT(0 0)|POINT(0 0)|0.0000
mic-cte|POINT(50 50)
mic-cte|POINT(49.512 49.512)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment