Trouble with ST_TRIGRID

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trouble with ST_TRIGRID

Rodolphe
Hello everybody,

I have used the function ST_TRIGRID and it works perfectly fine when I put in first argument a geometry of this type st_expand('point(852396 6517359)',100,100).

It also works whith no geometry input (but the calculation is too long and I cannot make it because my map is too big (or my parameters are bad... but that is not the point here).

But if I want to apply a calc (geometry of type multipolygon)... I obtain the following error:

ERROR [Thread-189] (ExecuteScriptProcess.java:160) - We should already be on this event pointorg.jdelaunay.delaunay.ConstrainedMesh.forceConstraintIntegrity(ConstrainedMesh.java:917)
org.orbisgis.noisemap.core.LayerJDelaunay.processDelaunay(LayerJDelaunay.java:246)
org.orbisgis.noisemap.core.LayerJDelaunay.processDelaunay(LayerJDelaunay.java:203)
org.orbisgis.noisemap.core.MeshBuilder.finishPolygonFeeding(MeshBuilder.java:335)
org.orbisgis.noisemap.core.MeshBuilder.finishPolygonFeeding(MeshBuilder.java:291)
org.orbisgis.noisemap.core.jdbc.TriangleNoiseMap.evaluateCell(TriangleNoiseMap.java:252)
org.orbisgis.noisemap.h2.BR_TriGrid3D$TriangleRowSource.readRow(BR_TriGrid3D.java:275)
org.h2.tools.SimpleResultSet.next(SimpleResultSet.java:221)
org.h2.result.LocalResult.read(LocalResult.java:97)
org.h2.table.FunctionTable.getResult(FunctionTable.java:197)
org.h2.index.FunctionIndex.find(FunctionIndex.java:48)
org.h2.index.BaseIndex.find(BaseIndex.java:127)
org.h2.index.IndexCursor.find(IndexCursor.java:159)
org.h2.table.TableFilter.next(TableFilter.java:329)
org.h2.command.dml.Select.queryFlat(Select.java:532)
org.h2.command.dml.Select.queryWithoutCache(Select.java:644)
org.h2.command.dml.Query.query(Query.java:322)
org.h2.command.dml.Insert.insertRows(Insert.java:167)
org.h2.command.dml.Insert.update(Insert.java:114)
org.h2.command.ddl.CreateTable.update(CreateTable.java:185)
org.h2.command.CommandContainer.update(CommandContainer.java:78)
org.h2.command.Command.executeUpdate(Command.java:254)
org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:184)
org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158)
org.h2gis.utilities.wrapper.StatementWrapper.execute(StatementWrapper.java:93)
org.orbisgis.view.sqlconsole.actions.ExecuteScriptProcess.parseAndExecuteScript(ExecuteScriptProcess.java:125)
org.orbisgis.view.sqlconsole.actions.ExecuteScriptProcess.run(ExecuteScriptProcess.java:154)
org.orbisgis.view.background.Job.run(Job.java:87)
org.orbisgis.view.background.RunnableBackgroundJob.run(RunnableBackgroundJob.java:71)
java.lang.Thread.run(Unknown Source)
; SQL statement:

... etc (do not know if all the other fiels are usefull).

Thanks for the answer,
Rodolphe.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Nicolas F.
Administrator
Hi,

Seems that there is incorrect geometries as input, maybe overlapping polygons. If can not reproduce the error on my side so I can not be of much help.

-Nicolas
Atelier SIG
IRSTV FR CNRS 2488
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Rodolphe

Hi,

Sorry for my answer time, still learning a lot^^. I have test it with ST_ISVALID and the geometry seems to be valid (log returning 'true'. Maybe it is too complex. I will copy-paste here but maybe it will not help because we have not the same reference ?



    MULTIPOLYGON (((850603 6515887.9, 850597.6 6515931.4, 850578 6516089.3, 850577.3 6516096.5, 850571.5 6516151.1, 850569.4 6516170.6, 850562.9 6516232.6, 850560.9 6516250.7, 850558.8 6516270.6, 850558.3 6516274.8, 850553.6 6516319.7, 850527.6 6516565, 850524.8 6516591.6, 850523.2 6516606.1, 850509.3 6516737.4, 850491.8 6516902.3, 850493 6516920.8, 850499.6 6516948.4, 850510.9 6516965.5, 850497.8 6517014.1, 850478.5 6517085.6, 850468 6517108.6, 850456.5 6517129.6, 850446.8 6517145.5, 850442 6517158.9, 850431.8 6517187.3, 850422.1 6517219.9, 850419.3 6517229.3, 850409 6517264.2, 850396.2 6517307.8, 850388.2 6517335.3, 850381.9 6517356.8, 850368.2 6517403.5, 850371.3 6517406.7, 850371.4 6517408.8, 850369.2 6517416.2, 850354.8 6517480.9, 850343.8 6517524.5, 850338.6 6517547.9, 850334.4 6517574.4, 850331.4 6517588.5, 850324.9 6517619.4, 850322 6517636.2, 850320.1 6517647.3, 850311.3 6517701, 850304.5 6517732.1, 850300.4 6517754.2, 850297.5 6517764.5, 850293.3 6517779.4, 850286.4 6517800.3, 850273.9 6517836.3, 850262.9 6517873.4, 850257.9 6517886.7, 850248.8 6517905.2, 850244.8 6517911.1, 850244.7 6517917.8, 850248 6517922.3, 850262.1 6517927.1, 850316 6517946.8, 850325.1 6517950.1, 850371.4 6517967, 850381.5 6517970.7, 850401.9 6517978.1, 850408.1 6517980.3, 850417.4 6517983.8, 850426.4 6517987, 850444.9 6517993.8, 850591.9 6518047.3, 850765.5 6518110.5, 850939 6518173.7, 851112.5 6518237, 851286.1 6518300.3, 851430.2 6518352.7, 851687 6518446.2, 851846.3 6518504.3, 852005.6 6518562.4, 852165 6518620.3, 852307.4 6518672.3, 852320.9 6518677.2, 852486.3 6518737.4, 852629.1 6518789.4, 852809.3 6518855, 852852.9 6518871, 852938.6 6518902.2, 853050.1 6518948.6, 853062 6518951.4, 853073.7 6518956, 853106.9 6518960.2, 853125.9 6518962.2, 853134.5 6518961.2, 853148.6 6518961.1, 853333.3 6518979.7, 853378.1 6518984.2, 853460.9 6518992.4, 853684.6 6519014.8, 853810.2 6519027.3, 853829.2 6519029.1, 854075.2 6519058.5, 854101.3 6519061.2, 854271.5 6519078.6, 854281.2 6519079.6, 854296.9 6519081.3, 854327 6519071.4, 854337.5 6519067.9, 854338.4 6519067.6, 854356.8 6519062.1, 854361 6519060.9, 854369.8 6519060.2, 854377.2 6519059.6, 854418.4 6519078.5, 854426.8 6519078.8, 854431.8 6519078.9, 854456.8 6519069, 854471.3 6519062.1, 854485.1 6519053.3, 854494.4 6519046.5, 854504.4 6519041.5, 854513.6 6519038.9, 854521 6519035.6, 854527.6 6519030.8, 854534.1 6519024.9, 854537.1 6519020.2, 854542.4 6519009.8, 854544.6 6519006.4, 854549.6 6519008.5, 854550.9 6519006.7, 854556.7 6519001, 854559.6 6518996.6, 854563.4 6518980.1, 854562.7 6518975.9, 854564.6 6518976.5, 854565.5 6518974.2, 854568.2 6518962.4, 854582.3 6518937.4, 854596.7 6518916, 854611.7 6518890.6, 854638.5 6518848, 854660.9 6518822.2, 854684.5 6518796.1, 854696 6518786.6, 854698.2 6518786.8, 854746.1 6518794.9, 854806.1 6518708.6, 854810.8 6518699, 854823.9 6518704.9, 854825.8 6518706.3, 854865.5 6518726.2, 854868.2 6518727.6, 854881.9 6518735.3, 854950.5 6518654.1, 855030.6 6518535.7, 855031.9 6518533.9, 855043 6518518.9, 855048.9 6518511, 855098.5 6518444, 855097.1 6518443.4, 855089.1 6518354.7, 855083.7 6518296.2, 855071 6518260.6, 854992.6 6518040.9, 854960.2 6518043.3, 854940 6518046, 854924.6 6518048.8, 854874.8 6518059.5, 854828.9 6518067.7, 854805.9 6518073.4, 854789.3 6518078.8, 854771.1 6518084, 854758.8 6518088.5, 854744.6 6518095.7, 854736.5 6518100.5, 854634.6 6517948.2, 854588.5 6517879.4, 854569.2 6517850.5, 854501 6517752, 854474.2 6517713.2, 854465 6517700, 854305.4 6517472.8, 854292.5 6517454.4, 854205.6 6517329.1, 854118.6 6517203.9, 854031.7 6517078.6, 854018.4 6517059.5, 853996.8 6517028.7, 853992.1 6517018.7, 853982.2 6517007.3, 853981.3 6517005.9, 853957.6 6516966.6, 853940.7 6516938.5, 853908.1 6516884.4, 853867.5 6516816.8, 853859.1 6516770.6, 853845.3 6516685.1, 853843.1 6516661.7, 853828.2 6516575.3, 853823 6516545.4, 853819.5 6516524.8, 853813.8 6516492, 853811.3 6516477.9, 853795.8 6516387.3, 853783.9 6516358.7, 853753.2 6516286.5, 853720.1 6516200.9, 853708.1 6516167.7, 853687.5 6516103.2, 853665.7 6516027.3, 853646.5 6515949.4, 853632.8 6515884.2, 853616.8 6515816.7, 853605.2 6515776, 853601.6 6515763.8, 853598.1 6515752.1, 853584.3 6515707, 853540.4 6515551.1, 853492.9 6515381.9, 853442.2 6515373.6, 853412.9 6515368.7, 853402.1 6515366.9, 853358.4 6515359.7, 853219.3 6515336.7, 853194.3 6515332.5, 853134.5 6515322.8, 853056.4 6515309.8, 853022.4 6515304.2, 853014.2 6515282.9, 852998.7 6515242.3, 852990.8 6515227, 852981.1 6515202.1, 852864.8 6515254.3, 852812 6515278, 852789.7 6515277.4, 852725 6515306.3, 852658.8 6515335.7, 852607.7 6515358.3, 852603.1 6515361.3, 852599.5 6515363.7, 852597.1 6515366, 852595.5 6515367.3, 852515.5 6515399.7, 852512.2 6515401.1, 852446.8 6515430.4, 852430.8 6515437.4, 852401.7 6515450.4, 852376.1 6515461.8, 852319.3 6515487.1, 852297.5 6515496.9, 852279.4 6515504.9, 852264 6515511.7, 852243.4 6515520.9, 852222.6 6515530.2, 852164.7 6515556.1, 852153 6515561.3, 852149.3 6515563, 852144.2 6515563.3, 852138.5 6515565.4, 852110.4 6515579.3, 852048.3 6515607.6, 852019.5 6515618.9, 852013.3 6515620.2, 852008.5 6515622, 851997.6 6515626.1, 851971.3 6515637.3, 851955.3 6515645.3, 851943.5 6515649.9, 851922.8 6515660.5, 851863.2 6515687.6, 851786.7 6515720.6, 851686.1 6515763.1, 851637.2 6515783.8, 851602.7 6515798.4, 851470.3 6515854.2, 851466.1 6515854.4, 851420.3 6515856, 851336.1 6515859, 851292.4 6515860.6, 851228.9 6515862.8, 851185.9 6515864.4, 851057.8 6515869.5, 851037.6 6515870.3, 850915.4 6515875.3, 850879.8 6515876.7, 850869.4 6515877.1, 850844.6 6515878.1, 850806.3 6515879.7, 850760.3 6515881.5, 850652.2 6515885.9, 850621.1 6515887.2, 850603 6515887.9)))


Inactive hide details for "Nicolas F. [via OrbisGIS]" ---28/01/2015 11:20:48---Hi, Seems that there is incorrect geometries as "Nicolas F. [via OrbisGIS]" ---28/01/2015 11:20:48---Hi, Seems that there is incorrect geometries as input, maybe overlapping

From: "Nicolas F. [via OrbisGIS]" <[hidden email]>
To: Rodolphe <[hidden email]>,
Date: 28/01/2015 11:20
Subject: Re: Trouble with ST_TRIGRID




Hi,

Seems that there is incorrect geometries as input, maybe overlapping polygons. If can not reproduce the error on my side so I can not be of much help.

-Nicolas
Atelier SIG
IRSTV FR CNRS 2488



If you reply to this email, your message will be added to the discussion below:
http://orbisgis.3871844.n2.nabble.com/Trouble-with-ST-TRIGRID-tp7575219p7575220.html 
To unsubscribe from Trouble with ST_TRIGRID, click here.
NAML 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Nicolas F.
Administrator
Can you post the SQL commands please.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Rodolphe

BR_TriGrid3D(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'H_FINAL', 'roads_src','DB_M','G_def', 'alt_def', 2000,50,1.5,0,75,2,1,0.23); (or BR_TriGrid(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'roads_src','DB_M','G_def', 2000,50,1.5,0,75,2,1,0.23);

I have also tried to put the geometry directly in the command. It is uglier but I have the same error. calc_def only contain one geometry. Since I have succeeded with a simple geometry as said in the post, the problem can only comes from this geometry (or my command to call it :x).


Inactive hide details for "Nicolas F. [via OrbisGIS]" ---28/01/2015 11:50:00---Can you post the SQL commands please. __________"Nicolas F. [via OrbisGIS]" ---28/01/2015 11:50:00---Can you post the SQL commands please. _______________________________________________

From: "Nicolas F. [via OrbisGIS]" <[hidden email]>
To: Rodolphe <[hidden email]>,
Date: 28/01/2015 11:50
Subject: Re: Trouble with ST_TRIGRID





Can you post the SQL commands please.



If you reply to this email, your message will be added to the discussion below:
http://orbisgis.3871844.n2.nabble.com/Trouble-with-ST-TRIGRID-tp7575219p7575222.html 
To unsubscribe from Trouble with ST_TRIGRID, click here.
NAML 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Nicolas F.
Administrator

BR_TRIGRID noise calculation area is only a box. Then this should be done:


create table trilvl as select BR_TriGrid3D((select ST_ENVELOPE(the_geom) from calc_def LIMIT 1), 'buildings_def', 'H_FINAL', 'roads_src','DB_M','G_def', 'alt_def', 750,50,1.5,0,150,2,1,0.23); (or BR_TriGrid(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'roads_src','DB_M','G_def', 2000,50,1.5,0,75,2,1,0.23);

The problematic geometries should be in buildings_def table.

750m of maximum propagation distance is sufficient. And 150 m² of max triangle area is good for a first try also.

Le 2015-01-28 11:57, Rodolphe [via OrbisGIS] a écrit :

 

 

BR_TriGrid3D(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'H_FINAL', 'roads_src','DB_M','G_def', 'alt_def', 2000,50,1.5,0,75,2,1,0.23); (or BR_TriGrid(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'roads_src','DB_M','G_def', 2000,50,1.5,0,75,2,1,0.23);

I have also tried to put the geometry directly in the command. It is uglier but I have the same error. calc_def only contain one geometry. Since I have succeeded with a simple geometry as said in the post, the problem can only comes from this geometry (or my command to call it :x).

 

 

-- 
Nicolas Fortin IRSTV FR CNRS 2488 GIS http://orbisgis.org Spatial DB http://h2gis.org Noise http://noisemap.orbisgis.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Rodolphe

Ok perfect :) (I did not find this condition (area is only a box) in the description, maybe it can be good to add it for others ?).

Thanks a lot !



Inactive hide details for "Nicolas F. [via OrbisGIS]" ---28/01/2015 13:15:04---  BR_TRIGRID noise calculation area is only a bo"Nicolas F. [via OrbisGIS]" ---28/01/2015 13:15:04---  BR_TRIGRID noise calculation area is only a box. Then this should be

From: "Nicolas F. [via OrbisGIS]" <[hidden email]>
To: Rodolphe <[hidden email]>,
Date: 28/01/2015 13:15
Subject: Re: Trouble with ST_TRIGRID





BR_TRIGRID noise calculation area is only a box. Then this should be done:


create table trilvl as select BR_TriGrid3D((select ST_ENVELOPE(the_geom) from calc_def LIMIT 1), 'buildings_def', 'H_FINAL', 'roads_src','DB_M','G_def', 'alt_def', 750,50,1.5,0,150,2,1,0.23); (or BR_TriGrid(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'roads_src','DB_M','G_def', 2000,50,1.5,0,75,2,1,0.23);

The problematic geometries should be in buildings_def table.

750m of maximum propagation distance is sufficient. And 150 m² of max triangle area is good for a first try also.

Le 2015-01-28 11:57, Rodolphe [via OrbisGIS] a écrit :

 

 


    BR_TriGrid3D(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'H_FINAL', 'roads_src','DB_M','G_def', 'alt_def', 2000,50,1.5,0,75,2,1,0.23); (or BR_TriGrid(st_geomfromtext(select the_geom from calc_def), 'buildings_def', 'roads_src','DB_M','G_def', 2000,50,1.5,0,75,2,1,0.23);

    I have also tried to put the geometry directly in the command. It is uglier but I have the same error. calc_def only contain one geometry. Since I have succeeded with a simple geometry as said in the post, the problem can only comes from this geometry (or my command to call it :x).

 

 
​
--
Nicolas Fortin
IRSTV FR CNRS 2488
GIS        
http://orbisgis.org
Spatial DB
http://h2gis.org
Noise      
http://noisemap.orbisgis.org




If you reply to this email, your message will be added to the discussion below:
http://orbisgis.3871844.n2.nabble.com/Trouble-with-ST-TRIGRID-tp7575219p7575224.html 
To unsubscribe from Trouble with ST_TRIGRID, click here.
NAML 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Rodolphe
In reply to this post by Nicolas F.
Last time I had some problem with the geometry input of BR_TriGrid3D. This function only works on square geometries. Without any input, the function takes the smallest square including my whole geometry. Sadly, my area of calculation is far from being a square. So, I am losing a lot of time to calculate sound propagation in area I am not interesting in… Is there an elegant solution to minimise the area of calculation (cutting the complex geometry in little squares then regroup them at the end )?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Nicolas F.
Administrator

Hi Rodolphe,

If you are talking about the final noise map polygons, it uses the bounding box of the first argument. Currently this is complicated to fine tuning this area of computation.

Regards,

-Nicolas

Le 2015-02-19 13:12, Rodolphe [via OrbisGIS] a écrit :

Last time I had some problem with the geometry input of BR_TriGrid3D. This function only works on square geometries. Without any input, the function takes the smallest square including my whole geometry. Sadly, my area of calculation is far from being a square. So, I am losing a lot of time to calculate sound propagation in area I am not interesting in… Is there an elegant solution to minimise the area of calculation (cutting the complex geometry in little squares then regroup them at the end )?

-- 
Nicolas Fortin IRSTV FR CNRS 2488 GIS http://orbisgis.org Spatial DB http://h2gis.org Noise http://noisemap.orbisgis.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with ST_TRIGRID

Rodolphe
I have only succeeded to use BR_TriGrid3D with no geometry at all (but the map is larger than my zone of interest) or with a very small square (around 1/300th of my zone of interest). When I take the smaller square includind my zone of interest, I have always the same error:

ERROR [Thread-700] (ExecuteScriptProcess.java:160) - We should already be on this event pointorg.jdelaunay.delaunay.ConstrainedMesh.forceConstraintIntegrity(ConstrainedMesh.java:917)

I have tried this :

create table tri_lvl_calc as SELECT * from
BR_TriGrid3D((select ST_ENVELOPE(the_geom) from gip_calc LIMIT 1), 'buildings_def', 'H_FINAL', 'roads_src','DB_M','G_def', 'alt_def', 750,50,1.5,0,150,0,0,0.23);

And this (applyind directly the geometry):

BR_TriGrid3D(st_geomfromtext('POLYGON ((850244.7 6515202.1, 850244.7 6519081.3, 855098.5 6519081.3, 855098.5 6515202.1, 850244.7 6515202.1))'), 'buildings_def', 'H_FINAL', 'roads_src','DB_M','G_def', 'alt_def', 750,50,1.5,0,150,0,0,0.23);

I have the same mistake in both examples (which is not a surprise because it is exactly the same geometry input). I do not understand because this input geometry is a square.

When I calculated tri_lvl on the full geometry, the map was cut by BR_TriGrid3D in 16 squares. Maybe I try to process a too large area ?
Loading...