[postgis-tickets] [PostGIS] #4641: ST_TileEnvelope default geometry precision
PostGIS
trac at osgeo.org
Fri Feb 14 06:19:48 PST 2020
#4641: ST_TileEnvelope default geometry precision
-------------------------+---------------------------
Reporter: Algunenano | Owner: pramsey
Type: enhancement | Status: new
Priority: medium | Milestone: PostGIS 3.1.0
Component: postgis | Version: master
Keywords: |
-------------------------+---------------------------
Today I was tinkering with ST_TileEnvelope and projections and notice that
things weren't exact.
For example, when transforming 0/0/0 to 4326 I'd expect x to go from -180
to 180; but it is just a tiny bit less:
{{{
SELECT ST_AsText( ST_Transform(ST_TileEnvelope(0, 0, 0), 4326));
st_astext
-----------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------
POLYGON((-179.999999999998 -85.0511287798064,-179.999999999998
85.0511287798064,179.999999999998 85.0511287798064,179.999999
999998 -85.0511287798064,-179.999999999998 -85.0511287798064))
}}}
I'm not sure if this is worth fixing, but changing to a more precise input
does return the expected 180:
{{{
SELECT ST_AsText(ST_Transform(ST_TileEnvelope(0, 0, 0,
ST_SetSRID(ST_MakeBox2D(
ST_Point(- 6378137.0 * pi(), - 6378137.0 * pi()),
ST_Point(6378137.0 * pi(), 6378137.0 * pi())),3857)), 4326)
);
st_astext
---------------------------------------------------------------------------------------------------------------------------
POLYGON((-180 -85.0511287798066,-180 85.0511287798066,180
85.0511287798066,180 -85.0511287798066,-180 -85.0511287798066))
}}}
Any thoughts?
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4641>
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