pynetdesign.modelling.io.global2local#

pynetdesign.modelling.io.global2local(latY, lonX, refLat=None, refLon=None)[source]#

Converts global latitude and longitude coordinates to Cartesian coordinates under a simple spherical Earth approximation.

Parameters:
latYnumpy.ndarray

An array of latitude coordinates in degrees.

lonXnumpy.ndarray

An array of longitude coordinates in degrees.

refLatfloat, optional

The reference latitude for the local coordinate system. If not provided, the average of the input latitude coordinates will be used.

refLonfloat, optional

The reference longitude for the local coordinate system. If not provided, the average of the input longitude coordinates will be used.

Returns:
x_local_coordslist

A list of local x coordinates in meters.

y_local_coordslist

A list of local y coordinates in meters.

refLatfloat

The reference latitude used for the local coordinate system.

refLonfloat

The reference longitude used for the local coordinate system.

Examples

>>> latY = np.array([37.7749, 34.0522, 40.7128])
>>> lonX = np.array([-122.4194, -118.2437, -74.0060])
>>> x_local_coords, y_local_coords, refLat, refLon = global2local(latY, lonX)