
==== Front
Data Brief
Data Brief
Data in Brief
2352-3409
Elsevier

S2352-3409(24)00804-7
10.1016/j.dib.2024.110840
110840
Data Article
Malaysia's rainfall and Kalumpang agricultural station data for scattered data interpolation
Abdul Karim Samsul Ariffin samsulariffin.karim@ums.edu.my
drsamsul.karim@gmail.com
ab⁎
Tamin Owen c
a Software Engineering Programme, Faculty of Computing and Informatics, Universiti Malaysia Sabah, Jalan UMS, Kota Kinabalu, 88400, Sabah, Malaysia
b Data Technologies and Applications (DaTA) Research Group, Faculty of Computing and Informatics, Universiti Malaysia Sabah, Jalan UMS, Kota Kinabalu, 88400, Sabah, Malaysia
c Faculty of Computing and Informatics, Universiti Malaysia Sabah, Jalan UMS, Kota Kinabalu, 88400, Sabah, Malaysia
⁎ Corresponding author. samsulariffin.karim@ums.edu.mydrsamsul.karim@gmail.com
22 8 2024
10 2024
22 8 2024
56 11084024 7 2024
6 8 2024
8 8 2024
© 2024 The Author(s)
2024
https://creativecommons.org/licenses/by-nc/4.0/ This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).
Scattered data interpolation is an essential technique used in environmental, geospatial and meteorological analysis. It enables the estimation of unknown values within a dataset at the domain by utilising known data points. The utilisation of this method is crucial to generate smooth and continuous surfaces from discrete data, facilitating the creation of more precise models and visualisations of environmental events. The Malaysian rainfall and terrain data introduced in this paper, are essential datasets for these analyses. This paper provides detailed rainfall data from various meteorological stations across Malaysia, sourced from the Department of Irrigation and Drainage Malaysia. Additionally, terrain data for Kalumpang was obtained, which was based on the Agricultural Station in Selangor. These primary datasets are essential for understanding local climatic and topographic variations. However, challenges such as the size of the dataset, time constraints, weather conditions, and difficulties in obtaining data due to sensitivity and confidentiality issues limit the scope of the data collection. Although there are certain limits, the datasets have been carefully processed and prepared to be easily accessible in Microsoft Excel, MATLAB, and Python. This allows for additional research and applications in machine learning. This paper presents raw and pre-processed datasets, enabling comprehensive analyses and advancing scattered data interpolation techniques.

Keywords

Patches
Continuity
Visualization
Surface reconstruction
Environment
Topography
==== Body
pmcSpecifications TableSubject	Mathematics	
Specific subject area	Computational Mathematics. Computer Aided Geometric Design	
Type of data	Raw
Numeric
Figure
Table	
Data collection	The rainfall data samples were collected from various meteorological stations in Malaysia provided by the Department of Irrigation and Drainage Malaysia. The terrain data for Kalumpang were based on the Agricultural Station (30°38′ N, 101°34′E) in Selangor, approximately 90 km northeast of Kuala Lumpur, Malaysia. Both datasets were acquired with permission and underwent preprocessing steps. The rainfall data was sorted based on states in Peninsular Malaysia, providing daily rainfall volumes in millimetres (mm) at eight selected locations. The terrain data for Kalumpang was also sorted into 160 sets. Both datasets were then converted into formats accessible using Microsoft Excel, MATLAB, and Python.	
Data source location	State: Selangor, Perak, Penang, Terrengganu, Kelantan, Kedah, Perlis, Johor
Country: Malaysia	
Data accessibility	Repository name: Rainfall-and-Kalumpang-Malaysia
Data identification number: 10.5281/zenodo.13235113
Direct URL to data: https://github.com/plastic-waste-database/Rainfall-and-Kalumpang-Malaysia	
Related research article	S.A.B.A. Karim, A. Saaban, Visualization terrain data using cubic Ball triangular patches, MATEC Web of Conferences 225 (2018) 06023. https://doi.org/10.1051/matecconf/201822506023.	

1 Value of the Data

• The rainfall data from Malaysia, offers a valuable real-life example for researchers aiming to test and refine scattered data interpolation techniques. These data sets, characterized by their irregular scattering, challenge interpolation algorithms, providing a true test of their robustness and accuracy.

• The rainfall data can be instrumental in improving meteorological predictions. Researchers can use the dataset to develop and test predictive models for rainfall patterns, contributing to more accurate weather forecasting and better preparation for weather-related events.

• The data from the Kalumpang Agricultural Station are crucial for visualizing the station's digital elevation model (DEM), commonly known as terrain data. Researchers can use these data to apply scattered data interpolation techniques to visualize and analyze the terrain, which is essential for agricultural planning, soil erosion studies, and hydrological modelling.

• This dataset can serve as an educational resource for students and professionals in data science and engineering. It provides a practical example for teaching and learning about data interpolation, algorithm comparison, and the handling of real-world data challenges.

2 Background

Accurate rainfall data measurements are essential for predicting water supply, managing flood risks, and ensuring food security [1]. In regions with irregular rainfall patterns, such as Malaysia, this data becomes even more vital. The variability and unpredictability of rainfall in these areas can have significant impacts on agriculture, water management, and disaster preparedness. Rainfall data helps in planning and managing water resources. It is used to predict water availability for drinking water supply, irrigation, and industrial use. Farmers rely on accurate rainfall data to plan their planting and harvesting schedules to reduce the risk of drought and ensure better yields [2]. By analysing rainfall data, authorities can predict and prepare for floods.

Besides rainfall data, terrain data helps in designing efficient irrigation systems [3]. By understanding the land's topography, farmers can plan the layout of irrigation channels and sprinklers to ensure even water distribution, reducing water waste and improving crop yields. Detailed terrain data is crucial for implementing soil conservation practices. Techniques such as contour ploughing and terracing are designed based on topographical information to minimize soil erosion and maintain soil fertility [4]. These two datasets are suitable for scattered data interpolation, aiding in predicting rainfall and terrain data when combined with machine learning approaches.

3 Data Description

The rainfall data was collected from eight states (25 different stations in total) across Peninsular Malaysia from 16th until 18th July 2024 [5]. Table 1 provides the details of the daily rainfall data used in this paper. A common approach to reconstructing real and imbalanced data is using scattered data interpolation, typically employing a triangulation-based method with cubic Bézier triangular basis functions [6]. Fig. 1. shows the Delaunay triangulation of the rainfall data, forming 38 triangles, while Fig. 2. presents the surface reconstruction using cubic Bézier triangular patches.Table 1 Information of the daily rainfall collected from 25 different stations in Peninsular Malaysia.

Table 1Station	Location	Average Rainfall (mm)	
Longitude	Latitude	16/07/2024	17/07/2024	18/07/2024	
Chuping	100.2667	6.4833	18.5	11.0	0.0	
Langkawi Island	99.7333	6.3333	0.5	11.0	0.0	
Alor Setar	100.4000	6.2000	0.5	8.5	0.5	
Butterworth	100.3833	5.4667	0.0	0.0	0.0	
Prai	100.4000	5.3500	0.0	0.0	0.0	
Bayan Lepas	100.2667	5.3000	0.0	0.0	0.0	
Ipoh	101.1000	4.5833	0.0	0.0	0.0	
Cameron Highland	101.3667	4.4667	0.0	0.0	0.0	
Lubok Merbau	100.9000	4.8000	0.0	0.0	0.0	
Sitiawan	100.7000	4.2167	0.0	0.0	0.0	
Subang	101.5500	3.1167	2.0	0.0	0.0	
Petaling Jaya	101.6500	3.1000	1.5	0.0	0.0	
KLIA (Sepang)	101.7000	2.7167	1.5	0.0	0.0	
Melaka	102.2500	2.2667	3.0	0.0	0.0	
Batu Pahat	102.9833	1.8667	1.0	0.0	0.0	
Kluang	103.3100	2.0167	0.0	1.0	0.0	
Senai	103.6667	1.6333	10.0	0.0	0.0	
Kota Bahru	102.2833	6.1667	0.0	0.5	0.0	
Kuala Krai	102.2000	5.5333	0.0	0.0	1.0	
Kuala Terengganu	103.1000	5.3833	0.0	4.5	0.5	
Kuantan	103.2167	3.7833	13.0	0.0	0.0	
Batu Embun	102.3500	3.9667	5.0	0.0	0.0	
Temerloh	102.3833	3.4667	0.0	0.0	0.0	
Muadzam Shah	103.0833	3.0500	0.0	0.0	0.0	
Mersing	103.8333	2.4500	0.0	15.0	0.0	
Note: In our strategy for reconstructing and visualizing the rainfall surface, longitude is represented as the x-coordinate, latitude as the y-coordinate, and average rainfall (mm) as the z-coordinate.

Fig. 1 Delaunay triangulation of rainfall data at 25 stations.

Fig 1

Fig. 2 Surface reconstruction by using cubic Bézier triangular patch for rainfall data.

Fig 2

Table 2 details the terrain data for the Kalumpang terrain in the states of Selangor, comprising 160 sets. Fig. 3. illustrates the Delaunay triangulation of the terrain data, consisting of 269 triangles. Fig. 4. depicts the surface reconstruction of the terrain data using cubic Bézier triangular patches.Table 2 Information of the Kalumpang elevation data collected from the states of Selangor.

Table 2x	y	z	x	y	z	x	y	Z	x	y	z	x	y	z	
0	0	73.7	20	1	82.8	11	3	79.8	2	5	79.6	14	6	84.4	
1	0	73.25	0	2	76.2	12	3	80.4	3	5	79.8	15	6	84.75	
2	0	72.9	1	2	75.8	13	3	80.8	4	5	79.8	16	6	85.2	
3	0	72.25	2	2	75.6	14	3	81.1	5	5	79.9	17	6	85.45	
4	0	72.1	3	2	75.7	15	3	82.2	6	5	80.2	18	6	85.6	
5	0	71.15	4	2	75.5	16	3	82.8	7	5	80.5	19	6	85.8	
6	0	72.15	5	2	75.75	17	3	83.3	8	5	80.95	20	6	86	
7	0	72.25	6	2	75.8	18	3	83.8	9	5	81.4	0	7	81.7	
8	0	72.8	7	2	75.85	19	3	84.25	10	5	81.75	1	7	82.2	
14	0	78.5	8	2	76	20	3	84.6	11	5	82.3	2	7	82.3	
15	0	79	9	2	77	0	4	78.6	12	5	82.8	3	7	82.4	
16	0	79.75	10	2	77.55	1	4	78.45	13	5	83.5	4	7	82.45	
17	0	80.4	11	2	78.4	2	4	78.6	14	5	83.4	5	7	82.6	
18	0	81.2	12	2	80.4	3	4	78.4	15	5	83.9	6	7	82.9	
19	0	81.7	13	2	80.8	4	4	78.4	16	5	84.25	7	7	83.5	
20	0	82.5	14	2	81.6	5	4	78.5	17	5	84.75	8	7	83.4	
0	1	75	15	2	82.2	6	4	78.8	18	5	85.1	9	7	83.8	
1	1	74.6	16	2	82.7	7	4	79.1	19	5	85.4	10	7	84.15	
2	1	74.1	17	2	83.3	8	4	79.6	20	5	85.6	11	7	84.65	
3	1	73.8	18	2	83.8	9	4	80.25	0	6	80.8	12	7	84.7	
4	1	73.7	19	2	84.25	10	4	80.7	1	6	80.85	13	7	85	
5	1	73.75	20	2	84.6	11	4	81.2	2	6	81.15	14	7	85.45	
6	1	73.75	0	3	77.4	12	4	82.8	3	6	81.1	15	7	85.7	
7	1	74.4	1	3	77.25	13	4	83.5	4	6	81.05	16	7	85.9	
8	1	74.7	2	3	77	14	4	83.6	5	6	81.4	17	7	86.1	
12	1	77.5	3	3	76.8	15	4	83.8	6	6	81.4	18	7	86.2	
13	1	78.5	4	3	77	16	4	84.25	7	6	81.6	19	7	86.3	
14	1	79.3	5	3	77.15	17	4	84.75	8	6	82.15	20	7	86.5	
15	1	80.3	6	3	77.25	18	4	85.15	9	6	82.5	14	6	84.4	
16	1	81.6	7	3	77.4	19	4	85.4	10	6	83.15	15	6	84.75	
17	1	81.5	8	3	77.8	20	4	85.1	11	6	83.45				
18	1	82.1	9	3	78	0	5	79.7	12	6	83.7				
19	1	82.75	10	3	79.2	1	5	79.7	13	6	84				
2	5	79.6	11	3	79.8	20	1	82.8	0	0	73.7				

Fig. 3 Delaunay triangulation of Kalumpang terrain data.

Fig 3

Fig. 4 Surface reconstruction by using cubic Bézier triangular patch for Kalumpang terrain data.

Fig 4

4 Experimental Design, Materials and Methods

Fig. 5. illustrates the process of extracting raw rainfall data and Kalumpang terrain data and converting them into five different file formats (.mat, .xlsx, .dif, .txt, .csv). The process begins with the extraction of raw data from input files, followed by data cleaning and preprocessing for both types of data. The cleaned rainfall and Kalumpang terrain data are then saved in each of the specified formats, ensuring compatibility and usability across different platforms and software especially for MATLAB and Python.Fig. 5 Flowchart for preparing proposed data for scattered data interpolation usage.

Fig 5

The rainfall and terrain data, which serve as primary sources, are directly obtained from their respective data providers: the Department of Irrigation and Drainage Malaysia for the rainfall data, and authors Karim and Saaban [7] for the terrain data. Rainfall data samples were collected at 25 meteorological stations across eight states in Peninsular Malaysia sourced from the Department of Irrigation and Drainage Malaysia. Fig. 6. shows the location of the rainfall data across Peninsular Malaysia using Google Map [8]. Conversely, terrain data was based on the Agricultural Station (30°38′ N, 101°34′E) in Selangor, approximately 90 km northeast of Kuala Lumpur, Malaysia. Fig. 7. shows the location of the Kalumpang agricultural using Google Map [8]. This site is used for light agricultural activities and is characterized by local fruit trees, shrubs, and light bushes. The proposed scattered data interpolation based on triangular Bernstein-Bézier patches [6] is designed to apply to any real dataset.Fig. 6 Location of the rainfall data across Peninsular Malaysia using Google Map.

Fig 6

Fig. 7 Location of the Kalumpang agricultural station in the states of Selangor using Google Map.

Fig 7

4.1 Method for scattered data interpolation

This section briefly describes the construction of the scattered data interpolation based on triangulation method used in this study. The method for constructing the surface generated in Fig. 2. and Fig. 4. is primarily based on cubic Bézier triangular patches. The problem of scattered data interpolation can be written as follows:

Given functional 3-Dimensional (3D) data sets:(xi,yi,zi),i=1,2,…,N,

we want to construct a C1 surface z=F(x,y) that satisfiesF(xi,yi)=zi,i=1,2,…,N

Consider the barycentric coordinate (u,v,w) on the triangle T with vertices V1, V2 and V3 which is defined by u+v+w=1, where u,v,w≥ 0 (see Fig. 8). The expression where the point inside the triangle T where V(x,y)∈ R2, can be represented as:V=uV1+uV2+uV3

Fig. 8 Triangle T.

Fig 8

The cubic Bézier triangular patch [9] is defined as:P(u,v,w)=u3b3,0,0+3u2vb2,1,0+3u2wb2,0,1+3uv2b2,2,0+3uw2b1,0,2+v3b0,3,0+3v2wb0,2,1+3uw2b0,1,2+w3b0,0,3+6uvwb1,1,1

The partial derivatives fx(Vi) and fy(Vi) at the vertices (xi,yi),i=1,2,3,…,N of triangle are estimated by using the method proposed by [9]. These partial derivatives are used to find derivative in the direction of εi,i=1,2,3, which is an edge of the triangle that is shown in Fig. 9.Fig. 9 The directional ε1,ε2andε3.

Fig 9

The derivative along the side εi is given by∂f∂εi=(xi−1−xi+1)∂f∂x+(yi−1−yi+1)∂f∂y

The boundary Bézier ordinates are calculated by C1 continuity condition at the vertices of triangle. At each vertex there are two directional derivatives in the direction of both the edges incident at the vertex. To ensure C1 continuity at the vertices of the cubic Bézier triangular patch, the first two cubic boundary Bézier ordinates are calculated asb2,1,0=b3,0,0+13[(x2−x1)fx(V1)+(y2−y1)fy(V1)]

b2,0,1=b3,0,0−13[(x1−x3)fx(V1)+(y1−y3)fy(V1)]

By symmetry, the other four boundary points such as b0,2,1,b1,2,0,b1,0,2, and b0,1,2 can be obtained easily.

The remaining inner Bézier ordinates b1,1,1i,i=1,2,3 is obtained by using the cubic precision method proposed by Foley and Opitz [10]. For complete derivation, the reader can refer to [10]. The final C1 scattered data interpolation scheme by using cubic Bézier triangular patch can be expressed as follow:(1) R(u,v,w)=∑i+j+k=3i=j=k≠1Bi,j,k3(u,v,w)bi,j,k+6uvw(σ1b1,1,11+σ2b1,1,12+σ3b1,1,13)

R(u,v,w)=∑i+j+k=3i=j=k≠1Bi,j,k3(u,v,w)bi,j,k+6uvw(σ1b1,1,11+σ2b1,1,12+σ3b1,1,13)

where(2) σ1=vwuv+vw+wu,σ2=wuuv+vw+wu,σ3=uvuv+vw+wu

The final scheme, as presented in Eq. (1), is referred as the rational corrected scheme of degree seven, featuring a quintic numerator and a quadratic denominator. It is worth noting that another possible convex combination to Eq. (2) is as follows:(3) σ1=v2w2u2v2+v2w2+w2u2,σ2=w2u2u2v2+v2w2+w2u2,σ3=u2v2u2v2+v2w2+w2u2

Limitations

The primary limitation identified in this paper is the size of the dataset. For scattered data interpolation, more extensive and more comprehensive datasets are preferred. However, collecting extensive data is challenging due to time constraints and varying weather conditions. Additionally, obtaining permission to access the data posed significant difficulties, as data sensitivity and confidentiality issues often restrict the availability of detailed information. These factors collectively limited the scope and scale of the dataset used in this study. Furthermore, real-time surface reconstruction via machine learning approach seems very promising.

Ethics Statement

The authors of this paper are aware of the ethical statements of this journal, and they agree with it.

CRediT Author Statement

Conceptualization, Owen Tamin; Data curation, Owen Tamin; Formal analysis, Owen Tamin and Samsul Karim; Funding acquisition, Samsul Karim; Investigation, Owen Tamin; Methodology, Owen Tamin and Samsul Karim; Project administration, Samsul Karim; Software, Owen Tamin and Samsul Karim; Supervision, Samsul Karim; Validation, Owen Tamin and Samsul Karim; Visualization, Owen Tamin and Samsul Karim; Writing – original draft, Owen Tamin; Writing – review & editing, Owen Tamin and Samsul Karim.

Declaration of Competing Interest

The authors declare no conflict of interest.

Data Availability

Rainfall-and-Kalumpang-Malaysia (Original data) (github).

Acknowledgements

This research was fully supported by Ministry of Higher Education (MOHE) of Malaysia through Fundamental Research Grant Scheme [FRGS/1/2023/ICT06/UMS/02/1 ] (New Scattered Data Interpolation Scheme Using Quasi Cubic Triangular Patches for RGB Image Interpolation) and Universiti Malaysia Sabah. Special thanks to the Faculty of Computing and Informatics, Universiti Malaysia Sabah for the tremendous computing facilities support.
==== Refs
References

1 Rezapour M. Baldock T.E. Classification of hurricane hazards: the importance of rainfall Weather Forecast. 29 2014 1319 1331 10.1175/WAF-D-14-00014.1
2 Guido Z. Zimmer A. Lopus S. Hannah C. Gower D. Waldman K. Krell N. Sheffield J. Caylor K. Evans T. Farmer forecasts: impacts of seasonal rainfall expectations on agricultural decision-making in Sub-Saharan Africa Clim. Risk Manage 30 2020 100247 10.1016/j.crm.2020.100247
3 Akramkhanov A. Martius C. Park S.J. Hendrickx J.M. Environmental factors of spatial distribution of soil salinity on flat irrigated terrain Geoderma 163 2011 55 62 10.1016/j.geoderma.2011.04.001
4 Saggau P. Kuhwald M. Duttmann R. Effects of contour farming and tillage practices on soil erosion processes in a hummocky watershed. A model-based case study highlighting the role of tramline tracks Catena 228 2023 107126 10.1016/j.catena.2023.107126
5 Malaysia Department of Irrigation and Drainage, Public InfoBanjir, https://publicinfobanjir.water.gov.my/hujan/?lang=en.
6 Farin G. Triangular bernstein-bézier patches Comput. Aided. Geom. Des. 3 2 1986 83 127 10.1016/0167-8396(86)90016-6
7 Karim S.A.B.A. Saaban A. Visualization terrain data using cubic Ball triangular patches MATEC Web of Conferences 225 2018 06023 10.1051/matecconf/201822506023
8 Google, Google Maps, https://maps.google.com, accessed on 20th June 2024.
9 Goodman T.N.T. Said H.B. A C1 triangular interpolant suitable for scattered data interpolation Commun. Appl. Numer. Methods 7 6 1991 479 485 10.1002/cnm.1630070608
10 Foley T.A. Opitz K. Hybrid cubic Bézier triangle patches Mathematical Methods in Computer Aided Geometric Design II 1992 Academic Press 275 286 10.1016/B978-0-12-460510-7.50024-0
