The new ENgetcoord function

Hi,

I have started to go over the new functions added to the DLL.

It seems that the function ENgetcoord does not work. Poking around the code I found that the COORDS section is not being read by the Toolkit among with the labels, tags, vertices and the backdrop sections as the “data in these sections are not used for any computations” (input2.c line 302)

Am I missing something?

Elad, if you un-comment line 124 here, then the code will actually load the coordinates so you can fetch them using the API function. This line is commented since the x,y coordinates are not important for a straightforward hydraulic analysis and loading all the coords takes time. I’ve found better success loading using a separate utility which can also re-project the coordinates into lon-lat.

Sam, reading the coordinates in the netsize function is very strange. I have un-commented line 124 (and 125) but the ENgetcoord function still returns zeros - does it work for you? I have looked at the addcoord function which is called from line 124 and I’m not sure the coordinates are saved.

From my point of view, the DLL should enable the user to load, and use, all the data from the INP file. Maybe a separate function just to load the coordinates before they can be accessed.

BTW, the header of the addcoord function is probably wrong:
**-------------------------------------------------------------
** Input: id = curve ID label
** Output: returns error code
** Purpose: adds a new curve to the database
**--------------------------------------------------------------

I’ve sent this issue to https://github.com/OpenWaterAnalytics/EPANET/issues/10