HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of...

23
HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008

Transcript of HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of...

Page 1: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

HOW TO IMPORT DATA TO SOBEK

Created by: Vu Minh TueNational University of Singapore

With help of Nguyen Hoang HuyTeam blue

RED TEAM

INCHEON 2008

Page 2: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

Objectives

• In order to import network data (manholes, pipes, nodes) to SOBEK, MOUSE has been used as an intermediate model that imports data from excel file and exports to Svk19 (Scandinavian Exchange Format ), which is the importable file for SOBEK

Page 3: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

INPUT FILES:

• Excel file: “Import data into MOUSE” from Hydroasia website

• Cross-section file: provided“Incheon_CRS.MEX”• Please refer to the “Import_to_MOUSE.ppt”to know how to import data into MOUSEhttp://www.hydroasia.org/jahia/Jahia/cache/offonce/lang/en/pid/9691

Page 4: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROCEDURE

• After importing data to MOUSE

• Project\Export…\Export text files and choose option: “GeometryTXT(svk19)”

• Press “Execute” and choose the name to export. For example: “Incheon.txt”

• Done, now you no longer use MOUSE anymore!!! Close it

Page 5: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROCEDURE

• Open SOBEK and choose New Project• Enter name: ex “Incheon”• Choose Case\New\ then 3 blocks will

appear in yellow• This manual only deals with the

block “import network”• Double click on“import network”

Page 6: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROCEDURE

• Choose option “Import Suf-HYD” network and press OK

• Keep the default value in the table

Page 7: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROCEDURE

• Browse to the file exported in Svk19 format “Incheon.txt” and press OK.

• Click No for HGF requirement

• Select blank for the District code, and press OK

Page 8: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROCEDURE

• Importing DONE• Not difficult? Not yet… come on to

experience our problem

Page 9: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS

• Thing is not easy with the stubborn input file and so is this case.

• After finishing importing data to Sobek, we realize that there are some problems with the network data:– Some nodes are not connected in order – The storage and bottom area for

manholes have default value, i.e 100 and it’s very difficult to input those values for more than 2600 nodes manually.

Page 10: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS - Analysed

• Problems are analysed and finally we figure out that all the faults are blamed for MOUSE.

• Since when MOUSE exports data to Svk19 format, the Node IDs are limited to 7 characters only. If the node ID’s name exceeds 7 characters then it will be taken out the first 7 characters from that long name

i.e: PM0218675 => PM02186

Page 11: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS - Analysed

• So there will be some nodes having the same IDs.

• Whilst the links are kept unchanged, the links will connect to wrong nodes.

=> First problem solved.

Page 12: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS - Analysed

• Second problem is the default storage area for all manhole. The task block import Suf-HYD does not provide us any option to import storage area to manholes, so we need to do it manually or by programming. Here, I write some small codes to do it.

• Thanks to God that Sobek has an option to copy and paste tabular data and here we go. The platform using is excel

Page 13: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Input file

• From the excel file “Import data into Mouse”, change the name for the whole workbook (3 sheets: catchment, node and link) with following criterias:– PM0xxxxxx axxxxxx– M0xxxxxx bxxxxxx– M1xxxxxx cxxxxxxBy doing this, all the Node IDs will have

maximum 7 characters and will not be cut when exporting to svk19 file

Page 14: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS - Import

• Now the input file is created.• Do import this file into MOUSE and

export to SVK19 file.• Using Sobek to import this file.• The network now is the best with

perfect links and nodes.

Page 15: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area

In order to match the area in catchment tab in excel file with the storage area of the manhole in Sobek, we use a simple macro code, written by me. This module can be downloaded from this link:

http://www.hydroasia.org/jahia/Jahia/cache/offonce/lang/en/pid/9691

Page 16: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area

Open a blank excel file, go to:Tool\Macro\Visual Basic EditorThe Microsoft Visual Basic window

appearsSelect File\Import File and browse to the

downloaded module.Close this window.

Page 17: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area

Open Sobek and open the netter of Incheon region.

Select\Select by rectangleDrag the cross pointer to surround all the

network. Right click at the selected area and choose Model data\Flow model

Page 18: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area

- Multiple Data editor window appears- On the left panel of the window, select

from the tree:Flow-Manhole with runoff\ManholeClick on ID, the whole table is selected

press Edit\Copy

Page 19: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area- Now the data in this table is copied. - Paste to excel- In the “import data to MOUSE.xls”, choose tab

catchment- List the value of “LOCATION” column in AtoZ

order- Copy all the data in this worksheet- Paste to cells (K,6) on the same worksheet that

was pasted the data from Sobek- And ??? What do we do. Let’s see the most

important part

Page 20: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area

- Sample is displayed below:

Page 21: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area

- Select Tool\Macro\Macro- PERSONAL.xls!Incheon_couple_Sobek_

MOUSE- Wait for 1 minute for the program to run- The result will appear in column J.- Note that result is in “ha”, you will need

to multiply this value with 10,000 to convert to m2.

- Copy this column and paste back to the table in Sobek.

Page 22: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

PROBLEMS – Storage area

- The sample of the final file is also uploaded to our webpage. Come and download it at:

- http://www.hydroasia.org/jahia/Jahia/cache/offonce/lang/en/pid/9691

Page 23: HOW TO IMPORT DATA TO SOBEK Created by: Vu Minh Tue National University of Singapore With help of Nguyen Hoang Huy Team blue RED TEAM INCHEON 2008.

All thing done, phew!!!

Good luck