There are currently seven web methods on the web service.
The two methods
xmrgAreaMapAccessDbHRAP(..) and
xmrgAreaMapAccessDbLonLat(..) will create an Access database on the server, taking HRAP and longitude-latitude input respectively. The columns in the created databases are in ArcHydro format: OBJECTID, FeatureID, TSTypeID, TSDateTime, TSValue. Object ID is the unique key for the row and may be seeded as any integer value (see method details in
Table 1).
Alternatively, there are two other methods
xmrgAreaMapASCIIHRAP(..) and
xmrgAreaMapASCIILonLat(..) that will store the NEXRAD data into a text file. Each string in the array will be delimited by commas (,) and follow ArcHydro format: FeatureID, TSTypeID, TSDateTime, TSValue.
Whether requesting data in database or text file form, the files are all zipped. Furthermore, all requests should be
asynchronous due to the lengthy processing time for large collections of data. In .NET, this is done by simply adding "ASync" to the end of a method name when you call it. For example,
xmrgAreaMapASCIIHRAPAsync(..).
The user will receive two emails after sending a request: (1) confirming that the request was received, and (2) either a confirmation that the request is ready, or a description of an error if one occurred.
For file transfer, two other methods
GetFileSize(..) and
DownloadChunk(..) can be used to download the file from the server; note that the file should be downloaded in parts and not all at once (see
sample code). Alternatively, the files can be downloaded through a web browser in the path specified in the confirmation email.
The last method
ConvertToHRAP(..) is for utility purposes; it handles the conversion of longitude-latitude coordinates (in decimal degrees) to HRAP coordinates.
Table 1. Method and Parameter Specification
public bool xmrgAreaMapASCIIHRAP(string FileName, string TimeStartStr, string TimeStopStr, int x1, int y1, int x2, int y2, string email)
Creates a text file of NEXRAD data on the server. Returns true if successful, false otherwise, given:
string FileName – desired filename for the text file. DO NOT add file extensions.
string TimeStartStr – string input of starting time, able to be parsed into DateTime format.
string TimeStopStr – string input of ending time, able to be parsed into DateTime format.
int x1, y1, x2, y2 – HRAP coordinates forming a box, in which (x1,y1) is the TOP-LEFT corner and (x2,y2) is the LOWER-RIGHT corner. Make sure x2 > x1 and y2 > y1.
string email – email address to notify when the data is ready.
public bool xmrgAreaMapASCIILonLat(string FileName, string TimeStartStr, string TimeStopStr, double lon1, double lat1, double lon2, double lat2, string email)
Creates a text file of NEXRAD data on the server. Returns true if successful, false otherwise, given:
string FileName – desired filename for the text file. DO NOT add file extensions.
string TimeStartStr – string input of starting time, able to be parsed into DateTime format.
string TimeStopStr – string input of ending time, able to be parsed into DateTime format.
double lon1,lat1,lon2,lat2 – longitude-latitude coordinates (in decimal degrees) forming a box, in which (lon1,lat1) is the LOWER-LEFT corner and (lon2,lat2) is the TOP-RIGHT corner.
string email – email address to notify when the data is ready.
public bool xmrgAreaMapAccessDbHRAP(string FileName, string TimeStartStr, string TimeStopStr, int x1, int y1, int x2, int y2, int inputOID, string email)
Creates an Access database on the NEXRAD server. Returns true if Access database creation is successful,
false otherwise, given:
string FileName – desired filename for the database. DO NOT add file extensions.
string TimeStartStr – string input of starting time, able to be parsed into DateTime format.
string TimeStopStr – string input of ending time, able to be parsed into DateTime format.
int x1, y1, x2, y2 – HRAP coordinates forming a box, in which (x1,y1) is the TOP-LEFT corner and (x2,y2) is the LOWER-RIGHT corner. Make sure x2 > x1 and y2 > y1.
string email – email address to notify when the data is ready.
public bool xmrgAreaMapAccessDbLonLat(string FileName, string TimeStartStr, string TimeStopStr, double lon1, double lat1, double lon2, double lat2, int inputOID, string email)
Creates an Access database on the NEXRAD server. Returns true if Access database creation is successful, false otherwise, given:
string FileName – desired filename for the database. DO NOT add file extensions.
string TimeStartStr – string input of starting time, able to be parsed into DateTime format.
string TimeStopStr – string input of ending time, able to be parsed into DateTime format.
double lon1,lat1,lon2,lat2 – longitude-latitude coordinates (in decimal degrees) forming a box, in which (lon1,lat1) is the LOWER-LEFT corner and (lon2,lat2) is the TOP-RIGHT corner.
string email – email address to notify when the data is ready.
public long GetFileSize(string FileName, bool type)
Returns file size in bytes, given:
string FileName – filename of the database; should be the same as the one in xmrgAreaMapAccessDb(..)
bool type - true for database (*.mdb) file, false for text (*.txt) file
public byte[] DownloadChunk(string FileName, long Offset, int BufferSize, bool type)
Returns an array of bytes of a specified file, given:
string FileName – filename of the database, should be the same as the one in xmrgAreaMapAccessDb(..)
long Offset – offset for which byte of the file to begin at
int BufferSize – size of the buffer, in bytes
bool type - true for database (*.mdb) file, false for text (*.txt) file
public int[] ConvertToHRAP(double lon, double lat)
Returns HRAP-X and HRAP-Y coordinates in an integer array, given:
double lon – longitude in decimal degrees; use negative values if western values
double lat – latitude in decimal degrees
Table 2. Sample C# Client Code