You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+31-13Lines changed: 31 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,15 @@
1
-
# geospatial - PHP Geospatial Extension
1
+
=====================================
2
+
geospatial - PHP Geospatial Extension
3
+
=====================================
2
4
3
-
PHP Extension to handle common geospatial functions. The extension currently has implementations of the haversine and vincenty's formulas as well as a helmert transfomation function.
5
+
PHP Extension to handle common geospatial functions. The extension currently
6
+
has implementations of the Haversine and Vincenty's formulas as well as a
@@ -12,23 +18,29 @@ PHP Extension to handle common geospatial functions. The extension currently has
12
18
make
13
19
sudo make install
14
20
15
-
Then add the extension to an ini file e.g. /etc/php.ini
21
+
Then add the extension to an ini file e.g. /etc/php.ini::
16
22
17
23
extension = geospatial.so
18
24
19
-
## Usage
25
+
Usage
26
+
=====
20
27
21
-
The extension makes use of the geojson standard format for specying points as co-ordinates. One important thing to note about this format is that points are specied longitude **first** i.e. longitude, latitude.
28
+
The extension makes use of the GeoJSON standard format for specifying points as
29
+
co-ordinates. One important thing to note about this format is that points are
30
+
specified longitude **first** i.e. longitude, latitude.
22
31
23
-
e.g.
32
+
e.g.::
24
33
25
34
$greenwichObservatory = array(
26
35
'type' => 'Point',
27
36
'coordinates' => array( -0.001483 , 51.477917);
28
37
);
29
38
30
39
31
-
### Haversine
40
+
Haversine
41
+
---------
42
+
43
+
::
32
44
33
45
$from = array(
34
46
'type' => 'Point',
@@ -41,9 +53,12 @@ e.g.
41
53
var_dump(haversine($to, $from));
42
54
43
55
44
-
### Vincenty's Formula
56
+
Vincenty's Formula
57
+
------------------
45
58
46
-
Vincenty's formula attempts to provide a more acurate distance between two points than the Haversine formula. Whereas the Haversine formula assumes a spherical earth the Vincenty method models the earth as an ellipsoid.
59
+
Vincenty's formula attempts to provide a more accurate distance between two
60
+
points than the Haversine formula. Whereas the Haversine formula assumes a
61
+
spherical earth the Vincenty method models the earth as an ellipsoid::
47
62
48
63
$flinders = array(
49
64
'type' => 'Point',
@@ -56,9 +71,12 @@ Vincenty's formula attempts to provide a more acurate distance between two point
56
71
var_dump(vincenty($flinders, $buninyong));
57
72
58
73
59
-
### Helmert Transformation
74
+
Helmert Transformation
75
+
----------------------
60
76
61
-
The Helmert transformation allows for the transfomation of points between different datums. It can for instance be used to convert between the WGS84 ellipsoid used by GPS systems and OSGB36 used by ordnance survey in the UK.
77
+
The Helmert transformation allows for the transformation of points between
78
+
different datums. It can for instance be used to convert between the WGS84
79
+
ellipsoid used by GPS systems and OSGB36 used by ordnance survey in the UK::
0 commit comments