watex.site.Profile#
- class watex.site.Profile(*, utm_zone=None, coordinate_system=None, datum='WGS84', epsg=None, reference_ellipsoid=23)[source]#
Profile class deals with the positions collected in the survey area.
In principle, there is no exact solution between longitude/latitude to x/y coordinates. Indeed, there is no isometric map from the sphere to the plane. when you convert lon/lat coordinates from the sphere to x/y coordinates in the plane, we cannot hope that all lengths will be preserved by this operation. Therefore, we have to accept some kind of deformation. For smallish parts of earth’s surface, transverse Mercator is quite common.
By default, we use
xfor longitude andyfor latitude. This is useful when data is passed as longitude-latitude (ll) or degree-minutes- seconds (dms) in the fit method.- Parameters:
utm_zone (Optional, string) – zone number and ‘S’ or ‘N’ e.g. ‘55S’. Default to the centre point of coordinates points in the survey area. It should be a string (##N or ##S) in the form of number and North or South hemisphere, 10S or 03N
coordinate_system (str, ['utm'|'dms'|'ll']) – The coordinate system in which the data points for the profile is collected. If not given, the auto-detection will be triggered and find the suitable coordinate system. However, it is recommended to provide it for consistency. Note that if x and y are composed of value less than 180 degrees for longitude and 90 degrees for latitude, it should be considered as longitude-latitude (
ll) coordinates system. If x and y are degree-minutes-second (dmsordd:mm:ss) data, they must be specify as coordinate system in order to accept the non-numerical data before transforming toll. Ifdatais passed to thefit()method anddmsis not specify, x and y values should be discarded.datum (string, default = 'WGS84') – well known datum ex. WGS84, NAD27, NAD83, etc.
epsg (Optional, int) –
- epsg number defining projection (
see http://spatialreference.org/ref/ for moreinfo)
Overrides utm_zone if both are provided. or https://epsg.io/?q=China%20kind%3APROJCRS
reference_ellipsoid (int, default=23) – reference ellipsoids is derived from Peter H. Dana’s website- http://www.utexas.edu/depts/grg/gcraft/notes/datum/elist.html Department of Geography, University of Texas at Austin Internet: pdana@mail.utexas.edu . Default is
23constrained to WGS84.
Examples
>>> from watex.datasets import load_edis >>> from watex.site import Profile >>> xy = load_edis (samples =17 , as_frame =True , key ='latitude longitude') >>> xy.head (2) longitude latitude 0 110.485833 26.051390 1 110.486153 26.051794 >>> pro= Profile ().fit( xy.longitude, xy.latitude) >>> pro.distance () 62.890276656978244 >>> pro.bearing () 35.4252016495945 >>> pro.make_xy_coordinates( ) (array([110.48583316, 110.48615319, 110.48647322, 110.48679325, 110.48711328, 110.48743331, 110.48775334]), array([26.05138954, 26.05179371, 26.05219788, 26.05260205, 26.05300622, 26.05341038, 26.05381455]))