Opened 16 years ago

Last modified 15 years ago

#37 closed defect (invalid)

ST_Intersection throws error on postgis Linux installation

Reported by: ironmike Owned by:
Priority: medium Milestone:
Component: postgis Version:
Keywords: Cc:

Description

<b>What steps will reproduce the problem?</b>

  1. run the following select on Windows postgis installation:

select astext(st_intersection('POLYGON((1364101.7217533 5512813.54740987,1364094.1516 5512808.6124,1364069.3528 5512791.2412,1364054.452 5512781.5276,1364049.4208 5512778.2472,1364034.5196 5512768.5336,1364008.6196 5512752.8528,1363943.73291651 5512710.55198678,1363937.59321676 5512706.79212745,1363931.24975607 5512703.38728358,1363924.72304043 5512700.34846173,1363918.03416821 5512697.68548525,1363834.3544 5512667.1152,1363827.7724 5512664.7108,1363825.292 5512663.8044,1363819.6512 5512661.7436,1363791.2784 5512651.378,1363785.6368 5512649.3172,1363661.3824 5512603.922,1363670.78 5512564.2136,1363799.5484 5512611.24,1363805.1904 5512613.3004,1363821.3696 5512619.2096,1363996.1172 5512683.0508,1363996.8088 5512680.9424,1364042.9888 5512477.674,1364086.0004 5512288.3308,1364226.794 5512338.4256,1364229.6232 5512339.4324,1364229.906 5512339.5332,1364238.146 5512342.4644,1364243.8044 5512344.478,1364251.0332 5512347.0496,1364251.316 5512347.1504,1364363.9576 5512387.2288,1364404.1528 5512401.5976,1364401.9576 5512403.8636,1364367.1672 5512472.8956,1364349.0288 5512512.9464,1364319.8332 5512654.4844,1364315.8756 5512716.86,1364314.3184 5512761.898,1364314.8676 5512775.7932,1364308.10735825 5512776.20127457,1364299.95634554 5512776.92790767,1364291.86017679 5512778.1191488,1364285.608 5512774.2524,1364268.7284 5512778.9392,1364265.36493348 5512785.47602152,1364257.34389408 5512788.8428818,1364249.54218131 5512792.69075123,1364241.98860837 5512797.00541888,1364212.40328922 5512815.11894094,1364205.61733456 5512818.93085051,1364198.56435804 5512822.22256091,1364191.2841661 5512824.97549401,1364183.81784759 5512827.17411245,1364176.20754181 5512828.80600741,1364168.49620073 5512829.8619686,1364160.72734657 5512830.33603626,1364152.94482611 5512830.22553479,1364145.1925633 5512829.53108784,1364137.5143113 5512828.25661483,1364129.95340557 5512826.40930878,1364122.55251925 5512823.99959574,1364115.35342237 5512821.04107595,1364108.39674608 5512817.55044704,1364101.7217533 5512813.54740987))',

'POLYGON((1364179.3524 5512321.5456,1364172.42112749

5512319.07956315,1364166.7144 5512317.0492,1364177.1044 5512288.922,1364189.6868 5512293.5696,1364179.3524 5512321.5456))'))

and see the following as the result:

POLYGON((1364172.4211514 5512319.07957166,1364166.71443533 5512317.04910436,1364166.7144 5512317.0492,1364172.42112749 5512319.07956315,1364172.4211514 5512319.07957166))

NOTE: isvalid() is true for both geometries

The same is true for the following query:

select astext(st_intersection( 'POLYGON((1695926.8452 5703970.8492,1695883.0308 5703945.6704,1695906.14 5703906.2576,1695899.5376 5703902.4636,1695873.1292 5703887.2872,1695880.8324 5703874.15,1695854.4236 5703858.9736,1695823.6116 5703911.524,1695806.1816 5703901.508,1695836.994 5703848.9572,1695810.5852 5703833.7812,1695784.1576 5703818.594,1695850.1968 5703706.1296,1695882.4456 5703651.2752,1696017.476 5703730.5904,1696047.4068 5703734.5184,1696087.8636 5703758.282,1696094.552 5703746.8956,1696110.8144 5703719.2108,1696129.6352 5703687.17,1696051.5464 5703641.3032,1696024.1388 5703611.954,1695935.998 5703560.1832,1695948.7252 5703538.5344,1696041.2815678 5703378.6040035,1696042.44478644 5703378.48240142,1696069.91955524 5703375.78172125,1696097.42477714 5703373.41120185,1696133.99595329 5703370.77519371,1696170.6045703 5703368.72370062,1696207.24128651 5703367.25724607,1696243.89675307 5703366.37620427,1696280.56161636 5703366.08080004,1696315.25859808 5703366.34159622,1696349.94767426 5703367.12680224,1696248.4708 5703540.9304,1696207.892 5703610.4312,1696148.7596 5703711.1152,1696147.5452 5703713.1828,1696132.42 5703738.936,1696122.302 5703756.1636,1696118.2548 5703763.0548,1696054.6956 5703871.276,1696002.5228 5703961.6448,1695976.114 5703946.4684,1695949.7056 5703931.292,1695926.8452 5703970.8492))',

'POLYGON((1696135.95271126

5703798.08274817,1696107.45651253 5703781.44086572,1696107.526625 5703781.32148637,1696113.01876839 5703771.97010407,1696141.50467821 5703788.60345334,1696135.95271126 5703798.08274817))'))

  1. run the same select against Linux postgis install, and the following

error is thrown:

SQL Error: 0, SQLState: XX000 ERROR: GEOS Intersection() threw an error!

NOTE: isvalid() is still true for both geometries in Linux

<b>What is the expected output? What do you see instead?</b>

I would have expected to see the intersection of the two geometries, as in Windows.

<b>What version of the product are you using? On what operating system?</b>

Windows XP: version is postgres 8.2.3, with postgis 1.3.1-1.

Linux (Ubuntu): version is postgres 8.2.4, with postgis 1.3.3-1.

We are using Ubuntu .debs for install, so the 8.2.4/1.3.3-1 was the closest match in the Ubuntu packages mirror.

<b>Please provide any additional information below.</b>

We saw these problems before when we had a different projection in the tables we are using in Windows. We changed the projection in which we stored the raw geo data, and the issue went away. As soon as we tried to push to a production Linux server, the issues came back.

Change History (5)

comment:1 by mcayland, 16 years ago

This is likely a GEOS issue. GEOS 3 contains many fixes for topological operations, but unfortunately Ubuntu ships with the much older GEOS 2.2.x series :( I would suggest either trying to find some GEOS 3 Ubuntu packages, or building GEOS 3 from source yourself - you should find that the problem then goes away.

HTH,

Mark.

comment:2 by mcayland, 16 years ago

There is no feedback on this so far, so I will close this during the next 48 hours unless I hear otherwise.

ATB,

Mark.

comment:3 by luigi.cardeles, 16 years ago

Hi, hum i run the first query (1) and obtain that:

POLYGON((1364172.42114192 5512319.07956828,1364166.71443533 5512317.04910436,1364166.7144 5512317.0492,1364172.42112749 5512319.07956315,1364172.42114192 5512319.07956828)).

there is a little difference about the decimal (i know, very little difference, almost insignificant) but why that? I am just curious. I am running postgres 8.3.3 - postgis 1.3.3 - geos 3.0.0 at AMD 64 bits.

Thanks

comment:4 by mtnclimb, 16 years ago

In order to ensure that operations are carried out robustly, sometimes the engine adjusts input geometries slightly. This would explain the difference in output.

comment:5 by mcayland, 15 years ago

Closing due to lack of response.

Mark.

Note: See TracTickets for help on using tickets.