Opened 6 years ago
Closed 5 years ago
#4389 closed defect (duplicate)
ST_SimplifyPreserveTopology doesn't always preserve topology with inner holes
Reported by: | pnorman | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.5.3 |
Component: | postgis | Version: | 2.5.x -- EOL |
Keywords: | Cc: |
Description
I have a geometry that has an inner hole. After applying ST_SimplifyPreserveTopology the hole lies outside the shell, rendering the polygon invalid.
The image in grey is the section of the polygon before simplification, the red overlay is after ST_SimplifyPreserveTopology(geom,40)
has been applied.
The WKB is below
`
0103000020110F00000D000000CA000000D463DB6912BD65C1F869F58CAD565341DC1DB4EF17BD65C1B714D598B85653414875AE0C19BD65C112DCC79ABD56534149918BA71EBD65C1B94446E2C55653416CEA35BF25BD65C1B23D1C15D15653411EB141D627BD65C174312E02D656534127E3762A2CBD65C104CE40EFDA5653418E9F9C0431BD65C1826CE5DFDC5653414E031A8337BD65C14863BA5EE85653416B792BB93FBD65C161526EC2F4565341755FEB4242BD65C111311C67F656534126FA0F5647BD65C112A74E1B00575341E1E2095E4BBD65C17FAE39C805575341486301D150BD65C17B2D6B420A57534157F02BD552BD65C1B25A6CA20F5753415CA7DDB254BD65C15423529B155753416A38B9E255BD65C15F57FD671C575341BC38A60C58BD65C179E56D10255753411261C90E58BD65C104146F1A2B575341B5C6912555BD65C13F7D81C11F575341573CA19F54BD65C12D4D31E01B575341F9290DE852BD65C1B4AE460D16575341A1BEE3AA50BD65C1EC379DBC0E575341E55D8DD44DBD65C130B052B50A5753418D6AC0654ABD65C1114BC0770857534125363EBD46BD65C1B558836F04575341DFD6732648BD65C196A4DF1A12575341387ECBCA49BD65C10BB3A9AC1857534195CC8DE94ABD65C17810869D24575341EF3306FB4DBD65C1F2983DAC3157534156E4959D4FBD65C1982A3DD436575341A575958852BD65C1FF7FBA083A5753410803ADB656BD65C1DE5A78AC3B5753416F83A4295CBD65C13E4965A5415753412B3070CA60BD65C1FDECF9B4495753412EABF34063BD65C145B1B2DF50575341E4A00D0466BD65C156F6E12C5B575341472E25326ABD65C1A81D147A65575341B98495CB6FBD65C11E1C3BE675575341B3A1FCE970BD65C192885318815753411100066C74BD65C161BB4B1187575341C27A9CB874BD65C11EC0E63F9557534174F5320575BD65C122A322D99F575341777467A776BD65C1FEAB2FFAAA57534132998F167ABD65C1AD314853B65753418B88AB597EBD65C1D053C23EC05753419ED0386781BD65C10F13D685CB575341E922E34281BD65C1AA59C0C1D25753414C28573F84BD65C1B2DF45DDDB575341560E17C986BD65C13149FFC6E3575341B78F98BF87BD65C11E13FF87E9575341BD16B26D8DBD65C16CBEC23AF8575341205854D18FBD65C16274AABAFE5753417D2EBA2192BD65C1F50D7FFB0C5853412F31F49F93BD65C11EDC1F161658534133AC771696BD65C11242756A1A5853419FD3D9039BBD65C10458866320585341EDA4B8819CBD65C14AF4DCB7245853415AF236D79CBD65C18F46D3D82A585341F83E03419DBD65C1439DC97332585341F642B46C9CBD65C12AA7D1EC3E585341B1A30A439FBD65C13EF92EAD495853410C47B1BBA1BD65C18C8AE0B94C58534169E1E8A4A4BD65C1B6B49862555853416DA8E1E5A8BD65C161C169725D585341CA4219CFABBD65C1E9D3FFDA66585341E4B5035DB0BD65C193CAC161765853414607ED23B5BD65C1F07F99C185585341FB0C4E4ABABD65C1F7AF631E8E5853410A9A784EBCBD65C1F1A2EE8C91585341701E21EDC0BD65C1D17854EB94585341CAC1C765C3BD65C1C72E225F975853417C88D37CC5BD65C1EEF798CA935853418AE9167DCABD65C1CA34DDD991585341EC3A0044CFBD65C1E580684895585341ADCA64C6D2BD65C18DDECC9C9958534163C07E89D5BD65C14B26D6A0A0585341B638C881D6BD65C1222A268EA5585341BC67D62DD7BD65C1780D0C5CA7585341BC67D62DD7BD65C111815441B45853410BDDF87DD4BD65C186A78733B158534100078057D4BD65C1403E6114AB58534104B29BFDD2BD65C1ABDC508CA3585341F12DE088D0BD65C1613836A59D5853419A764181CCBD65C16F7275009C585341DEC975E0C7BD65C1E8A39C1A9B585341241DAA3FC3BD65C1B3215BE59C585341C15364AABFBD65C1FD812F179E58534119FBBB4EC1BD65C12877699DA35853412D3F9830C5BD65C1B1418A08AA5853418B9DA1B2C8BD65C1B26158B1B2585341401B5FA7CCBD65C183518484B85853415DC1080DD1BD65C1431C23D6BA58534158EA0563D5BD65C17318514EBA585341BC67D62DD7BD65C1E697888DBB585341BC67D62DD7BD65C1B79F6665C15853415CD14F70D3BD65C18845A36BBE585341464A6D53CDBD65C15A9BE824BD5853418B61734BC9BD65C1A1D26C43B9585341D4A787EFC5BD65C113895A8BB258534119BF8DE7C1BD65C159FD9AC0B05853411A73181DC0BD65C1EE71A6FDA85853410A9A784EBCBD65C1F1B09291A2585341B2C639A6BDBD65C1E6D6767BAA5853417BB86BACC1BD65C17240C10FB6585341D16832E0C2BD65C1DECBFBB1BC585341CF001D75C6BD65C1DB3ABBCDC5585341E3BC5525C9BD65C19BD98D9CCE58534141DF3040CDBD65C13D13CD48D4585341ADCA64C6D2BD65C1B057FA67DA585341BC67D62DD7BD65C1FDB6B41EDE585341BC67D62DD7BD65C15358DCC4E7585341AC5208F8D3BD65C1F20B54F2E658534168B35ECED6BD65C1698EAB05EC585341BC67D62DD7BD65C1E491AA98EC585341BC67D62DD7BD65C1C079BF8603595341B145E83CD5BD65C15AE03AFBFE585341ACDAAB29D5BD65C1DA430B90F8585341FB13A012D3BD65C1B9F6FF64F15853414EF8AFA1CFBD65C1344055BFED585341368114E8CBBD65C1C4B2A2DAE4585341DC095573C6BD65C181D9C661DB585341CBFDF5CCC2BD65C1C6DE22BFD15853411348BB9CBEBD65C195B3322BC95853415F027BE3BABD65C1AA62E470BD585341A9D032B9B8BD65C139F36E1DB9585341958C56D7B4BD65C19E05187CB458534190C55D96B0BD65C17B055061AB5853412E384668ACBD65C10B2E1E649E585341CBF6A304AABD65C1D769941694585341100EAAFCA5BD65C18CEAE5AE8A58534111FE6299A3BD65C151B7B6B684585341EDA4B8819CBD65C1BBB165EB7858534196ED197A98BD65C1BB6BE69D6E5853411E4CBE998CBD65C1323BAE1F54585341F883264386BD65C12FC9B855405853419A614B2882BD65C1A8D5392F365853412E7617A27CBD65C1D0C909AC235853412408B4E678BD65C1731205D516585341691FBADE74BD65C13C4F469F0E5853410756744971BD65C1FE456E2807585341519C88ED6DBD65C1E98A51560158534150447DEB68BD65C14EC770CDF95753418706D61A63BD65C1C7CE587FF4575341263D90855FBD65C18ED7CDCEF157534126F11ABB5DBD65C116C6D0A8F1575341C856E3D15ABD65C1572439F9EE5753417FEF332F58BD65C117309D17EF575341781159B159BD65C1537B865EEC575341C8A2589C5CBD65C1B9CA5160EE575341792D364C5FBD65C10933361FEF57534183D7C76E62BD65C19992D936F1575341E993ED4867BD65C1BBF81E23F6575341EF4A9F2669BD65C1D5414018F5575341038F7B086DBD65C1563EDBA1F757534160ED848A70BD65C15D7F455DFB57534120C95ED775BD65C1FB60896906585341814AE0CD76BD65C149C28B500C585341D1170E2079BD65C1C226FB8F10585341249057187ABD65C197C573930D58534125CC857F79BD65C1A9C93D5A08585341C76D7CFD75BD65C18BEAE0E6FD575341161FCDB472BD65C1BDC0F308F757534102DBF0D26EBD65C10933361FEF575341F3C5229D6BBD65C17AE3AEDDE55753419667191B68BD65C17CD55E44DB5753419597B14A64BD65C16EC52D87D5575341DC32AA4862BD65C14E7C89FACD57534183D7C76E62BD65C16579ABD0C65753417D5C44F85FBD65C1F40428DBBD575341DA9E70DF5DBD65C1D075B5AAAD5753416E4776C25CBD65C1DD55981AA9575341781159B159BD65C1463E07EE9F57534165D9120759BD65C1237D5AAE98575341AF1F27AB55BD65C15B481EE893575341B3BAFBED51BD65C13D3578548B5753419C17793051BD65C1D425503E81575341513D2B2350BD65C1C94F79DC79575341398A61024DBD65C14D1724D2705753414218168A4ABD65C16141421064575341E47DDEA047BD65C10454D548555753418288B10747BD65C1F9E97BBB4B57534135FF962848BD65C10C723B11485753412F1CFE4649BD65C1A20632B142575341D281C65D46BD65C1433F90393B575341C330CAC043BD65C1645771A030575341242AA88543BD65C1F8BEBAA32A5753417A169D2044BD65C1960C824725575341B9C2660540BD65C1D1E0C41D1E575341A53215593ABD65C15423529B15575341AB9D516C3ABD65C16CC0139311575341F07829FD36BD65C17FAE39C805575341DCE8D75031BD65C1B9233354FB565341843139492DBD65C115DAE298F756534117CEA8F428BD65C134E7057AF15653410831378D24BD65C14863BA5EE8565341B13D6A1E21BD65C137182EFBE55653419DF98D3C1DBD65C1164AC49EDD565341F1D9EC9F1ABD65C1283A9284DE565341E3004DD116BD65C14360E105DD565341D463DB6912BD65C154103C83D8565341D463DB6912BD65C1F869F58CAD5653410900000073C056668EBD65C1FE7EDE0032585341BD16B26D8DBD65C1A798B57A2C5853415F041EB68BBD65C199397B4127585341A9C28E2887BD65C1986A596F2158534164174FC786BD65C1EBCFAC3F2558534160F4D65289BD65C1E49BE7222B5853411EC41A688BBD65C165A9DD563158534115FA37798EBD65C1FE0025A23658534173C056668EBD65C1FE7EDE0032585341050000006FCD76218DBD65C1B3D91E39235853416F09A5888CBD65C11BF0A0A41F58534165E7B6978ABD65C1AF8DB07D1F585341C0FDFB7A8BBD65C1EFC02343225853416FCD76218DBD65C1B3D91E3923585341080000006523E5FE89BD65C1997E43C50E585341A976195E85BD65C13FA8E72B045853414CDCE17482BD65C1DF72A41FF95753419C15D65D80BD65C1884D7905FA5753419C15D65D80BD65C124241BD402585341F3CC746584BD65C197C573930D5853415A4D6CD889BD65C1A7A09DCD125853416523E5FE89BD65C1997E43C50E585341060000000789AD1587BD65C181733D31155853414C28573F84BD65C17EE018AB0F58534196F60E1582BD65C10D1564BA0D585341A5BF678083BD65C15AD49AF312585341F8FB821185BD65C1AF455872145853410789AD1587BD65C181733D31155853410500000025BC3E1C77BD65C1F2F02F50DC5753411100066C74BD65C1AFF442BED5575341D083D4B674BD65C16BAE1465DC575341CDD8B81076BD65C1171AD9B2DE57534125BC3E1C77BD65C1F2F02F50DC5753411500000025F86C8376BD65C16A7EE0ABE4575341161FCDB472BD65C1D9CF5B6ADB575341BD77751071BD65C19A5CAD0ED3575341BA48676470BD65C1E1C6108CCA5753410163940470BD65C173313D87C3575341B555871F6FBD65C171EC5AA9BC575341FD5F6D5C6CBD65C15BECA9BFB457534148E2AF6768BD65C1481EE448AD5753417DA8B9C261BD65C1283C876EA3575341D6039C9C61BD65C130C99ECEA8575341DB7E1F1364BD65C12FFA49D7B6575341E1258A8D63BD65C1D053C23EC05753418C81599165BD65C10C830AB9C45753414277735468BD65C16579ABD0C6575341A3F8F44A69BD65C119A7A3B7CC575341472E25326ABD65C1A21C8B19D45753415B7201146EBD65C1A9DA4203DC5753410DFDDEC370BD65C136AB653DE15753416F8AF6F174BD65C14471236CEF575341C7A9AA6475BD65C1B7199676E657534125F86C8376BD65C16A7EE0ABE45753410A00000079E8124A76BD65C1A21C8B19D45753417970B67B77BD65C1BCDA1347C4575341113C34D373BD65C16D27F50CBF575341165BFB1B72BD65C1A3ABE060B9575341B3A1FCE970BD65C1BD640D7BB8575341C1AA34E870BD65C1AB7A9581BA5753416D0604EC72BD65C1416DF581C4575341C625B85E73BD65C1646C779DCD575341BD0F60A574BD65C1B24494A7D357534179E8124A76BD65C1A21C8B19D457534109000000652CDA9973BD65C17AB65B7507585341BEFF184272BD65C14D3339EF01585341B491B5866EBD65C15E18FF01FD575341518C418A6BBD65C1F940AAD3F8575341F9E4E9E569BD65C1C26DD5EDF757534157BB4F366CBD65C16E841769FC575341B74C18906FBD65C140D84BF800585341B465CE8271BD65C124241BD402585341652CDA9973BD65C17AB65B75075853410F00000011681BD770BD65C16E2F3385A55753415BBE76DE6FBD65C1200EF2E4A057534161A10FC06EBD65C16412616298575341A4C85C1B6DBD65C1AD8883AA91575341A57CE7506BBD65C1CBA5933F8B57534157BB4F366CBD65C1CDC3C86084575341F9E4E9E569BD65C13532DBF57D57534148E2AF6768BD65C124DE23777C575341F79C254767BD65C1520EB429845753415080AB5268BD65C1D076291F8D575341F6AC6CAA69BD65C11E70E5BB945753414CE5D60F6CBD65C148E625B39F57534164D4CE976EBD65C19335010DA65753410D390D2B70BD65C1B59AD576A757534111681BD770BD65C16E2F3385A557534108000000EB0B4A1766BD65C1887B023E77575341BE353F1365BD65C1B23AD318725753410A88E9EE64BD65C19AAB905B6E575341635B289763BD65C1D65B04996B575341EE2EC28B63BD65C15A0B0CC1705753419597B14A64BD65C1278538757557534191EC95A465BD65C1BAECAB5479575341EB0B4A1766BD65C1887B023E7757534113000000E0E95B2664BD65C1E40CC6249657534134DA01ED63BD65C1DC0B76FE8B5753418DAD409562BD65C141C34C64815753412AB813FC61BD65C1EEDB4E997557534183C7800B60BD65C16287C34467575341C7EECD665EBD65C179CF53755E575341117110725ABD65C172F48771575753415700733855BD65C17D061CA24E5753414D920F7D51BD65C1BEF34BEA475753419660C7524FBD65C19FED687F41575341EB04F84E4DBD65C19A1820AA48575341F8D101E64DBD65C16B0A04914E575341A920B12E51BD65C15282961F62575341A6EDF15651BD65C1BC74368D6A575341FDE0BEC554BD65C105FC8A1B745753416461B6385ABD65C185E5E97B83575341D28818265FBD65C177DA86849157534133525EBB62BD65C1587D980A97575341E0E95B2664BD65C1E40CC624965753410B00000070FB00F85ABD65C1249F2328545753413F3216AF58BD65C1B535E54F4F575341449D52C258BD65C135F33F264D57534198C926F057BD65C14989DCDC495753410BAEC85C55BD65C185866C9446575341FE581B9453BD65C11BEEDD8E445753413600E15A54BD65C1EB363B8D475753410EAA173156BD65C1A6C9A96C4B5753413C3B853E58BD65C156EDEA9A4F57534140F2361C5ABD65C1B95A42695357534170FB00F85ABD65C1249F232854575341
`
Change History (2)
comment:1 by , 6 years ago
comment:2 by , 5 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Closing this ticket in favour of a ticket in GEOS https://trac.osgeo.org/geos/ticket/967
This is a known bug in the original JTS implementation (see Javadoc ).
As mentioned there, the workaround is to simply remove holes which lie outside the polygon shell. But of course this needs to be implemented in GEOS (and JTS too ideally). There should be a GEOS ticket created for this.