INP File Coordinates - type of data

I am brand new to epanet and any related software.

I read in the inp documentation that coordinate values are only relative to each other and do not represent any real world measures.

However rather than being between zero and one, I see in some files various high values. Is there another part of the file that indicates the coordinate boundaries? E.g. x lowest 7, highest 22, y… or do you just iterate to find?

Additionally it’s been mentioned that the coordinates can also be British ordinance survey values. I didn’t see this option in the format documents. Is there some kind of formal header data that indicates how to read different parts of the file such as coordinates, how can I identify which type, assuming coordinates can be different?

Is inp solely British, like os (I think)? Or can the coordinates be what ever you want and how does the format show which?

I am aiming at lat/long for my particular presentational needs and this would of course be possible with ordinance survey.

I tried to search for an answer first. Apologies if I missed something or if my question belies some fundamental misunderstanding, it’s early days for me.

Thanks.

Have you had a chance to read through how the Input File is broken into different sections and also specifically about the coordinate section?

The coordinate section is optional and only used by the GUI to help display the location of nodes on a map. As per the below, the coordinates can be any unit of measure, but I’m not certain about using lat/lngs.

  1. The coordinates represent the distance from the node to an arbitrary origin at the lower left of the network. Any convenient units of measure for this distance can be used.

Are you reading the INP file manually or using the EPANET toolkit? If you’re reading it manually you need to look for the headers such as [COORDINATES]. If you are using the toolkit, they this will be done automatically for you when you load an INP file, you can then use API calls such as EN_getcoord() to retrieve the coordinate of each node.

Using lat/lon coordinates doesn’t work well because the INP serializer truncates decimal precision. So if you save the INP file from the GUI, you will end up with a mess. What I’ve seen mostly is that INP files will use a projected coordinate system, like a state plane or survey in feet or meters. The software was not meant as a GIS tool, but it can display the position of elements with respect to each other which is useful for visualization. If you only have a data set in lat/lon, then other GIS tools like QGIS or GDAL can help move between coordinate systems.

1 Like

@samhatchett if I’m not mistaken, the coordinates are not truncated in version 2.2. This was fixed.

oh, great - is that also true for the 2.2 GUI?

Yes, I was referring to the GUI.

Using DLL we get X, Y with a maximum of 4 decimals. But on GUI I think is two.

@Mariosmsk I just checked with a freshly downloaded version and it seems to save the coordinates with all decimals. However, I see that the map units are set to Degrees. For other units it doesn’t work :frowning:
image

1 Like

Appologies, I think my question may have been badly worded or probably already clear in the documentation. My question is about the INP file format.

I think I’m just confirming really that there is definitely nothing in the INP file format that can be used to say what the unit of measure is, either a measure field/row or some custom data field/row.

I guess, if needed, a unit of measure would have to be specified to any software by the user each time they load the file, right?

Thanks.