Geolocation Coordinates
GeolocationCoordinates
Bases: ABC
The coordinates of a geographic location, in one coordinate reference system.
Use one of the subclasses: GeographicCRS84, ProjectedLV95 or ProjectedLV03.
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/geolocation.py
11 12 13 14 15 16 17 18 19 | |
GeographicCRS84
Bases: GeolocationCoordinates
Coordinates in WGS84, with the longitude first (CRS84).
Attributes:
| Name | Type | Description |
|---|---|---|
longitude |
Any
|
between -180 and 180 |
latitude |
Any
|
between -90 and 90 |
Examples:
coordinates = xmllib.GeographicCRS84.create_new(longitude="8.550", latitude="47.37")
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/geolocation.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
create_new
Creates new coordinates in CRS84. Pass the coordinates as strings to preserve their decimal precision: a float drops trailing zeroes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
longitude
|
Any
|
the longitude, between -180 and 180 |
required |
latitude
|
Any
|
the latitude, between -90 and 90 |
required |
Returns:
| Type | Description |
|---|---|
GeographicCRS84
|
The coordinates |
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/geolocation.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
ProjectedLV95
Bases: GeolocationCoordinates
Coordinates in the Swiss coordinate system LV95.
Attributes:
| Name | Type | Description |
|---|---|---|
easting |
Any
|
between 2484273.3 and 2837939.88 |
northing |
Any
|
between 1073150.16 and 1299970.97 |
Examples:
coordinates = xmllib.ProjectedLV95.create_new(easting="2600000", northing="1200000")
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/geolocation.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
create_new
Creates new coordinates in LV95. Pass the coordinates as strings to preserve their decimal precision: a float drops trailing zeroes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
easting
|
Any
|
the easting |
required |
northing
|
Any
|
the northing |
required |
Returns:
| Type | Description |
|---|---|
ProjectedLV95
|
The coordinates |
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/geolocation.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
ProjectedLV03
Bases: GeolocationCoordinates
Coordinates in the old Swiss coordinate system LV03.
Attributes:
| Name | Type | Description |
|---|---|---|
easting |
Any
|
between 484273.3 and 837939.88 |
northing |
Any
|
between 73150.16 and 299970.97 |
Examples:
coordinates = xmllib.ProjectedLV03.create_new(easting="600000", northing="200000")
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/geolocation.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
create_new
Creates new coordinates in LV03. Pass the coordinates as strings to preserve their decimal precision: a float drops trailing zeroes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
easting
|
Any
|
the easting |
required |
northing
|
Any
|
the northing |
required |
Returns:
| Type | Description |
|---|---|
ProjectedLV03
|
The coordinates |
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/geolocation.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |