New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error while merging two polygons, core.js:1448 ERROR TypeError: Ht.toLineString is not a function at Wi.getErrorMessage (jsts.min.js:18) #337
Comments
Can you provide the input polygons? Also, is this the latest released JSTS? |
First One is this
Second one is this: [[73.8895797729492,18.55267476429471],[73.89142513275146,18.559204597935615],[73.89475107192993,18.55806545491602],[73.89726161956791,18.557841693786543],[73.8974118232727,18.55985553338995],[73.89857053756714,18.562154129347366],[73.89438629150395,18.56496122223341],[73.89434337615967,18.565164632966656],[73.89526605606079,18.565978273474297],[73.89685392379761,18.567910654126205],[73.89724016189577,18.568439512383797],[73.89805555343628,18.56988369388786],[73.89859427029205,18.570942523900626],[73.89988964152748,18.572703451753714],[73.89983654022217,18.573382223734214],[73.89926736903605,18.575406613469173],[73.8956952095032,18.57476534364279],[73.89580249786377,18.57551791887966],[73.8958668708801,18.57596539447271],[73.89616816116684,18.58000234372618],[73.89637055741169,18.583125922433712],[73.89696121215819,18.582962132788726],[73.8975620269775,18.583124844215888],[73.8982057571411,18.583694332987502],[73.89848470687866,18.58511804659019],[73.8988494873047,18.585809560333757],[73.90026569366455,18.58768070109809],[73.90026569366455,18.588778969802078],[73.90172481536865,18.58865694029573],[73.90232563018796,18.58947046868708],[73.90277624130249,18.58950251954725],[73.9029049873352,18.590019598155024],[73.90412807464601,18.590039936249468],[73.90571594238281,18.590243317060406],[73.90743255615234,18.590772106032418],[73.90932083129881,18.591585624322512],[73.90949249267578,18.590609401908164],[73.91168117523188,18.59060940190818],[73.9114236831665,18.587395963611716],[73.91258239746094,18.5871519025304],[73.91408443450925,18.58947046868708],[73.91623020172122,18.591138189743788],[73.91841888427734,18.592521165552828],[73.9207768496047,18.59302632616458],[73.92122983932495,18.592968596498675],[73.92131567001343,18.592724543401186],[73.9218091964722,18.59311096074605],[73.92238519281665,18.593472726721874],[73.92309221024666,18.593758581272844],[73.92459869384766,18.595775181983655],[73.92502784729004,18.596120917575437],[73.92595052719116,18.5951650586388],[73.92713069915771,18.594310882283725],[73.92781734466553,18.59441257016971],[73.92874002456665,18.594737970996796],[73.92968416213989,18.595470120584473],[73.93045663833618,18.595815856795596],[73.93152952194214,18.59593788117311],[73.93320322036743,18.595470120584473],[73.93629312515257,18.594697295927407],[73.93983364105225,18.593700753692875],[73.94365310668945,18.592724543401186],[73.9458417892456,18.59215508481379],[73.94575595855713,18.59138224511424],[73.94479036331177,18.591727989623813],[73.9445114135742,18.589307763319596],[73.94354581832886,18.589307763319596],[73.94365310668945,18.588616263774174],[73.94341707229614,18.58796543810859],[73.94363164901733,18.584751949942728],[73.94386768341064,18.58391806019851],[73.94399642944336,18.581701113960964],[73.94380331039429,18.580175675489684],[73.9433741569519,18.579687532295456],[73.94294500350952,18.579321423982368],[73.94161462783813,18.579341763353725],[73.94150733947754,18.577918001497725],[73.94142150878906,18.576412868891282],[73.9435029029846,18.57588403536134],[73.94343852996826,18.57431786490014],[73.9378809928894,18.573666984632577],[73.93745183944702,18.575761996621463],[73.93461942672728,18.575802676211122],[73.9347696304321,18.575395879877757],[73.93616437911987,18.573361883651852],[73.93500566482541,18.57289406108779],[73.93421173095702,18.572283855814465],[73.93380403518675,18.57258895872411],[73.93350362777709,18.573321203479843],[73.9323878288269,18.574724663805608],[73.93150806426998,18.574745003725432],[73.93107891082762,18.57415514506616],[73.93099308013916,18.573178822801378],[73.93060684204104,18.57283304065872],[73.93155097961426,18.571978752358987],[73.93116474151608,18.571510926000332],[73.93019914627077,18.572446577434185],[73.92876148223874,18.571165140475575],[73.92822504043579,18.571409224448182],[73.92740964889525,18.56984301288611],[73.92743110656738,18.569395521226504],[73.92747402191162,18.568358149681686],[73.93026351928711,18.568256446249443],[73.93041372299194,18.568012357764648],[73.93079996109009,18.568032698485055],[73.93097162246704,18.568256446249443],[73.9313793182373,18.568236105555727],[73.93161535263062,18.568053039203036],[73.93285989761353,18.568236105555727],[73.93427610397339,18.568622578321694],[73.93438339233398,18.568358149681686],[73.93459796905516,18.56339495146362],[73.93230199813839,18.563232221208416],[73.93144369125368,18.563049149485764],[73.9279246330261,18.56278471220626],[73.92818548589426,18.55738990620533],[73.92718582196245,18.557328234163258],[73.92698049545288,18.557536564500843],[73.92630656252796,18.55765461636562],[73.92555255519872,18.55768325238508],[73.92540892821923,18.557863474631908],[73.92448678880632,18.5578885356325],[73.92445531884314,18.557668708402076],[73.92354555938617,18.557959398782035],[73.92265556838491,18.558351594697754],[73.9220469440038,18.557792645090863],[73.9213613620273,18.557763083999685],[73.92120838165283,18.556499120848954],[73.9208436012268,18.55548201310778],[73.92080068588255,18.554932772407458],[73.92069339752194,18.55472934947734],[73.9193630218506,18.554770034082768],[73.91833305358885,18.555217564102307],[73.91852617263793,18.556722883738622],[73.91891241073608,18.55826887387004],[73.91882658004761,18.559875875082895],[73.91856908798218,18.561015006017442],[73.91408443450926,18.559469040763407],[73.91133785247797,18.558533318147784],[73.91047954559326,18.558187506317534],[73.90872001647949,18.557211092661458],[73.90745401382446,18.556316041902846],[73.90663862228394,18.555543039743167],[73.9051151275635,18.554790376381828],[73.90420935522889,18.55453876892446],[73.90086650848386,18.553610519028553],[73.89646768569949,18.552267912810592],[73.89475107192992,18.551149066229875],[73.89354489218572,18.549925311749753],[73.89254093170166,18.54870792096767],[73.89082431793214,18.547019441743775],[73.88957977294919,18.545981934180883],[73.88875419544755,18.54583840314899],[73.8895797729492,18.55267476429471]] |
I am using this link to include library: |
That's quite old - can you try https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.6.0/jsts.min.js instead? |
After updating the version, I got this error: core.js:1448 ERROR Jn {pt: E, name: "TopologyException", message: "found non-noded intersection between LINESTRING ( …8.51064188615364, 73.86835813522339, undefined) ]", stack: "Error↵ at Jn.m (https://cdn.rawgit.com/bjornhar…arrtell/jsts/gh-pages/1.6.0/jsts.min.js:8:359668)"} |
Ok that means your polygons have some very close vertices and/or edges creating numerical robustness issues at the reported location and will have to be preprocessed to be able to union. From the FAQ: In some cases you might get a TopologyException thrown as an Error. This is expected if a calculation fails due to precision issues. To resolve this issue try reducing precision in the input and at the same time make sure the input is valid as defined by the OGC Simple Features specification. To reduce precision GeometryPrecisionReducer can be used. |
I am using this in Angular 5 project, How can i use GeometryPrecisionReducer in it ??? |
? |
I don't know, I have never used Angular 5. |
Thanks a lot, I resolved the issue by removing the coordinates that were coming in the error. |
core.js:1448 ERROR TypeError: Ht.toLineString is not a function
at Wi.getErrorMessage (jsts.min.js:18)
at Wi.checkValid (jsts.min.js:18)
at ji.checkValid (jsts.min.js:18)
at Function.ji.checkValid (jsts.min.js:18)
at Ji.computeOverlay (jsts.min.js:18)
at Ji.getResultGeometry (jsts.min.js:18)
at Function.Ji.overlayOp (jsts.min.js:18)
at Sr.getResultGeometry (jsts.min.js:19)
at Function.Sr.overlayOp (jsts.min.js:19)
at bt.union (jsts.min.js:9)
The text was updated successfully, but these errors were encountered: