[postgis-users] Problems with GeomUnion
Martin Davis
mbdavis at VividSolutions.com
Thu Apr 7 16:12:30 PDT 2005
The large polygon is invalid. It has a self-intersection in the lower
left corner at the boundary with the other polygon. One of the input
polygons which formed it must be invalid.
(See attached screenshot)
Martin Davis, Senior Technical Architect
Vivid Solutions Inc. www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046
> -----Original Message-----
> From: Bill Binko [mailto:bill at binko.net]
> Sent: April 7, 2005 4:03 PM
> To: PostGIS Mailing List
> Subject: [postgis-users] Problems with GeomUnion
>
>
> Hi everyone,
>
> I'm fairly new to PostGIS (and Mapserver), but have made
> amazing progress.
> Thanks for the great software!
>
> I'm getting an error from GeomUnion that I don't understand. I was
> getting the segfault from rc3, and that was fixed with rc6.
> Now, I get a
> different problem.
>
> Some background: I'm displaying parcels. I'd like go display
> subdivisions, but don't have the shapefiles for that. So I
> loaded the
> parcels and their subdivision id and tried to create union
> objects of each
> subdivision. Seemed sane to me.
>
> Anyway, I tried to run this command:
>
> select geomunion(parcel_shape) from parcels join parcel_info
> on sdf_id = feat_num join subdivisions on subdivision =
> subdiv_id where subdiv_name ilike 'FAIRWAY EST%';
>
> That should have grabbed all of the parcels in my (old)
> neighborhood and
> created a union. However, I got this:
>
> NOTICE: AssertionFailedException: EdgeRing::computePoints:
> found null Directed Edge
> ERROR: GEOS union() threw an error!
>
> So, I tried a manual binary search to try to figure out where
> it was failing, and it fails when you add the 38th parcel.
> Interestingly, it
> allows the 37th and 38th to union, but not the whole set.
>
> I have a picture of the shapes available at
> http://www/binko.net/unionfails.png
>
> The blue outlines are all of the parcels that should be added
> (using the
> above query), the yellow is the union of the first 37 shapes,
> and the red
> is the 38th that blows it up.
>
> I have WKT for all of this if anyone wants it, but I thought
> I'd just post
> the two shapes for now. They are below...
>
> Can anyone explain this to me? I am using GEOM 2.1.1 if that matters.
>
> Thanks
> Bill
>
> The Union of the first 37 is:
>
> MULTIPOLYGON(((249504.223108452
> 1350036.44650513,249504.218689097
> 1350035.75305862,249514.770020721
> 1350146.64176436,249605.824741172
> 1350145.36811784,249694.42281974
> 1350144.80380146,249785.481952678
> 1350144.22401776,249876.541082203
> 1350143.64444507,249875.839443983
> 1350033.38646578,249863.52970887
> 1350032.77132712,249784.780058972
> 1350033.96603434,249772.474736413
> 1350034.0443706,249696.181735147
> 1350034.5301414,249681.415347528
> 1350034.62417867,249605.122343401
> 1350035.11012626,249590.355955228
> 1350035.20419774,249504.223108452
> 1350036.44650513)),((250721.354794677
> 1349856.03350435,250876.402472383
> 1349855.05050803,250878.859151544
> 1349854.34146378,250883.772510116
> 1349852.92337575,250886.224794653
> 1349851.52088592,250891.13375903
> 1349849.40935277,250896.033934518
> 1349845.91092814,250898.46864128
> 1349841.73465488,250900.898953963
> 1349836.86493574,250903.329267264
> 1349831.99521676,250903.302899868
> 1349827.83454048,250903.272137919
> 1349822.98041815,250903.241375983
> 1349818.12629583,250900.753931912
> 1349813.98121616,250898.262092682
> 1349809.14269061,250860.941571121
> 1349745.57962418,250831.070123231
> 1349692.37147928,250811.100096807
> 1349648.11574527,250801.066708383
> 1349618.35997578,250786.00560736
> 1349571.99271135,250778.398103289
> 1349536.67377626,250770.799380099
> 1349502.74173483,250768.219570749
> 1349484.03429748,250760.69557731
> 1349461.89084005,250753.206751931
> 1349445.29495194,250745.717920435
> 1349428.69906523,250735.772378028
> 1349412.81223226,250725.844417649
> 1349399.69918564,250713.446551616
> 1349385.21485722,250701.06626813
> 1349373.5043165,250606.117100466
> 1349537.07298432,250692.255405091
> 1349536.52656289,250692.976703749
> 1349650.25171378,250720.659947385
> 1349746.46902186,250721.354794677
> 1349856.03350435)),((250056.19386402
> 1350141.80813626,250144.79192773
> 1350141.24483528,250146.552106386
> 1350030.9712239,250136.707849632
> 1350031.03380197,250055.492729909
> 1350031.55016514,250056.19386402
> 1350141.80813626)),((250326.209785113
> 1350029.82960729,250318.826593097
> 1350029.87650686,250235.15041536
> 1350030.40813224,250235.851045406
> 1350140.66609521,250324.449102574
> 1350140.10319928,250415.503810199
> 1350138.83142923,250414.808087548
> 1350029.26692067,250414.803684262
> 1350028.57347443,250409.881556347
> 1350028.60472955,250326.209785113
> 1350029.82960729)),((251004.777048389
> 1350305.6886013,251024.465414498
> 1350305.56387938,251154.900835941
> 1350304.73784583,251147.350860283
> 1350278.4336388,251139.814046926
> 1350254.20977158,251129.785439018
> 1350225.14736601,251117.286982538
> 1350194.71365441,251023.76698331
> 1350195.30594458,250935.173480186
> 1350196.56071303,250933.411114204
> 1350306.83424711,251004.777048389
> 1350305.6886013)),((249314.550749715
> 1349625.03830099,249317.303722578
> 1349670.79007084,249320.109760215
> 1349724.86319918,249457.873029134
> 1349714.96968787,249454.859439956
> 1349628.30457303,249454.819659819
> 1349622.06355542,249454.788719727
> 1349617.20943062,249456.900634137
> 1349562.41147885,249459.193772503
> 1349536.04482979,249466.294196689
> 1349491.61720332,249473.40347786
> 1349448.57647199,249475.780607987
> 1349435.38530598,249485.368694378
> 1349395.10267833,249494.983316835
> 1349358.98073201,249502.207553088
> 1349333.96961334,249514.300994013
> 1349300.60577505,249523.986366857
> 1349275.57897884,249550.625626416
> 1349207.44875054,249560.364062321
> 1349190.74332026,249436.875009482
> 1349123.56976413,249419.868174717
> 1349158.35189331,249400.475406081
> 1349204.93830777,249393.184893934
> 1349219.54775013,249378.665782716
> 1349258.47488802,249361.800549086
> 1349315.44732959,249342.531744811
> 1349381.45027711,249335.378371309
> 1349417.5565701,249323.537188634
> 1349490.4469138,249321.257404221
> 1349518.89391151,249316.644778369
> 1349567.46655141,249314.550749715
> 1349625.03830099)),((250367.865922117
> 1349225.82852954,250261.698777412
> 1349173.10538217,250155.504897825
> 1349116.22183987,250094.633727443
> 1349219.93641492,250156.364344955
> 1349251.44382551,250200.818611665
> 1349275.43289868,250309.446679245
> 1349328.14024637,250367.865922117
> 1349225.82852954)),((250508.519136495
> 1349283.18737851,250424.630047574
> 1349250.433155,250363.749591895
> 1349352.76041557,250447.642922332
> 1349386.20795282,250477.255405199
> 1349398.50249939,250487.12622859
> 1349402.60068646,250590.743347274
> 1349441.47112175,250651.619839344
> 1349338.45077321,250629.403890577
> 1349328.18959412,250538.127274725
> 1349294.78852573,250508.519136495
> 1349283.18737851)),((249938.99678037
> 1349128.69410222,249993.344313592
> 1349160.2482303,250042.756296304
> 1349189.75339236,250103.627381696
> 1349086.03873623,250054.20650098
> 1349055.14660486,250002.311184103
> 1349022.18984776,249903.420491186
> 1348952.77798796,249842.562944875
> 1349058.57329412,249938.99678037
> 1349128.69410222)),((250003.846216674
> 1348876.55052383,250040.930819826
> 1348902.6667176,250078.006555984
> 1348927.39605345,250152.153479619
> 1348976.16138164,250194.151332356
> 1349000.85954014,250255.904231276
> 1349035.83434018,250310.22960004
> 1349063.92167233,250364.546082341
> 1349090.62218613,250446.00965892
> 1349128.93948004,250485.493220485
> 1349145.33221613,250527.446668013
> 1349163.09626397,250611.331449342
> 1349195.15726202,250643.396336637
> 1349206.0494291,250653.258391801
> 1349208.76076636,250663.120445539
> 1349211.47210607,250672.973701217
> 1349212.79655635,250682.818159884
> 1349212.7341172,250692.662618506
> 1349212.67168051,250702.502679299
> 1349211.91580036,250712.333945157
> 1349209.77303082,250722.165212025
> 1349207.63026377,250731.983288088
> 1349203.40716143,250739.344647914
> 1349199.89311336,250749.153933732
> 1349194.28312358,250756.506503078
> 1349189.38218698,250763.854677542
> 1349183.78780591,250766.293810637
> 1349180.30497209,250771.194060956
> 1349176.80653446,250776.072329766
> 1349169.84086796,250783.402925294
> 1349161.47270714,250788.27680197
> 1349153.81359639,250793.141888263
> 1349144.76759454,250795.545857524
> 1349135.73719561,250807.675618483
> 1349107.92135083,250714.051873621
> 1349092.56506397,250701.728671903
> 1349089.86931906,250652.453441517
> 1349081.86016138,250612.987488786
> 1349068.24104184,250593.245702515
> 1349060.04460488,250573.499507795
> 1349051.15473175,250526.623712617
> 1349033.42187106,250509.347417619
> 1349025.90330257,250494.532242939
> 1349018.36912048,250442.698896175
> 1348995.12003305,250430.353630686
> 1348988.95714247,250415.542829077
> 1348982.11643555,250358.751893736
> 1348953.35114133,250341.466721813
> 1348944.44575342,250314.301775812
> 1348930.05533266,250277.252627998
> 1348909.48645314,250247.60887573
> 1348892.33792818,250215.490742136
> 1348873.12472537,250195.726737932
> 1348861.46125471,250171.00959675
> 1348844.97495362,250143.822480256
> 1348827.11741835,250119.109703171
> 1348811.32459513,250096.862455882
> 1348796.20958743,250072.140822705
> 1348779.02990109,250042.474834139
> 1348758.41429751,250027.633009166
> 1348746.71961193,250002.902494353
> 1348728.15307609,249965.795651768
> 1348698.56968577,249936.103079669
> 1348673.79348449,249851.995984091
> 1348607.06159612,249766.398526226
> 1348692.90367627,249860.398707315
> 1348767.20064693,249895.035603672
> 1348795.41270496,249909.877451662
> 1348807.10734118,249929.668038929
> 1348822.93134666,250003.846216674
> 1348876.55052383)),((249699.080293261
> 1348943.67643334,249793.088850917
> 1349019.36013223,249853.959568578
> 1348915.64508782,249814.378405604
> 1348883.99716233,249772.322798097
> 1348850.28460327,249757.480923536
> 1348838.59001822,249690.69017056
> 1348785.61772999,249607.550177841
> 1348870.75106162,249699.080293261 1348943.67643334)))
>
> and the 38th is:
>
> MULTIPOLYGON(((249426.171937159
> 1350147.20648582,249514.770020721
> 1350146.64176436,249504.218689097
> 1350035.75305862,249386.091997729
> 1350037.19953568,249426.171937159 1350147.20648582)))
>
>
>
> _______________________________________________
> postgis-users mailing list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: self-intersection.png
Type: image/png
Size: 5120 bytes
Desc: self-intersection.png
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050407/be3f89a7/attachment.png>
More information about the postgis-users
mailing list