ThinkGeo.com    |     Documentation    |     Premium Support

Finding the percentage of coverage that a layer covers a polygon

I have a user drawn polygon on the map that is being held in an InMemoryFeatureLayer. I also have a layer loaded containing various polygonshapes. What I’m trying to do is determine how much of the layer’s polygons are overlapping with the user drawn polygon and get a %.

There’s the long way of doing this by counting pixels and such, but I was hoping there was a tool in MapSuite that will help with this.

I know you can get the area of a shape, but is there a way to get the area of all the shapes within a layer? That might help with this.

Let me try to show an example:

The black hexagon is a user drawn polygon.
The red shapes are from a single layer (shapefilelayer or personalgeodatabase).
I want to find what percent the red shapes WITHIN the black user drawn polygon cover the user drawn polygon. So half of the red polygon on the left side would not be counted in the calculation since it isn’t in the black hexagon.
In this case the result might be around 50% or so just looking at it.

Hi Dan,

Please write a function for that, in the logic you can loop your red polygons.

  1. If the polygon is out of black one, just ignore it.

  2. If it’s contained by black one, just save it’s area value.

  3. If they are intersect, use the API for example Different to get the redundant area, just minus it. For example:

Wish that’s helpful.

Regards,

Ethan

So upon doing the .GetDifference() function, I receive the following error:

NetTopologySuite.Geometries.TopologyException: ‘found non-noded intersection between LINESTRING(-7876991.7922414318 5325298.295923247, -7876990.8093172209 5325297.7621183572) and LINESTRING(-7876990.7206208259 5325298.48704141, -7877103.4217566978 5325130.8619913682) [ (-7876991.1013756851, 5325297.9207289955, NaN) ]’

It’s doing it for all polygons in the layer I try the .GetDifference() on.

Here’s the polygon that I want to see the coverage of: {POLYGON((-7877448.29829595 5324740.51763905,-7876028.63364608 5326029.2912219,-7877105.967813 5326250.79918145,-7878193.37052354 5325344.63025601,-7877448.29829595 5324740.51763905))}

Here’s the polygonshape
{POLYGON((-7877731.13322687 5326435.24404656,-7877728.12455957 5326432.80810549,-7877715.06571897 5326421.71426822,-7877707.29751201 5326414.1799989,-7877700.46418759 5326406.88622082,-7877694.97808909 5326400.63313546,-7877690.07148653 5326395.08303144,-7877685.13452432 5326389.58100731,-7877679.08698649 5326382.65584006,-7877671.58723328 5326373.8024913,-7877663.29744665 5326362.90343487,-7877655.20065348 5326350.13532052,-7877648.49391143 5326337.32374974,-7877643.65901759 5326326.22222194,-7877640.54174649 5326317.98495092,-7877638.47946384 5326312.69251466,-7877637.02461236 5326309.41766151,-7877635.93699004 5326307.36492091,-7877635.03741436 5326305.89378408,-7877634.37552356 5326304.92447239,-7877634.1818622 5326304.75994379,-7877633.90649558 5326304.63083217,-7877633.16147015 5326303.94390602,-7877631.30797353 5326301.95562846,-7877628.59563059 5326298.9646886,-7877624.75405624 5326294.57147031,-7877620.04257439 5326289.20290238,-7877605.1368801 5326269.89755827,-7877600.72956406 5326263.44505996,-7877596.59736954 5326256.97601231,-7877592.97477853 5326250.99768363,-7877589.84598632 5326245.64185307,-7877587.04980277 5326240.78367801,-7877584.82215966 5326236.78819166,-7877582.4515387 5326232.58101676,-7877580.16105838 5326228.74611572,-7877578.28643227 5326225.38432161,-7877576.32672119 5326221.981505,-7877572.12853361 5326215.38568959,-7877562.83082771 5326202.40964065,-7877560.14258625 5326198.91109735,-7877555.74106681 5326193.43921627,-7877544.40401567 5326178.41350935,-7877538.73438683 5326169.87808683,-7877533.84941206 5326161.93214106,-7877530.16352417 5326155.54169162,-7877526.86733974 5326149.7548119,-7877523.57806898 5326144.27054778,-7877520.17304077 5326138.61423772,-7877516.49437242 5326132.29805113,-7877512.51199748 5326125.38795389,-7877508.67119126 5326118.67777405,-7877504.8616192 5326111.6982379,-7877500.99135573 5326104.53864453,-7877497.53453541 5326097.93552399,-7877494.48655939 5326091.88936288,-7877491.80142861 5326086.53272636,-7877489.39864588 5326081.9322006,-7877487.20660172 5326077.89698438,-7877436.86180829 5325999.08860984,-7877433.47909177 5325994.67105845,-7877429.78557564 5325989.91963261,-7877424.98802589 5325983.94968005,-7877413.035813 5325968.1389807,-7877406.62096112 5325958.36552558,-7877400.6775662 5325948.35680301,-7877395.6114757 5325938.80659833,-7877391.58825804 5325930.45296229,-7877388.5364753 5325923.77999404,-7877386.12693183 5325918.71037713,-7877384.34739216 5325915.31205237,-7877382.52685934 5325912.20956664,-7877357.16486188 5325876.68317205,-7877351.87082009 5325868.16529597,-7877347.07872019 5325859.69903099,-7877343.14849775 5325852.3450681,-7877340.04570306 5325846.28979986,-7877337.29929231 5325841.19655153,-7877319.35958924 5325813.02562169,-7877300.59588863 5325785.57806127,-7877296.20480359 5325778.22654431,-7877278.10160881 5325748.78634677,-7877274.75803642 5325744.18030319,-7877270.6230064 5325738.76504701,-7877259.09239695 5325722.99386907,-7877252.80553704 5325713.14005114,-7877247.26378777 5325703.39086833,-7877242.73519801 5325694.62147806,-7877239.0867367 5325687.28150524,-7877236.27516085 5325681.69300207,-7877234.04882257 5325677.36724264,-7877230.7327365 5325671.78007461,-7877228.51956988 5325668.72588025,-7877225.18652059 5325664.42328553,-7877220.6540688 5325658.54708502,-7877203.57027966 5325634.02464154,-7877198.30511022 5325625.43780428,-7877193.60526452 5325617.3396903,-7877189.61768593 5325610.20919974,-7877186.33053091 5325604.20441734,-7877168.71157514 5325574.99244436,-7877164.36535178 5325567.42128661,-7877160.340298 5325560.14087696,-7877156.66314322 5325553.27085201,-7877153.26486682 5325546.90502163,-7877150.07995506 5325540.95681932,-7877147.30508399 5325535.84778833,-7877121.43224926 5325496.62637984,-7877118.22540736 5325492.28652278,-7877115.16148239 5325488.28554647,-7877111.14881775 5325483.49086171,-7877105.45321267 5325476.79128376,-7877097.79552575 5325467.04070635,-7877089.27181652 5325454.29439415,-7877081.7876515 5325440.56020824,-7877076.41958721 5325428.40364637,-7877073.05449328 5325419.58064136,-7877071.08561032 5325414.40285275,-7877069.85967509 5325411.64619633,-7877053.41857784 5325384.93929862,-7877048.31442185 5325375.95282714,-7877043.49143452 5325366.6826261,-7877039.50366938 5325358.67573254,-7877036.50146499 5325352.32039143,-7877034.02227592 5325347.2931152,-7877030.30295854 5325340.7730717,-7877028.92188342 5325338.55360993,-7877027.63254808 5325336.88581534,-7877026.24005505 5325335.37363108,-7877023.39322787 5325332.57729805,-7877018.43757913 5325327.87079795,-7877011.7659193 5325321.18730165,-7877004.45636294 5325313.14987397,-7876998.41894039 5325306.01434521,-7876994.75032601 5325301.40325121,-7876992.35417381 5325298.5883331,-7876992.63527494 5325299.02904849,-7876991.79224143 5325298.29592325,-7876990.80931722 5325297.76211836,-7876990.72062083 5325298.48704141,-7877103.4217567 5325130.86199137,-7877111.24911298 5325135.73624149,-7877116.07953996 5325139.26710706,-7877126.05923472 5325147.76416828,-7877137.47228493 5325158.70526948,-7877145.40410771 5325167.66100663,-7877151.56871502 5325175.32868693,-7877155.42635832 5325180.1332529,-7877158.44477693 5325183.52785587,-7877162.59584537 5325187.68361161,-7877168.71030155 5325193.73165944,-7877176.62435849 5325202.19793905,-7877185.37430795 5325212.71048869,-7877193.423441 5325223.74489179,-7877200.45317186 5325234.73573524,-7877211.63829741 5325254.80572578,-7877215.71458946 5325263.15818259,-7877219.02048955 5325270.26727875,-7877221.58820554 5325275.5554846,-7877223.6917643 5325279.74976917,-7877226.25628434 5325284.3124731,-7877249.45729464 5325324.16586157,-7877254.35393141 5325335.04306168,-7877257.88917882 5325344.00725608,-7877259.84268279 5325349.49563972,-7877260.47350217 5325351.48114386,-7877260.16325989 5325351.04223341,-7877260.11220079 5325350.74438075,-7877261.85482643 5325352.59541579,-7877265.86875472 5325357.1586889,-7877271.31824679 5325363.79620143,-7877277.22172525 5325371.56614947,-7877282.79675428 5325379.16659448,-7877321.48922421 5325438.26248833,-7877325.57905508 5325445.77130766,-7877329.13515693 5325452.44097293,-7877332.41604997 5325458.60833954,-7877335.41806465 5325464.27152515,-7877338.19586863 5325469.35497192,-7877340.89987969 5325474.14768216,-7877360.07820005 5325506.50102856,-7877363.71759112 5325513.28356571,-7877366.78024694 5325518.94041521,-7877369.43985647 5325523.71434457,-7877371.84336306 5325527.83019766,-7877380.3630568 5325540.23029039,-7877384.8598526 5325546.12525742,-7877390.43236257 5325553.59381797,-7877396.63000193 5325562.56482495,-7877408.15651463 5325582.12898115,-7877412.60934579 5325590.84468024,-7877416.29140691 5325598.38234221,-7877419.0747384 5325604.16856061,-7877421.10162976 5325608.35601579,-7877422.61011491 5325611.22496013,-7877424.0537752 5325613.56585782,-7877429.53031017 5325620.99850558,-7877434.17715109 5325627.10045798,-7877439.36807299 5325634.18098998,-7877465.97820702 5325675.70727921,-7877468.63735639 5325680.21179244,-7877481.78524315 5325699.08749627,-7877510.66157037 5325744.33942294,-7877514.71801739 5325751.77975203,-7877518.10885966 5325758.34276558,-7877520.73411835 5325763.35304785,-7877522.74487622 5325767.08167608,-7877524.74844549 5325770.41995822,-7877549.97497218 5325807.30079574,-7877555.88495955 5325817.32476115,-7877561.21749847 5325827.1375889,-7877565.48712444 5325835.6178987,-7877568.80529034 5325842.49488244,-7877571.27570964 5325847.43716368,-7877573.13616524 5325850.92883791,-7877574.6140697 5325853.45388881,-7877576.05342634 5325855.70609399,-7877581.29389036 5325862.50701857,-7877585.46374404 5325867.71583359,-7877590.67578717 5325874.39722752,-7877596.19862992 5325881.66656047,-7877659.64709374 5325979.34813112,-7877663.94868654 5325986.99991642,-7877667.85400829 5325994.25578219,-7877671.29144951 5326001.00961725,-7877674.30420132 5326007.07394235,-7877677.03179715 5326012.49663293,-7877679.46963815 5326017.19348725,-7877682.03001474 5326021.98571631,-7877684.8065338 5326026.79324098,-7877687.50332831 5326031.40085771,-7877690.56567358 5326036.51769735,-7877693.90165897 5326041.8709701,-7877697.29155766 5326047.31160471,-7877700.61269851 5326052.7883884,-7877703.35860343 5326057.32286073,-7877705.64755139 5326060.97937184,-7877707.39922194 5326063.53828851,-7877712.20349697 5326069.51561351,-7877715.65618604 5326073.528964,-7877719.83264652 5326078.58405199,-7877735.51998188 5326098.9756643,-7877746.90652301 5326115.83884722,-7877749.8325007 5326120.56624556,-7877752.90540752 5326125.58873781,-7877755.80983676 5326130.22282166,-7877758.44859289 5326134.65401855,-7877761.23032686 5326139.38159523,-7877763.50536457 5326143.24649668,-7877765.50963776 5326146.6137523,-7877767.20564464 5326149.35852121,-7877768.51573634 5326151.44320237,-7877769.85992733 5326153.37505829,-7877773.69301398 5326158.03714941,-7877775.66070158 5326160.03666257,-7877778.37460835 5326162.92682483,-7877782.09405822 5326166.96517869,-7877786.9815752 5326172.42963244,-7877792.91571922 5326179.53418311,-7877799.38136621 5326188.29751631,-7877805.5576535 5326197.7876517,-7877811.20386718 5326207.57399401,-7877816.11764268 5326217.19728733,-7877820.5959949 5326226.83182442,-7877824.33605298 5326235.83710217,-7877827.22130326 5326243.41765574,-7877829.05156509 5326248.39216952,-7877829.72080163 5326250.58715273,-7877829.50769654 5326250.64867179,-7877829.14142356 5326250.16083058,-7877829.63350787 5326250.86451556,-7877831.53406722 5326253.02105832,-7877835.01053027 5326256.85169193,-7877839.59756894 5326261.85138294,-7877843.96759061 5326266.71830999,-7877847.5107397 5326270.797581,-7877849.76850702 5326273.41272705,-7877851.52430094 5326275.19455669,-7877858.87403366 5326281.29312698,-7877866.31702966 5326287.66507303,-7877731.13322687 5326435.24404656))}

No idea what the problem is.

Hi Dan,

It looks one of your polygon is not valid, please try the code as below, we have two API to get different:

            string Poly1 = "POLYGON((-7877448.29829595 5324740.51763905,-7876028.63364608 5326029.2912219,-7877105.967813 5326250.79918145,-7878193.37052354 5325344.63025601,-7877448.29829595 5324740.51763905))";
        string Poly2 = "POLYGON((-7877731.13322687 5326435.24404656,-7877728.12455957 5326432.80810549,-7877715.06571897 5326421.71426822,-7877707.29751201 5326414.1799989,-7877700.46418759 5326406.88622082,-7877694.97808909 5326400.63313546,-7877690.07148653 5326395.08303144,-7877685.13452432 5326389.58100731,-7877679.08698649 5326382.65584006,-7877671.58723328 5326373.8024913,-7877663.29744665 5326362.90343487,-7877655.20065348 5326350.13532052,-7877648.49391143 5326337.32374974,-7877643.65901759 5326326.22222194,-7877640.54174649 5326317.98495092,-7877638.47946384 5326312.69251466,-7877637.02461236 5326309.41766151,-7877635.93699004 5326307.36492091,-7877635.03741436 5326305.89378408,-7877634.37552356 5326304.92447239,-7877634.1818622 5326304.75994379,-7877633.90649558 5326304.63083217,-7877633.16147015 5326303.94390602,-7877631.30797353 5326301.95562846,-7877628.59563059 5326298.9646886,-7877624.75405624 5326294.57147031,-7877620.04257439 5326289.20290238,-7877605.1368801 5326269.89755827,-7877600.72956406 5326263.44505996,-7877596.59736954 5326256.97601231,-7877592.97477853 5326250.99768363,-7877589.84598632 5326245.64185307,-7877587.04980277 5326240.78367801,-7877584.82215966 5326236.78819166,-7877582.4515387 5326232.58101676,-7877580.16105838 5326228.74611572,-7877578.28643227 5326225.38432161,-7877576.32672119 5326221.981505,-7877572.12853361 5326215.38568959,-7877562.83082771 5326202.40964065,-7877560.14258625 5326198.91109735,-7877555.74106681 5326193.43921627,-7877544.40401567 5326178.41350935,-7877538.73438683 5326169.87808683,-7877533.84941206 5326161.93214106,-7877530.16352417 5326155.54169162,-7877526.86733974 5326149.7548119,-7877523.57806898 5326144.27054778,-7877520.17304077 5326138.61423772,-7877516.49437242 5326132.29805113,-7877512.51199748 5326125.38795389,-7877508.67119126 5326118.67777405,-7877504.8616192 5326111.6982379,-7877500.99135573 5326104.53864453,-7877497.53453541 5326097.93552399,-7877494.48655939 5326091.88936288,-7877491.80142861 5326086.53272636,-7877489.39864588 5326081.9322006,-7877487.20660172 5326077.89698438,-7877436.86180829 5325999.08860984,-7877433.47909177 5325994.67105845,-7877429.78557564 5325989.91963261,-7877424.98802589 5325983.94968005,-7877413.035813 5325968.1389807,-7877406.62096112 5325958.36552558,-7877400.6775662 5325948.35680301,-7877395.6114757 5325938.80659833,-7877391.58825804 5325930.45296229,-7877388.5364753 5325923.77999404,-7877386.12693183 5325918.71037713,-7877384.34739216 5325915.31205237,-7877382.52685934 5325912.20956664,-7877357.16486188 5325876.68317205,-7877351.87082009 5325868.16529597,-7877347.07872019 5325859.69903099,-7877343.14849775 5325852.3450681,-7877340.04570306 5325846.28979986,-7877337.29929231 5325841.19655153,-7877319.35958924 5325813.02562169,-7877300.59588863 5325785.57806127,-7877296.20480359 5325778.22654431,-7877278.10160881 5325748.78634677,-7877274.75803642 5325744.18030319,-7877270.6230064 5325738.76504701,-7877259.09239695 5325722.99386907,-7877252.80553704 5325713.14005114,-7877247.26378777 5325703.39086833,-7877242.73519801 5325694.62147806,-7877239.0867367 5325687.28150524,-7877236.27516085 5325681.69300207,-7877234.04882257 5325677.36724264,-7877230.7327365 5325671.78007461,-7877228.51956988 5325668.72588025,-7877225.18652059 5325664.42328553,-7877220.6540688 5325658.54708502,-7877203.57027966 5325634.02464154,-7877198.30511022 5325625.43780428,-7877193.60526452 5325617.3396903,-7877189.61768593 5325610.20919974,-7877186.33053091 5325604.20441734,-7877168.71157514 5325574.99244436,-7877164.36535178 5325567.42128661,-7877160.340298 5325560.14087696,-7877156.66314322 5325553.27085201,-7877153.26486682 5325546.90502163,-7877150.07995506 5325540.95681932,-7877147.30508399 5325535.84778833,-7877121.43224926 5325496.62637984,-7877118.22540736 5325492.28652278,-7877115.16148239 5325488.28554647,-7877111.14881775 5325483.49086171,-7877105.45321267 5325476.79128376,-7877097.79552575 5325467.04070635,-7877089.27181652 5325454.29439415,-7877081.7876515 5325440.56020824,-7877076.41958721 5325428.40364637,-7877073.05449328 5325419.58064136,-7877071.08561032 5325414.40285275,-7877069.85967509 5325411.64619633,-7877053.41857784 5325384.93929862,-7877048.31442185 5325375.95282714,-7877043.49143452 5325366.6826261,-7877039.50366938 5325358.67573254,-7877036.50146499 5325352.32039143,-7877034.02227592 5325347.2931152,-7877030.30295854 5325340.7730717,-7877028.92188342 5325338.55360993,-7877027.63254808 5325336.88581534,-7877026.24005505 5325335.37363108,-7877023.39322787 5325332.57729805,-7877018.43757913 5325327.87079795,-7877011.7659193 5325321.18730165,-7877004.45636294 5325313.14987397,-7876998.41894039 5325306.01434521,-7876994.75032601 5325301.40325121,-7876992.35417381 5325298.5883331,-7876992.63527494 5325299.02904849,-7876991.79224143 5325298.29592325,-7876990.80931722 5325297.76211836,-7876990.72062083 5325298.48704141,-7877103.4217567 5325130.86199137,-7877111.24911298 5325135.73624149,-7877116.07953996 5325139.26710706,-7877126.05923472 5325147.76416828,-7877137.47228493 5325158.70526948,-7877145.40410771 5325167.66100663,-7877151.56871502 5325175.32868693,-7877155.42635832 5325180.1332529,-7877158.44477693 5325183.52785587,-7877162.59584537 5325187.68361161,-7877168.71030155 5325193.73165944,-7877176.62435849 5325202.19793905,-7877185.37430795 5325212.71048869,-7877193.423441 5325223.74489179,-7877200.45317186 5325234.73573524,-7877211.63829741 5325254.80572578,-7877215.71458946 5325263.15818259,-7877219.02048955 5325270.26727875,-7877221.58820554 5325275.5554846,-7877223.6917643 5325279.74976917,-7877226.25628434 5325284.3124731,-7877249.45729464 5325324.16586157,-7877254.35393141 5325335.04306168,-7877257.88917882 5325344.00725608,-7877259.84268279 5325349.49563972,-7877260.47350217 5325351.48114386,-7877260.16325989 5325351.04223341,-7877260.11220079 5325350.74438075,-7877261.85482643 5325352.59541579,-7877265.86875472 5325357.1586889,-7877271.31824679 5325363.79620143,-7877277.22172525 5325371.56614947,-7877282.79675428 5325379.16659448,-7877321.48922421 5325438.26248833,-7877325.57905508 5325445.77130766,-7877329.13515693 5325452.44097293,-7877332.41604997 5325458.60833954,-7877335.41806465 5325464.27152515,-7877338.19586863 5325469.35497192,-7877340.89987969 5325474.14768216,-7877360.07820005 5325506.50102856,-7877363.71759112 5325513.28356571,-7877366.78024694 5325518.94041521,-7877369.43985647 5325523.71434457,-7877371.84336306 5325527.83019766,-7877380.3630568 5325540.23029039,-7877384.8598526 5325546.12525742,-7877390.43236257 5325553.59381797,-7877396.63000193 5325562.56482495,-7877408.15651463 5325582.12898115,-7877412.60934579 5325590.84468024,-7877416.29140691 5325598.38234221,-7877419.0747384 5325604.16856061,-7877421.10162976 5325608.35601579,-7877422.61011491 5325611.22496013,-7877424.0537752 5325613.56585782,-7877429.53031017 5325620.99850558,-7877434.17715109 5325627.10045798,-7877439.36807299 5325634.18098998,-7877465.97820702 5325675.70727921,-7877468.63735639 5325680.21179244,-7877481.78524315 5325699.08749627,-7877510.66157037 5325744.33942294,-7877514.71801739 5325751.77975203,-7877518.10885966 5325758.34276558,-7877520.73411835 5325763.35304785,-7877522.74487622 5325767.08167608,-7877524.74844549 5325770.41995822,-7877549.97497218 5325807.30079574,-7877555.88495955 5325817.32476115,-7877561.21749847 5325827.1375889,-7877565.48712444 5325835.6178987,-7877568.80529034 5325842.49488244,-7877571.27570964 5325847.43716368,-7877573.13616524 5325850.92883791,-7877574.6140697 5325853.45388881,-7877576.05342634 5325855.70609399,-7877581.29389036 5325862.50701857,-7877585.46374404 5325867.71583359,-7877590.67578717 5325874.39722752,-7877596.19862992 5325881.66656047,-7877659.64709374 5325979.34813112,-7877663.94868654 5325986.99991642,-7877667.85400829 5325994.25578219,-7877671.29144951 5326001.00961725,-7877674.30420132 5326007.07394235,-7877677.03179715 5326012.49663293,-7877679.46963815 5326017.19348725,-7877682.03001474 5326021.98571631,-7877684.8065338 5326026.79324098,-7877687.50332831 5326031.40085771,-7877690.56567358 5326036.51769735,-7877693.90165897 5326041.8709701,-7877697.29155766 5326047.31160471,-7877700.61269851 5326052.7883884,-7877703.35860343 5326057.32286073,-7877705.64755139 5326060.97937184,-7877707.39922194 5326063.53828851,-7877712.20349697 5326069.51561351,-7877715.65618604 5326073.528964,-7877719.83264652 5326078.58405199,-7877735.51998188 5326098.9756643,-7877746.90652301 5326115.83884722,-7877749.8325007 5326120.56624556,-7877752.90540752 5326125.58873781,-7877755.80983676 5326130.22282166,-7877758.44859289 5326134.65401855,-7877761.23032686 5326139.38159523,-7877763.50536457 5326143.24649668,-7877765.50963776 5326146.6137523,-7877767.20564464 5326149.35852121,-7877768.51573634 5326151.44320237,-7877769.85992733 5326153.37505829,-7877773.69301398 5326158.03714941,-7877775.66070158 5326160.03666257,-7877778.37460835 5326162.92682483,-7877782.09405822 5326166.96517869,-7877786.9815752 5326172.42963244,-7877792.91571922 5326179.53418311,-7877799.38136621 5326188.29751631,-7877805.5576535 5326197.7876517,-7877811.20386718 5326207.57399401,-7877816.11764268 5326217.19728733,-7877820.5959949 5326226.83182442,-7877824.33605298 5326235.83710217,-7877827.22130326 5326243.41765574,-7877829.05156509 5326248.39216952,-7877829.72080163 5326250.58715273,-7877829.50769654 5326250.64867179,-7877829.14142356 5326250.16083058,-7877829.63350787 5326250.86451556,-7877831.53406722 5326253.02105832,-7877835.01053027 5326256.85169193,-7877839.59756894 5326261.85138294,-7877843.96759061 5326266.71830999,-7877847.5107397 5326270.797581,-7877849.76850702 5326273.41272705,-7877851.52430094 5326275.19455669,-7877858.87403366 5326281.29312698,-7877866.31702966 5326287.66507303,-7877731.13322687 5326435.24404656))";

        PolygonShape p1 = new PolygonShape(Poly1);
        PolygonShape p2 = new PolygonShape(Poly2);

        Feature f1 = new Feature(p1);
        Feature f2 = new Feature(p2);            

        Feature result1 = SqlTypesGeometryHelper.GetDifference(f1.MakeValid(), f2.MakeValid());
        Feature result2 = f1.MakeValid().GetDifference(f2.MakeValid());

Regards,

Ethan