Opened 8 years ago

Closed 8 years ago

#2635 closed defect (invalid)

Geography Regress difference between 2.0.4 and 2.1.1 ST_Buffer (_ST_BestSRID has changed)

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 2.1.2
Component: postgis Version: 2.1.x
Keywords: Cc:

Description

Paul,

This may be nothing but thought I'd ticket it just in case. I'm guessing it may have to do with the segmentizing work you did in 2.1 so the 2.1 answer may be right. Feel free to dismiss as a non-issue.

SELECT ST_Area(geog), ST_AsText(geog) As wkt
FROM ST_Buffer(ST_GeogFromText('POLYGON((-8.1111111 60,-8.16875525879031 59.4147290339516,-8.33947250246614 58.8519497029047,-8.61670226309236 58.3332893009412,-8.98979075644036 57.8786796564404,-9.44440040094119 57.5055911630924,-9.96306080290473 57.2283614024661,-10.5258401339516 57.0576441587903,-11.1111111 57,-11.6963820660484 57.0576441587903,-12.2591613970953 57.2283614024661,-12.7778217990588 57.5055911630924,-13.2324314435596 57.8786796564404,-13.6055199369076 58.3332893009412,-13.8827496975339 58.8519497029047,-14.0534669412097 59.4147290339516,-14.1111111 60,-14.0534669412097 60.5852709660484,-13.8827496975339 61.1480502970953,-13.6055199369076 61.6667106990588,-13.2324314435597 62.1213203435596,-12.7778217990588 62.4944088369076,-12.2591613970953 62.7716385975339,-11.6963820660484 62.9423558412097,-11.1111111 63,-10.5258401339516 62.9423558412097,-9.96306080290474 62.7716385975339,-9.4444004009412 62.4944088369076,-8.98979075644036 62.1213203435596,-8.61670226309237 61.6667106990588,-8.33947250246614 61.1480502970953,-8.16875525879031 60.5852709660484,-8.1111111 60))'),0.5)  As geog;

In POSTGIS="2.1.2dev r12220" GEOS="3.4.2-CAPI-1.8.2 r0" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 32-bit

174586245121.787;
POLYGON((-8.11110222676862 60.0000001123177,-8.11110222756612 59.9999996529674,-8.16874654571452 59.4147286928243,-8.16874664506243 59.4147282009185,-8.33946403009328 58.8519488836975,-8.33946425740642 58.8519483409453,-8.61669413225065 58.333287959632,-8.61669454377614 58.3332873500412,-8.98978311640787 57.8786777311844,-8.9897838091721 57.8786770459371,-9.4443934919845 57.5055885804876,-9.44439462077365 57.5055878357803,-9.96305501709095 57.2283581014174,-9.96305678017842 57.2283573825071,-10.5258360648787 57.0576401583567,-10.5258372711419 57.0576398578416,-10.5258385543783 57.0576396729186,-11.1111094479643 56.9999955216097,-11.1111108915067 56.9999954494718,-11.11111234172 56.9999955228753,-11.6963832359368 57.0576396745597,-11.6963845762407 57.0576398684158,-11.6963858447501 57.05764018493,-12.2591651318438 57.228357409453,-12.2591670238365 57.2283581812281,-12.777827424573 57.5055879162765,-12.7778286347834 57.5055887143522,-13.2324383232393 57.8786771811134,-13.2324390547882 57.8786779042161,-13.6055276330769 58.3332875251025,-13.6055280588178 58.3332881552299,-13.8827579382924 58.8519485391979,-13.8827581685808 58.851949088513,-14.0534755565227 59.4147284088229,-14.0534756552979 59.4147288971683,-14.1111199742848 59.9999998606063,-14.1111199751599 60.0000003092618,-14.0534759820891 60.5852712810569,-14.0534758964603 60.5852717124745,-13.8827588127288 61.1480510572808,-13.8827586299052 61.1480514969214,-13.6055290113663 61.6667119197437,-13.6055286889924 61.6667123986508,-13.2324403072682 62.1213220695603,-13.232439744958 62.1213226256614,-12.777830169063 62.4944111485805,-12.7778291516122 62.494411817498,-12.2591687642903 62.7716416071738,-12.2591668861125 62.7716423669067,-11.6963875113353 62.9423596333884,-11.6963859831522 62.9423600049927,-11.6963843312279 62.9423602450222,-11.1111132779988 63.0000044128573,-11.1111112726256 63.0000045075187,-11.1111092599455 63.0000044113329,-10.5258382075 62.9423602435568,-10.5258364928066 62.9423599938316,-10.5258348994918 62.9423596056344,-9.96305552763739 62.7716423393292,-9.96305353718583 62.7716415338708,-9.4443931548388 62.4944117448422,-9.44439207393719 62.494411034233,-8.98978250399359 62.1213225126375,-8.98978190857326 62.1213219238521,-8.61669353266982 61.6667122549516,-8.61669319297732 61.6667117503886,-8.33946357928109 61.148051330162,-8.33946338787195 61.1480508699993,-8.16874630740451 60.5852715282209,-8.1687462185399 60.5852710808434,-8.11110222676862 60.0000001123177))

In POSTGIS="2.0.4" GEOS="3.4.2-CAPI-1.8.2 r0" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" (core procs from "2.0.4" need upgrade) RASTER (raster procs from "2.0.4" need upgrade) PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 32-bit

174585845315.925;POLYGON((-8.11110661378164 60.0000001098461,-8.11110661397496 59.9999998881884,-8.16875077276527 59.4147289201606,-8.1687508208231 59.4147286812904,-8.33946806449893 58.8519493443789,-8.33946817617189 58.8519490773287,-8.61669793679811 58.3332886659866,-8.61669814344717 58.3332883596781,-8.98978663679517 57.8786787030531,-8.98978699480701 57.8786783488813,-9.44439663930784 57.5055898419469,-9.44439724209829 57.5055894443578,-9.96305764406183 57.2283596706437,-9.96305861424042 57.2283592751908,-10.5258379452873 57.0576420216394,-10.5258386198499 57.0576418546683,-10.525839335611 57.0576417503919,-11.1111103016594 56.9999975878485,-11.1111111 56.9999975488188,-11.1111118983406 56.9999975878485,-11.696382864389 57.0576417503919,-11.6963835801501 57.0576418546683,-11.6963842547127 57.0576420216394,-12.2591635857596 57.2283592751908,-12.2591645559382 57.2283596706437,-12.7778249579017 57.5055894443578,-12.7778255606922 57.5055898419469,-13.232435205193 57.8786783488813,-13.2324355632048 57.8786787030531,-13.6055240565528 58.3332883596781,-13.6055242632018 58.3332886659866,-13.8827540238281 58.8519490773287,-13.8827541355011 58.8519493443789,-14.0534713791769 59.4147286812904,-14.0534714272347 59.4147289201606,-14.111115586025 59.9999998881884,-14.1111155862184 60.0000001098461,-14.0534714274281 60.5852710739391,-14.0534713844434 60.585271289349,-13.8827541407676 61.1480506147303,-13.8827540485882 61.148050835841,-13.6055242879619 61.6667112289035,-13.6055241254696 61.666711469928,-13.2324356321217 62.1213211030274,-13.2324353506388 62.1213213811136,-12.7778257061379 62.4944098616311,-12.7778252024295 62.4944101925362,-12.259164800466 62.7716399405138,-12.2591638816464 62.7716403119769,-11.6963845505995 62.9423575456898,-11.6963838136893 62.9423577259882,-11.696383016166 62.9423578409172,-11.1111120501176 63.0000019957568,-11.1111111 63.0000020419649,-11.1111101498824 63.0000019957568,-10.525839183834 62.9423578409172,-10.5258383863107 62.9423577259882,-10.5258376494005 62.9423575456898,-9.96305831835364 62.7716403119769,-9.96305739953408 62.7716399405138,-9.44439699757054 62.4944101925362,-9.44439649386208 62.4944098616311,-8.98978684936124 62.1213213811136,-8.98978656787831 62.1213211030274,-8.61669807453032 61.666711469928,-8.61669791203804 61.6667112289035,-8.33946815141182 61.148050835841,-8.33946805923243 61.1480506147303,-8.1687508155566 60.585271289349,-8.16875077257195 60.5852710739391,-8.11110661378164 60.0000001098461))

Change History (2)

comment:1 Changed 8 years ago by robe

Summary: Geography Regress difference between 2.0.4 and 2.1.1 ST_BufferGeography Regress difference between 2.0.4 and 2.1.1 ST_Buffer (_ST_BestSRID has changed)

hmm I think the underling problem with this might be your _ST_BestSRID math changed so might be very well expected. If I run this:

SELECT _ST_BestSRID(ST_GeogFromText('POLYGON((-8.1111111 60,-8.16875525879031 59.4147290339516,-8.33947250246614 58.8519497029047,-8.61670226309236 58.3332893009412,-8.98979075644036 57.8786796564404,-9.44440040094119 57.5055911630924,-9.96306080290473 57.2283614024661,-10.5258401339516 57.0576441587903,-11.1111111 57,-11.6963820660484 57.0576441587903,-12.2591613970953 57.2283614024661,-12.7778217990588 57.5055911630924,-13.2324314435596 57.8786796564404,-13.6055199369076 58.3332893009412,-13.8827496975339 58.8519497029047,-14.0534669412097 59.4147290339516,-14.1111111 60,-14.0534669412097 60.5852709660484,-13.8827496975339 61.1480502970953,-13.6055199369076 61.6667106990588,-13.2324314435597 62.1213203435596,-12.7778217990588 62.4944088369076,-12.2591613970953 62.7716385975339,-11.6963820660484 62.9423558412097,-11.1111111 63,-10.5258401339516 62.9423558412097,-9.96306080290474 62.7716385975339,-9.4444004009412 62.4944088369076,-8.98979075644036 62.1213203435596,-8.61670226309237 61.6667106990588,-8.33947250246614 61.1480502970953,-8.16875525879031 60.5852709660484,-8.1111111 60))') );

In

POSTGIS="2.0.4" GEOS="3.4.2-CAPI-1.8.2 r0" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" (core procs from "2.0.4" need upgrade) TOPOLOGY (topology procs from "2.0.4" need upgrade) RASTER (raster procs from "2.0.4" need upgrade)

I get:
999000

If I run the same query in

POSTGIS="2.1.2dev r12312" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER

I get:
999264

In fact 999264 is illegal in PostGIS 2.0.4

Now I'd be able to leave this alone and chuck it up to this polygon is just too big to suitably convert to planar projection.

since both 2.0.4 and 2.1.2dev agree that

SELECT ST_Area(ST_GeogFromText('POLYGON((-8.1111111 60,-8.16875525879031 59.4147290339516,-8.33947250246614 58.8519497029047,-8.61670226309236 58.3332893009412,-8.98979075644036 57.8786796564404,-9.44440040094119 57.5055911630924,-9.96306080290473 57.2283614024661,-10.5258401339516 57.0576441587903,-11.1111111 57,-11.6963820660484 57.0576441587903,-12.2591613970953 57.2283614024661,-12.7778217990588 57.5055911630924,-13.2324314435596 57.8786796564404,-13.6055199369076 58.3332893009412,-13.8827496975339 58.8519497029047,-14.0534669412097 59.4147290339516,-14.1111111 60,-14.0534669412097 60.5852709660484,-13.8827496975339 61.1480502970953,-13.6055199369076 61.6667106990588,-13.2324314435597 62.1213203435596,-12.7778217990588 62.4944088369076,-12.2591613970953 62.7716385975339,-11.6963820660484 62.9423558412097,-11.1111111 63,-10.5258401339516 62.9423558412097,-9.96306080290474 62.7716385975339,-9.4444004009412 62.4944088369076,-8.98979075644036 62.1213203435596,-8.61670226309237 61.6667106990588,-8.33947250246614 61.1480502970953,-8.16875525879031 60.5852709660484,-8.1111111 60))'));

is:

174585439562.186

Also the output of this in 2.1.2

SELECt ST_Transform(ST_Buffer(ST_Transform(ST_GeomFromText('POLYGON((-8.1111111 60,-8.16875525879031 59.4147290339516,-8.33947250246614 58.8519497029047,-8.61670226309236 58.3332893009412,-8.98979075644036 57.8786796564404,-9.44440040094119 57.5055911630924,-9.96306080290473 57.2283614024661,-10.5258401339516 57.0576441587903,-11.1111111 57,-11.6963820660484 57.0576441587903,-12.2591613970953 57.2283614024661,-12.7778217990588 57.5055911630924,-13.2324314435596 57.8786796564404,-13.6055199369076 58.3332893009412,-13.8827496975339 58.8519497029047,-14.0534669412097 59.4147290339516,-14.1111111 60,-14.0534669412097 60.5852709660484,-13.8827496975339 61.1480502970953,-13.6055199369076 61.6667106990588,-13.2324314435597 62.1213203435596,-12.7778217990588 62.4944088369076,-12.2591613970953 62.7716385975339,-11.6963820660484 62.9423558412097,-11.1111111 63,-10.5258401339516 62.9423558412097,-9.96306080290474 62.7716385975339,-9.4444004009412 62.4944088369076,-8.98979075644036 62.1213203435596,-8.61670226309237 61.6667106990588,-8.33947250246614 61.1480502970953,-8.16875525879031 60.5852709660484,-8.1111111 60))',4326),999264), 0.5), 4326)::geography;


feeding into both 2.0.4 and 2.1.2dev yields the same answer

SELECT ST_Area('0103000020E61000000100000047000000CDF71C64E23820C05033F10000004E4085D12364E23820C0CFC016FDFFFF4D404F507EF2655620C054326ED415B54D40A8B4D3F5655620C044D64DD015B54D4086D6B63ACEAD20C01DAC38A90C6D4D4069715742CEAD20C0E71EABA40C6D4D40A04D5355BF3B21C08C620B2EA92A4D40C5472263BF3B21C0774CEE28A92A4D40A43546DAC4FA21C091940B8378F04C404A0285F1C4FA21C0D4054C7D78F04C40DF41358B87E322C075366920B7C04C40767B15B187E322C043F7291AB7C04C40074F158C15ED23C0A6AE98D63A9D4C405F1D3EC715ED23C086D590D03A9D4C403E6C7B623A0D25C0038AB1C060874C402425F58A3A0D25C01B302CBE60874C40A90F04B63A0D25C09E119FBC60874C4000916A56E33826C0E2BA6EDAFF7F4C404380DA86E33826C0A6D0D3D9FF7F4C402EBD83B7E33826C0AE7271DAFF7F4C409EA9EF578C6427C0CA97A2BC60874C400FC9E8848C6427C056E542BE60874C40C63279AF8C6427C0D79AEAC060874C40BC10CB4AB18428C02AB3CAD03A9D4C40B728478AB18428C0051344D73A9D4C4015F26C653F8E29C08DD4D61AB7C04C40DF92088E3F8E29C044AF8821B7C04C40CF4CE92702772AC0CE4F6E7E78F04C40D241754002772AC0B5297F8478F04C4065C7C9B707362BC06F3D662AA92A4D409EDD12C607362BC0A26DAF2FA92A4D403A8036D9F8C32BC075DD54A60C6D4D40C6A9F0E0F8C32BC09882F0AA0C6D4D4019CDEC25611B2CC0E54E0CD215B54D40E7453D29611B2CC0A60525D615B54D40BCF89EB7E4382CC080A7D4FEFFFF4D40157DA6B7E4382CC07922980200004E405D633434611B2CC0B2B6592BEA4A4E409CD75431611B2CC00F2DF82EEA4A4E4035DA8DF6F8C32BC05F944856F3924E40B7686BF0F8C32BC056B3F859F3924E40023209E607362BC08793F1D056D54E40280638DB07362BC07B05F6D456D54E407AFA7B6A02772AC0B185487B870F4F4031C59D5702772AC07EBDF27F870F4F4084EF83C13F8E29C028F750DD483F4F407019609F3F8E29C07474EDE2483F4F40078BADC4B18428C0AE85F526C5624F40511EA885B18428C04109552DC5624F40400E65E78C6427C0A73C8F3D9F784F4031101EB48C6427C04240AD409F784F401824B07C8C6427C0E3B5B0429F784F40DD4FEED6E33826C0FC89042500804F409049A493E33826C09AD2CF2500804F40657F1B50E33826C0EF43012500804F40516660AA3A0D25C03E90AD429F784F40A34BD7703A0D25C05B4895409F784F405CD3603B3A0D25C0BCA2533D9F784F4086DE369D15ED23C061D0192DC5624F4043056D5A15ED23C0ED1A5826C5624F40A032E57F87E322C0826D51E2483F4F40DD52A05B87E322C0F7675BDC483F4F40639CB9C5C4FA21C0F105007F870F4F403BFDBEB1C4FA21C0CB9D0F7A870F4F4077F13441BF3B21C0046EC1D356D54E40C101CF35BF3B21C090E385CF56D54E400964962BCEAD20C06B969258F3924E40E2322A25CEAD20C04A65B654F3924E40113F7FEA655620C0917E6C2DEA4A4E40B6E783E7655620C029C2AB29EA4A4E40CDF71C64E23820C05033F10000004E40'::geography);

of

174586245121.787

pramsey before I close this out as expected change, can you confirm that this change in _ST_BestSRID is intentional?

comment:2 Changed 8 years ago by robe

Resolution: invalid
Status: newclosed

it uses some extra projections in the midspace between UTM and Mercator

Note: See TracTickets for help on using tickets.