Giswater/giswater

mincut analysis returns all feratures giswater 2.1.x

Closed this issue · 4 comments

I put together a enough data to have a transmission line from a well to a pump out to some distribution and a subdivision. The system has valves, all open, some hydrants and junctions. When I do a mincut I will either get a return of all valves and pipes in the system or
"Geometry type (MultiLineString) does not match column type (MultiPolygon) CONTEXT: SQL statment "INSERT INTO anl_mincut_polygon VALUES('1',polygon_aux)" PL/pgSQL function wa_net.gw_fct_mincut(character varying, character varying) line 122 at SQL statment.
I compared my data to the sample data and it seems to have all the same fields and domains filled in, not sure what I might have done wrong. I will add that I have a large number of; junctions, valves, and hydrants in the data not connected to pipes yet; not sure if that would be causing issues or not.

Dear Taylor,
It's a bug of 2.1 version, Sometimes the construction of polygon it's done with multi approach. It was not easy to fix it. I thing the best solution is comment the lines of gw_fct_mincut function from114-127:

-- Contruct concave hull for included lines
polygon_aux := ST_Multi(ST_ConcaveHull(ST_Collect(ARRAY(SELECT the_geom FROM anl_mincut_arc)), 0.80));
-- Concave hull for not included lines
polygon_aux2 := ST_Multi(ST_Buffer(ST_Collect(ARRAY(SELECT the_geom FROM v_anl_arc WHERE arc_id NOT IN (SELECT a.arc_id FROM anl_mincut_arc AS a) AND ST_Intersects(the_geom, polygon_aux))), 1, 'join=mitre mitre_limit=1.0'));
--RAISE EXCEPTION 'Polygon = %', polygon_aux2;
-- Substract
IF polygon_aux2 IS NOT NULL THEN
polygon_aux := ST_Multi(ST_Difference(polygon_aux, polygon_aux2));
ELSE
polygon_aux := polygon_aux;
END IF;

I encourage you to use the 3.1 version. We don't provide support for 2.x version
3.x version will be supported and updated next 2 years at least.

Oh, I rolled back to giswater 2 because I thought it was easier to work with where it didn't ask for as much information and there was less required fields and domains.
I will try what you suggest and then try to go up to giswater 3.

We know.
We are translating the user's manual to english (31/12/2018) and also we are working to enhance the web adding technical information.
If you have some problems feel free request us. You can contact with us using my email address (xtorret@bgeo.es)