Receive email notifications by changing your settings.
Click on your picture in the top right corner, go to Preferences and select your notification preferences.
Thank you for contributing to our forum!
Please keep in mind:
1. To only comment on the topic where the discussion is about. Do you have a new question or topic? Please start a new discussion.
2. Be kind to other users!

Water balace

Hi,

Is it possible to acces the Water balance in the API? And if yes, what would be the URL. I am especially interested in the Sewer Out External.


Tagged:

Comments

  • Hi @Ward van Laatum ,

    Yes it is possible to access the water balance via the API on the Preview.

    Go to the Tools tab > then click on API overview > Content items and then at the bottom click on Water values.

    Here you will see the contents of the water balance panel listed.

    Tygron support team

  • Hey @Godelief,

    Thank you, found it. But as usual I have a follow-up question. I'd like to have SEWEROUTEXTERNAL for a specific area. Is this possible? Or how would I calculate it?

    I used the default value for the SEWERPUMPSPEED (0). And I kind of assumed there was no water leaving the sewer at all.

  • Hi @Ward van Laatum ,

    Not sure if I understand your question correctly, but you can also find the Sewer Out External also in the water balance panel, so you don't have to calculate it. Is this an answer to your question?



    Tygron support team

  • Hey hey,

    Hmmm no. Sorry, let me explain it better. I start with an area, the area of interest, and i'd like to make a water balance specificly for that area.

    If I understand correctly, the waterbalance in Tygron, it is about the In's and Out's for the entire map or project. And I am only instersted in a specific area.

    So, in the picture below, I'd like to have the sewer_out_external for the area in green.


    I hope this makes more sense.

  • edited February 2021

    Hi Ward,

    The water balance is linked to the calculation area of the Water Overlay (see step 1 op the Water Overlay Wizard).

    There are basically two options:

    1. In step 1 of the Water Overlay Wizard choose as calculation area your area of interest. You can either select the calculation area based on water level areas or on another area (your area of interest). Then the water balance will be specifically for your calculation area.
    2. Other option: if you are only interested in the sewer out external you can also create a sewer area which is your area of interest. Then create a sewer overflow for that sewer area and give it a name. In the water balance you can see the sewer out external with the corresponding name for your area of interest (sewer area).


    Tygron support team

  • Hey Godelief,

    Thank you. I'd prefer your second option for my specific case.

    In my case, the area SEWER..STORAGE doesn't have to match my area of ​​interest (AOI). It may even be that there are within my area of ​​interest several SEWER..STORAGE area's .

    I am thinking of the following solution, but would like to have it verified by you.

    In the area SEWER..STORAGE an OBJECT..FLOW..OUTPUT27 is given. If I am correct, this is a value that indicates how much water is pumped from the sewage system per time step. If I divide this value by the sewer surface of the area SEWER..STPORAGE then I have the amount of water pumped per time step per m². I can now multiply this amount by that part of the area SEWER..STORAGE that is within my area of ​​interest.

    Is my reasoning correct?

    If it is, that is great, but I tried to make this work, and it is so much work. I need to create two grid overlay's based on the landsize where the area is both my area of interest and the Sewer_Storage area. If I get that to work, I need to make a combo-overlay in order to get the difference in m² sewer area. And than, probably best use the API to get the OBJECT..FLOW..OUTPUT27 of the SEWER..STORAGE area. Multiply the difference in m². And that would be the way to go if there is just one SEWER..STORAGE area within my area. If there are several, it becombes even more complicated.

    So, I guess my question is, Tygron is able to calculate a Sewer..Out..Exteral for a specific area as shown in the Water Balance (as given for the Rainfall overlay). How does Tygron do it and is there a shortcut for me to get the same result without all the steps.

    To make it easier (or harder...?), I'd like to use the API for this issue.

    To give you an idea of what I am trying to make, see table below. This is a screenshot of my dashboard where I'd like to present the calculated results for a specific area (aoi).



  • Hi Ward,


    The OBJECT_FLOW_OUTPUT linked to the sewer area is indeed the amount of water that is pumped from the sewer are per timeframe.

    According to your reasoning, maybe you can use the following in your code:

    foreach (sewer area) {

       What is the size of the sewer area?

       What is the output of the sewer area?

       What percentage of overlap does the sewer area has with you AOI? hoeveel procent overlap heeft het rioolgebied met de AOI?

       Output of the sewer area * overlap

    }

    You can use the following query in an Excel for this and provide the output in a way so you can use in in your code:

    SELECT_LANDSIZE_WHERE_AREA_WITH_ATTRIBUTE_IS_AOI_AND_AREA_IS_XA_SEWER_STORAGE


    Is this an answer to your question and is this useful for your use case?

    Tygron support team

  • Hi Godelief,

    I had some time to look into the subject again. First of all, thank you for your answer. Secondly....this is really complicated. I'll write down (and probably later update) how far I got for other users.

    For now I am stuck at step 2. The trouble for me is getting the polygons of the buildings connected to the sewer. The information whether or not a building is connected to a sewer is stored in the function (https://engine.tygron.com/api/session/items/functions/) and not in the ID's (https://engine.tygron.com/api/session/items/buildings/) of the buildings. Probably I would be able to work around this by making a selection of all buildings who are connected to the sewer. But this seems a lot of work.

    In theory:

    Step 1) Get the spatial polygon of the area of interest.

    This is where it all started. Id like to create a waterbalance for a certain area of interest. This could be a neighbourhood for instance.


    Step 2) Get all the spatial polygons of the buildings connected to the sewer.

    This information can be found in the specs of a building (details - Connected to Sewer Area: 1)


    Step 3) Get all the spatial polygons of the sewer areas.

    This could be one area, but in case your area of interest covers a substantial part of the city, this could be multiple sewer areas with different SEWER...PUMP...SPEED's.


    Step 4) Combine these to go get the SEWER_PUMP_SPEED per m² (SEWER_PUMP_SPEED/area buildings connected to the sewer)

    For now ignore buildings that are in two different sewer areas ....This could be the case with roads for instance.


    Step 5) Intersect all spatial polygons of the building on your area of interest.

    This leaves you with just the buildings that are connected to the sewer in your area of interest. You need to intersect since, again, buildings are not limited to your area (for example roads). For every building you now know to which sewer area it belongs and therefore know the SEWER...PUMP...SPEED per m² (Step 4). You also know the m² of these areas.

    Step 6) Calculate the SEWER...PUMP...SPEED.

    This can be done by multiplying the areas m² times the SEWER...PUMP...SPEED/m² (step 4).


    Step 7) Calculate the amount of water pumped

    You can only pump water if there is actual water in the sewer. So I need to know how much water is available in the sewer.


    Step 8) Figure out how much water is available in the sewerarea's per timestep.

    I am going to stop here. This might be possible but I am just not sure. And since I don't know if I can get passed the previous steps (Step 2 and step 4), Ill leave it for now.

  • In a one-on-one session we have hammered out the challenge underpinning this question and the solution to getting the data the user needed.


    To retrieve a sewer's actual dimensions, you need to have to have have the sewer's rasterization. This is the sewer's polygon, intersected with sewered constructions, and then turned into grid cells:

    Add a basetypes result type to your water overlay. All cells with with sewers line up with a value on the base types layer of "4". (You can find this in the basetype overlay's legend). Thus your sewer size is SELECT-LANDSIZE-WHERE-GRIDVALUE-IS-4-AND-GRID-IS-[basetype overlay id]

    Next, you want to intersect that with your area of interest:

    Configure your area of interest to have a defining attribute. For example: "AOI", with a value of 1 (the value doesn't matter). You can then query the amount of sewer in your area of interest by adding a clause to the first query: SELECT-LANDSIZE-WHERE-GRIDVALUE-IS-4-AND-GRID-IS-[basetype overlay id]-AND-AREA-WITH-ATTRIBUTE-IS-AOI

    Finally, not only does the user want to know the size of the sewer, but also the amount which is actually in various water level areas. For any given water level area, that overlap can be retrieved using: SELECT-LANDSIZE-WHERE-GRIDVALUE-IS-4-AND-GRID-IS-[basetype overlay's id]-AND-AREA-WITH-ATTRIBUTE-IS-AOI-AND-AREA-IS-[waterlevel area's id]

    (Two of the same clauses cannot exist in the same query, but AREA-IS and AREA-WITH-ATTRIBUTE-IS are two distinct clauses which can exist together in the same query, even though they both look for Area-based geometry data)



    With the preceding information, the following challenges were resolved by/for the user:

    How much of a sewer is relevant to the user's area of interest? User can retrieve the size of the sewer in full in a water level area, and the size of the sewer intersecting with the area of interest. The latter divided by the former gives a fraction, indicating how much of the sewer is of interest

    How much water is pumped out of a given sewer in a given water level area, in only the area of interest? Retrieve the sewer's OBJECT-FLOW-OUTPUT attribute, and for each value in the array multiply it by the fraction of relevant sewer. Other water is pumped out of the sewer as well, but was not in the area of interest.

    How much water is in the sewers, in the area of interest in any given water level area? Add a "sewer last value" overlay", and rather than consuling the LANDSIZE, consult its GRIDVOLUME. The GRIDVALUE clause can be dropped as it is no longer applicable. Thus: SELECT-GRIDVOLUME-WHERE--GRID-IS-[sewer last value overlay's id]-AND-AREA-WITH-ATTRIBUTE-IS-AOI-AND-AREA-IS-[waterlevel area's id]

Sign In or Register to comment.