orbisgis / geoclimate

Geospatial processing toolbox for environmental and climate studies
GNU Lesser General Public License v3.0
59 stars 16 forks source link

Error in the reconstruction of a OSM geometry #994

Open j3r3m1 opened 2 months ago

j3r3m1 commented 2 months ago

When I run the following json file,

{
    "description": "Processing OSM data",
    "input": {
        "area" : 100000,
        "timeout": 9000,
    "maxsize":4294967296,
        "locations": [
            [51.2, 1.0, 51.4, 1.2]
        ]
    },
    "output": {
        "folder": "/tmp"
    },
    "parameters": {
        "rsu_indicators": {
            "indicatorUse": [
                "LCZ",
                "TEB"
            ],
            "svfSimplified": true,
            "estimateHeight": true
        }
    }
}

I get the following error message:

Exception lors de l'appel de la fonction définie par l'utilisateur: "intersection(POLYGON ((374379.0533518583 5688047.310188733, 374380.46387517086 5688051.381206891, 374387.76897208317 5688051.947139655, 374392.19804044906 5688049.791007236, 374390.3633792737 5688043.493979111, 374385.4619225159 5688041.745187085, 374379.51445349754 5688043.382319197, 374379.0533518583 5688047.310188733), (374343.1856932173 5688054.511769417, 374344.90738304134 5688034.096770712, 374355.8946427107 5688012.330209435, 374375.4493779954 5688007.031745351, 374384.47568311135 5688011.260502016, 374399.58793831663 5688006.438493751, 374412.9078766183 5688019.451876591, 374423.34204334795 5688035.874150383, 374423.6279998345 5688062.548518093, 374412.0891129635 5688076.907093986, 374393.28206247045 5688082.554227708, 374383.9454566629 5688095.757223021, 374370.2533379167 5688097.94077391, 374355.9282182272 5688089.402825621, 374345.52126637433 5688074.092667036, 374343.1856932173 5688054.511769417)), POLYGON ((360271.0706458315 5673966.967184718, 360877.1545035015 5696205.923488882, 374788.37189143745 5695845.264689232, 374242.92491750914 5673605.747899836, 360271.0706458315 5673966.967184718))): unable to assign free hole to a shell [ (374344.90738304134, 5688034.096770712) ]" Exception calling user-defined function: "intersection(POLYGON ((374379.0533518583 5688047.310188733, 374380.46387517086 5688051.381206891, 374387.76897208317 5688051.947139655, 374392.19804044906 5688049.791007236, 374390.3633792737 5688043.493979111, 374385.4619225159 5688041.745187085, 374379.51445349754 5688043.382319197, 374379.0533518583 5688047.310188733), (374343.1856932173 5688054.511769417, 374344.90738304134 5688034.096770712, 374355.8946427107 5688012.330209435, 374375.4493779954 5688007.031745351, 374384.47568311135 5688011.260502016, 374399.58793831663 5688006.438493751, 374412.9078766183 5688019.451876591, 374423.34204334795 5688035.874150383, 374423.6279998345 5688062.548518093, 374412.0891129635 5688076.907093986, 374393.28206247045 5688082.554227708, 374383.9454566629 5688095.757223021, 374370.2533379167 5688097.94077391, 374355.9282182272 5688089.402825621, 374345.52126637433 5688074.092667036, 374343.1856932173 5688054.511769417)), POLYGON ((360271.0706458315 5673966.967184718, 360877.1545035015 5696205.923488882, 374788.37189143745 5695845.264689232, 374242.92491750914 5673605.747899836, 360271.0706458315 5673966.967184718))): unable to assign free hole to a shell [ (374344.90738304134, 5688034.096770712) ]"; SQL statement: select id , st_intersection(a.the_geom, b.the_geom) as the_geom, a."natural", a."layer" FROM OSM_WATER_b983eb0f_dc2e_4415_8e43_f48e21b48fb6 AS a, ZONE_ENVELOPE_74cf877c_6fdb_47b1_89ef_773d100ad4a8 AS b WHERE a.the_geom && b.the_geom and (a."seamark:type" is null or a."seamark:type" in ('harbour_basin', 'harbour')) [90105-224]

The geometry causing the problem is the following: https://www.openstreetmap.org/relation/12219391

@ebocher, should we correct the geometry (there are only 3 issues on whole Europe, would be strange to change the way the algorithm work only for this case) ?

ebocher commented 2 months ago

It seems that the geometry is incorrectly modeled in OSM : https://www.google.fr/maps/@51.3297726,1.1979136,295m/data=!3m1!1e3?entry=ttu&g_ep=EgoyMDI0MDkxMS4wIKXMDSoASAFQAw%3D%3D

It would be great to check how we construct this data with GeoClimate. I will check it.

ebocher commented 2 months ago

Done here #996

geoms_pb

ebocher commented 2 days ago

Fixed ?