mirror of
https://0xacab.org/radar/radar-wp.git
synced 2025-04-22 15:56:31 +02:00
Initial import.
This commit is contained in:
commit
86383280c9
428 changed files with 68738 additions and 0 deletions
11462
vendor/phayes/geophp/tests/input/20120702.gpx
vendored
Normal file
11462
vendor/phayes/geophp/tests/input/20120702.gpx
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
vendor/phayes/geophp/tests/input/an_empty_polygon.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/an_empty_polygon.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
POLYGON EMPTY
|
219
vendor/phayes/geophp/tests/input/barret_spur.gpx
vendored
Normal file
219
vendor/phayes/geophp/tests/input/barret_spur.gpx
vendored
Normal file
|
@ -0,0 +1,219 @@
|
|||
<gpx creator="GPS Visualizer http://www.gpsvisualizer.com/" version="1.0">
|
||||
<wpt lat="45.44283" lon="-121.72904"><ele>1374</ele><name>Vista Ridge Trailhead</name><sym>Trail Head</sym></wpt>
|
||||
<wpt lat="45.41000" lon="-121.71349"><ele>1777</ele><name>Wy'East Basin</name></wpt>
|
||||
<wpt lat="45.41124" lon="-121.70404"><ele>1823</ele><name>Dollar Lake</name></wpt>
|
||||
<wpt lat="45.39260" lon="-121.69937"><ele>2394</ele><name>Barrett Spur</name><sym>Summit</sym></wpt>
|
||||
<trk>
|
||||
<name>Barrett Spur 1</name>
|
||||
<trkseg>
|
||||
<trkpt lat="45.4431641" lon="-121.7295456"></trkpt>
|
||||
<trkpt lat="45.4428615" lon="-121.7290800"></trkpt>
|
||||
<trkpt lat="45.4425697" lon="-121.7279085"></trkpt>
|
||||
<trkpt lat="45.4424274" lon="-121.7267360"></trkpt>
|
||||
<trkpt lat="45.4422017" lon="-121.7260429"></trkpt>
|
||||
<trkpt lat="45.4416576" lon="-121.7252347"></trkpt>
|
||||
<trkpt lat="45.4406144" lon="-121.7241181"></trkpt>
|
||||
<trkpt lat="45.4398193" lon="-121.7224890"></trkpt>
|
||||
<trkpt lat="45.4387649" lon="-121.7226112"></trkpt>
|
||||
<trkpt lat="45.4383933" lon="-121.7224328"></trkpt>
|
||||
<trkpt lat="45.4377850" lon="-121.7224159"></trkpt>
|
||||
<trkpt lat="45.4372204" lon="-121.7226603"></trkpt>
|
||||
<trkpt lat="45.4347837" lon="-121.7226007"></trkpt>
|
||||
<trkpt lat="45.4332000" lon="-121.7216480"></trkpt>
|
||||
<trkpt lat="45.4334576" lon="-121.7223143"></trkpt>
|
||||
<trkpt lat="45.4321730" lon="-121.7222102"></trkpt>
|
||||
<trkpt lat="45.4316609" lon="-121.7219974"></trkpt>
|
||||
<trkpt lat="45.4303068" lon="-121.7220616"></trkpt>
|
||||
<trkpt lat="45.4270753" lon="-121.7209685"></trkpt>
|
||||
<trkpt lat="45.4267610" lon="-121.7211872"></trkpt>
|
||||
<trkpt lat="45.4260133" lon="-121.7212623"></trkpt>
|
||||
<trkpt lat="45.4257683" lon="-121.7214738"></trkpt>
|
||||
<trkpt lat="45.4257400" lon="-121.7217762"></trkpt>
|
||||
<trkpt lat="45.4259485" lon="-121.7226009"></trkpt>
|
||||
<trkpt lat="45.4249972" lon="-121.7223672"></trkpt>
|
||||
<trkpt lat="45.4246035" lon="-121.7219816"></trkpt>
|
||||
<trkpt lat="45.4238682" lon="-121.7219830"></trkpt>
|
||||
<trkpt lat="45.4226721" lon="-121.7216494"></trkpt>
|
||||
<trkpt lat="45.4224120" lon="-121.7217998"></trkpt>
|
||||
<trkpt lat="45.4211497" lon="-121.7218767"></trkpt>
|
||||
<trkpt lat="45.4193319" lon="-121.7208650"></trkpt>
|
||||
<trkpt lat="45.4186435" lon="-121.7202956"></trkpt>
|
||||
<trkpt lat="45.4185934" lon="-121.7200745"></trkpt>
|
||||
<trkpt lat="45.4178963" lon="-121.7196035"></trkpt>
|
||||
<trkpt lat="45.4171101" lon="-121.7198115"></trkpt>
|
||||
<trkpt lat="45.4166827" lon="-121.7193250"></trkpt>
|
||||
<trkpt lat="45.4161855" lon="-121.7190778"></trkpt>
|
||||
<trkpt lat="45.4159291" lon="-121.7193146"></trkpt>
|
||||
<trkpt lat="45.4153644" lon="-121.7193939"></trkpt>
|
||||
<trkpt lat="45.4151268" lon="-121.7191578"></trkpt>
|
||||
<trkpt lat="45.4148071" lon="-121.7191043"></trkpt>
|
||||
<trkpt lat="45.4146310" lon="-121.7187962"></trkpt>
|
||||
<trkpt lat="45.4142524" lon="-121.7187236"></trkpt>
|
||||
<trkpt lat="45.4142844" lon="-121.7185595"></trkpt>
|
||||
<trkpt lat="45.4133520" lon="-121.7180429"></trkpt>
|
||||
<trkpt lat="45.4131406" lon="-121.7181383"></trkpt>
|
||||
<trkpt lat="45.4130356" lon="-121.7179036"></trkpt>
|
||||
<trkpt lat="45.4118436" lon="-121.7168789"></trkpt>
|
||||
<trkpt lat="45.4109205" lon="-121.7156569"></trkpt>
|
||||
<trkpt lat="45.4104523" lon="-121.7145250"></trkpt>
|
||||
<trkpt lat="45.4104930" lon="-121.7143814"></trkpt>
|
||||
<trkpt lat="45.4102075" lon="-121.7140608"></trkpt>
|
||||
<trkpt lat="45.4099806" lon="-121.7134527"></trkpt>
|
||||
</trkseg>
|
||||
<trkseg>
|
||||
<trkpt lat="45.4099792" lon="-121.7134610"></trkpt>
|
||||
<trkpt lat="45.4091489" lon="-121.7134937"></trkpt>
|
||||
<trkpt lat="45.4086133" lon="-121.7132504"></trkpt>
|
||||
<trkpt lat="45.4080616" lon="-121.7127670"></trkpt>
|
||||
<trkpt lat="45.4076426" lon="-121.7126047"></trkpt>
|
||||
<trkpt lat="45.4075043" lon="-121.7122301"></trkpt>
|
||||
<trkpt lat="45.4070652" lon="-121.7118980"></trkpt>
|
||||
<trkpt lat="45.4068712" lon="-121.7114766"></trkpt>
|
||||
<trkpt lat="45.4067987" lon="-121.7108634"></trkpt>
|
||||
<trkpt lat="45.4064528" lon="-121.7106934"></trkpt>
|
||||
<trkpt lat="45.4057286" lon="-121.7110326"></trkpt>
|
||||
<trkpt lat="45.4056813" lon="-121.7108280"></trkpt>
|
||||
<trkpt lat="45.4055566" lon="-121.7109216"></trkpt>
|
||||
<trkpt lat="45.4047244" lon="-121.7093884"></trkpt>
|
||||
<trkpt lat="45.4039059" lon="-121.7083824"></trkpt>
|
||||
<trkpt lat="45.4037176" lon="-121.7077738"></trkpt>
|
||||
<trkpt lat="45.4034533" lon="-121.7074489"></trkpt>
|
||||
<trkpt lat="45.4026499" lon="-121.7071945"></trkpt>
|
||||
<trkpt lat="45.4019737" lon="-121.7067004"></trkpt>
|
||||
<trkpt lat="45.4018086" lon="-121.7067477"></trkpt>
|
||||
<trkpt lat="45.4014084" lon="-121.7063918"></trkpt>
|
||||
<trkpt lat="45.4013177" lon="-121.7059701"></trkpt>
|
||||
<trkpt lat="45.4011965" lon="-121.7058914"></trkpt>
|
||||
<trkpt lat="45.4010688" lon="-121.7053257"></trkpt>
|
||||
<trkpt lat="45.4008116" lon="-121.7054978"></trkpt>
|
||||
<trkpt lat="45.4006075" lon="-121.7053495"></trkpt>
|
||||
<trkpt lat="45.4005546" lon="-121.7054856"></trkpt>
|
||||
<trkpt lat="45.3991622" lon="-121.7049765"></trkpt>
|
||||
<trkpt lat="45.3985560" lon="-121.7042976"></trkpt>
|
||||
<trkpt lat="45.3981831" lon="-121.7042260"></trkpt>
|
||||
<trkpt lat="45.3973151" lon="-121.7036992"></trkpt>
|
||||
<trkpt lat="45.3967974" lon="-121.7036370"></trkpt>
|
||||
<trkpt lat="45.3963985" lon="-121.7033742"></trkpt>
|
||||
<trkpt lat="45.3945456" lon="-121.7029688"></trkpt>
|
||||
<trkpt lat="45.3920595" lon="-121.7015918"></trkpt>
|
||||
<trkpt lat="45.3907614" lon="-121.7012029"></trkpt>
|
||||
<trkpt lat="45.3906454" lon="-121.7010483"></trkpt>
|
||||
<trkpt lat="45.3906726" lon="-121.7008185"></trkpt>
|
||||
<trkpt lat="45.3909774" lon="-121.7008263"></trkpt>
|
||||
<trkpt lat="45.3911315" lon="-121.7004300"></trkpt>
|
||||
<trkpt lat="45.3909963" lon="-121.6998193"></trkpt>
|
||||
<trkpt lat="45.3908688" lon="-121.6997923"></trkpt>
|
||||
<trkpt lat="45.3917895" lon="-121.6994679"></trkpt>
|
||||
<trkpt lat="45.3926205" lon="-121.6994847"></trkpt>
|
||||
<trkpt lat="45.3925915" lon="-121.6992485"></trkpt>
|
||||
<trkpt lat="45.3928117" lon="-121.6995661"></trkpt>
|
||||
</trkseg>
|
||||
</trk>
|
||||
<trk>
|
||||
<name>Barrett Spur 2</name>
|
||||
<trkseg>
|
||||
<trkpt lat="45.3928201" lon="-121.6995658"></trkpt>
|
||||
<trkpt lat="45.3935449" lon="-121.6998805"></trkpt>
|
||||
<trkpt lat="45.3937897" lon="-121.6997710"></trkpt>
|
||||
<trkpt lat="45.3941789" lon="-121.6999492"></trkpt>
|
||||
<trkpt lat="45.3942372" lon="-121.7001375"></trkpt>
|
||||
<trkpt lat="45.3946353" lon="-121.6999452"></trkpt>
|
||||
<trkpt lat="45.3953599" lon="-121.7005823"></trkpt>
|
||||
<trkpt lat="45.3957081" lon="-121.7006533"></trkpt>
|
||||
<trkpt lat="45.3964324" lon="-121.7016813"></trkpt>
|
||||
<trkpt lat="45.3965766" lon="-121.7016905"></trkpt>
|
||||
<trkpt lat="45.3969060" lon="-121.7028225"></trkpt>
|
||||
<trkpt lat="45.3968739" lon="-121.7033856"></trkpt>
|
||||
<trkpt lat="45.3974854" lon="-121.7040597"></trkpt>
|
||||
<trkpt lat="45.3986110" lon="-121.7044455"></trkpt>
|
||||
<trkpt lat="45.3993308" lon="-121.7050832"></trkpt>
|
||||
<trkpt lat="45.4006454" lon="-121.7055117"></trkpt>
|
||||
<trkpt lat="45.4017924" lon="-121.7049952"></trkpt>
|
||||
<trkpt lat="45.4028690" lon="-121.7048065"></trkpt>
|
||||
<trkpt lat="45.4055213" lon="-121.7056599"></trkpt>
|
||||
<trkpt lat="45.4055606" lon="-121.7058477"></trkpt>
|
||||
</trkseg>
|
||||
<trkseg>
|
||||
<trkpt lat="45.4055556" lon="-121.7058619"></trkpt>
|
||||
<trkpt lat="45.4057016" lon="-121.7055424"></trkpt>
|
||||
<trkpt lat="45.4064672" lon="-121.7058247"></trkpt>
|
||||
<trkpt lat="45.4065550" lon="-121.7056490"></trkpt>
|
||||
<trkpt lat="45.4081392" lon="-121.7055042"></trkpt>
|
||||
<trkpt lat="45.4084785" lon="-121.7052201"></trkpt>
|
||||
<trkpt lat="45.4089125" lon="-121.7053029"></trkpt>
|
||||
<trkpt lat="45.4097597" lon="-121.7050730"></trkpt>
|
||||
<trkpt lat="45.4098359" lon="-121.7049047"></trkpt>
|
||||
<trkpt lat="45.4101859" lon="-121.7049419"></trkpt>
|
||||
<trkpt lat="45.4109946" lon="-121.7045409"></trkpt>
|
||||
<trkpt lat="45.4110654" lon="-121.7040909"></trkpt>
|
||||
<trkpt lat="45.4113353" lon="-121.7039421"></trkpt>
|
||||
<trkpt lat="45.4119105" lon="-121.7047169"></trkpt>
|
||||
<trkpt lat="45.4120297" lon="-121.7046115"></trkpt>
|
||||
<trkpt lat="45.4123835" lon="-121.7049762"></trkpt>
|
||||
<trkpt lat="45.4125020" lon="-121.7053677"></trkpt>
|
||||
<trkpt lat="45.4134357" lon="-121.7051916"></trkpt>
|
||||
<trkpt lat="45.4135832" lon="-121.7046182"></trkpt>
|
||||
<trkpt lat="45.4139565" lon="-121.7044171"></trkpt>
|
||||
<trkpt lat="45.4140658" lon="-121.7041636"></trkpt>
|
||||
<trkpt lat="45.4145098" lon="-121.7041176"></trkpt>
|
||||
<trkpt lat="45.4141414" lon="-121.7043045"></trkpt>
|
||||
<trkpt lat="45.4141558" lon="-121.7050125"></trkpt>
|
||||
<trkpt lat="45.4136095" lon="-121.7071948"></trkpt>
|
||||
<trkpt lat="45.4126067" lon="-121.7080044"></trkpt>
|
||||
<trkpt lat="45.4122181" lon="-121.7088539"></trkpt>
|
||||
<trkpt lat="45.4124283" lon="-121.7092346"></trkpt>
|
||||
<trkpt lat="45.4119295" lon="-121.7101625"></trkpt>
|
||||
<trkpt lat="45.4124117" lon="-121.7104037"></trkpt>
|
||||
<trkpt lat="45.4122553" lon="-121.7107970"></trkpt>
|
||||
<trkpt lat="45.4116919" lon="-121.7107601"></trkpt>
|
||||
<trkpt lat="45.4116619" lon="-121.7110571"></trkpt>
|
||||
<trkpt lat="45.4113536" lon="-121.7114942"></trkpt>
|
||||
<trkpt lat="45.4114186" lon="-121.7117619"></trkpt>
|
||||
<trkpt lat="45.4110215" lon="-121.7125886"></trkpt>
|
||||
<trkpt lat="45.4106014" lon="-121.7125816"></trkpt>
|
||||
<trkpt lat="45.4104916" lon="-121.7129590"></trkpt>
|
||||
<trkpt lat="45.4102544" lon="-121.7130066"></trkpt>
|
||||
<trkpt lat="45.4099714" lon="-121.7134279"></trkpt>
|
||||
</trkseg>
|
||||
<trkseg>
|
||||
<trkpt lat="45.4099747" lon="-121.7134529"></trkpt>
|
||||
<trkpt lat="45.4110685" lon="-121.7158641"></trkpt>
|
||||
<trkpt lat="45.4121873" lon="-121.7171940"></trkpt>
|
||||
<trkpt lat="45.4131063" lon="-121.7179663"></trkpt>
|
||||
<trkpt lat="45.4146646" lon="-121.7186587"></trkpt>
|
||||
<trkpt lat="45.4147872" lon="-121.7190281"></trkpt>
|
||||
<trkpt lat="45.4153143" lon="-121.7192079"></trkpt>
|
||||
<trkpt lat="45.4153716" lon="-121.7193714"></trkpt>
|
||||
<trkpt lat="45.4164891" lon="-121.7190904"></trkpt>
|
||||
<trkpt lat="45.4172221" lon="-121.7196833"></trkpt>
|
||||
<trkpt lat="45.4179416" lon="-121.7195244"></trkpt>
|
||||
<trkpt lat="45.4185782" lon="-121.7197987"></trkpt>
|
||||
<trkpt lat="45.4193540" lon="-121.7207025"></trkpt>
|
||||
<trkpt lat="45.4214007" lon="-121.7218387"></trkpt>
|
||||
<trkpt lat="45.4226606" lon="-121.7215644"></trkpt>
|
||||
<trkpt lat="45.4247590" lon="-121.7218690"></trkpt>
|
||||
<trkpt lat="45.4249036" lon="-121.7221738"></trkpt>
|
||||
<trkpt lat="45.4259458" lon="-121.7225690"></trkpt>
|
||||
<trkpt lat="45.4257020" lon="-121.7216118"></trkpt>
|
||||
<trkpt lat="45.4260738" lon="-121.7212258"></trkpt>
|
||||
<trkpt lat="45.4272087" lon="-121.7208974"></trkpt>
|
||||
<trkpt lat="45.4277253" lon="-121.7209468"></trkpt>
|
||||
<trkpt lat="45.4283981" lon="-121.7213890"></trkpt>
|
||||
<trkpt lat="45.4288768" lon="-121.7213453"></trkpt>
|
||||
<trkpt lat="45.4301857" lon="-121.7219605"></trkpt>
|
||||
<trkpt lat="45.4312165" lon="-121.7219340"></trkpt>
|
||||
<trkpt lat="45.4334856" lon="-121.7222528"></trkpt>
|
||||
<trkpt lat="45.4331572" lon="-121.7216508"></trkpt>
|
||||
<trkpt lat="45.4336070" lon="-121.7217366"></trkpt>
|
||||
<trkpt lat="45.4350551" lon="-121.7225997"></trkpt>
|
||||
<trkpt lat="45.4371233" lon="-121.7226122"></trkpt>
|
||||
<trkpt lat="45.4378561" lon="-121.7223631"></trkpt>
|
||||
<trkpt lat="45.4387304" lon="-121.7225545"></trkpt>
|
||||
<trkpt lat="45.4397525" lon="-121.7223926"></trkpt>
|
||||
<trkpt lat="45.4407832" lon="-121.7243251"></trkpt>
|
||||
<trkpt lat="45.4422796" lon="-121.7260896"></trkpt>
|
||||
<trkpt lat="45.4428882" lon="-121.7291117"></trkpt>
|
||||
<trkpt lat="45.4431708" lon="-121.7295917"></trkpt>
|
||||
</trkseg>
|
||||
</trk>
|
||||
</gpx>
|
915
vendor/phayes/geophp/tests/input/big_n_ugly.kml
vendored
Normal file
915
vendor/phayes/geophp/tests/input/big_n_ugly.kml
vendored
Normal file
|
@ -0,0 +1,915 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kml xmlns="http://www.opengis.net/kml/2.2">
|
||||
<Document>
|
||||
<name>KML Samples</name>
|
||||
<open>1</open>
|
||||
<description>Unleash your creativity with the help of these examples!</description>
|
||||
<Style id="downArrowIcon">
|
||||
<IconStyle>
|
||||
<Icon>
|
||||
<href>http://maps.google.com/mapfiles/kml/pal4/icon28.png</href>
|
||||
</Icon>
|
||||
</IconStyle>
|
||||
</Style>
|
||||
<Style id="globeIcon">
|
||||
<IconStyle>
|
||||
<Icon>
|
||||
<href>http://maps.google.com/mapfiles/kml/pal3/icon19.png</href>
|
||||
</Icon>
|
||||
</IconStyle>
|
||||
<LineStyle>
|
||||
<width>2</width>
|
||||
</LineStyle>
|
||||
</Style>
|
||||
<Style id="transPurpleLineGreenPoly">
|
||||
<LineStyle>
|
||||
<color>7fff00ff</color>
|
||||
<width>4</width>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>7f00ff00</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="yellowLineGreenPoly">
|
||||
<LineStyle>
|
||||
<color>7f00ffff</color>
|
||||
<width>4</width>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>7f00ff00</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="thickBlackLine">
|
||||
<LineStyle>
|
||||
<color>87000000</color>
|
||||
<width>10</width>
|
||||
</LineStyle>
|
||||
</Style>
|
||||
<Style id="redLineBluePoly">
|
||||
<LineStyle>
|
||||
<color>ff0000ff</color>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>ffff0000</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="blueLineRedPoly">
|
||||
<LineStyle>
|
||||
<color>ffff0000</color>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>ff0000ff</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="transRedPoly">
|
||||
<LineStyle>
|
||||
<width>1.5</width>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>7d0000ff</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="transBluePoly">
|
||||
<LineStyle>
|
||||
<width>1.5</width>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>7dff0000</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="transGreenPoly">
|
||||
<LineStyle>
|
||||
<width>1.5</width>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>7d00ff00</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="transYellowPoly">
|
||||
<LineStyle>
|
||||
<width>1.5</width>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>7d00ffff</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Style id="noDrivingDirections">
|
||||
<BalloonStyle>
|
||||
<text><![CDATA[
|
||||
<b>$[name]</b>
|
||||
<br /><br />
|
||||
$[description]
|
||||
]]></text>
|
||||
</BalloonStyle>
|
||||
</Style>
|
||||
<Folder>
|
||||
<name>Placemarks</name>
|
||||
<description>These are just some of the different kinds of placemarks with
|
||||
which you can mark your favorite places</description>
|
||||
<LookAt>
|
||||
<longitude>-122.0839597145766</longitude>
|
||||
<latitude>37.42222904525232</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-148.4122922628044</heading>
|
||||
<tilt>40.5575073395506</tilt>
|
||||
<range>500.6566641072245</range>
|
||||
</LookAt>
|
||||
<Placemark>
|
||||
<name>Simple placemark</name>
|
||||
<description>Attached to the ground. Intelligently places itself at the
|
||||
height of the underlying terrain.</description>
|
||||
<Point>
|
||||
<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
|
||||
</Point>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Floating placemark</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Floats a defined distance above the ground.</description>
|
||||
<LookAt>
|
||||
<longitude>-122.0839597145766</longitude>
|
||||
<latitude>37.42222904525232</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-148.4122922628044</heading>
|
||||
<tilt>40.5575073395506</tilt>
|
||||
<range>500.6566641072245</range>
|
||||
</LookAt>
|
||||
<styleUrl>#downArrowIcon</styleUrl>
|
||||
<Point>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<coordinates>-122.084075,37.4220033612141,50</coordinates>
|
||||
</Point>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Extruded placemark</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Tethered to the ground by a customizable
|
||||
"tail"</description>
|
||||
<LookAt>
|
||||
<longitude>-122.0845787421525</longitude>
|
||||
<latitude>37.42215078737763</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-148.4126684946234</heading>
|
||||
<tilt>40.55750733918048</tilt>
|
||||
<range>365.2646606980322</range>
|
||||
</LookAt>
|
||||
<styleUrl>#globeIcon</styleUrl>
|
||||
<Point>
|
||||
<extrude>1</extrude>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<coordinates>-122.0857667006183,37.42156927867553,50</coordinates>
|
||||
</Point>
|
||||
</Placemark>
|
||||
</Folder>
|
||||
<Folder>
|
||||
<name>Styles and Markup</name>
|
||||
<visibility>0</visibility>
|
||||
<description>With KML it is easy to create rich, descriptive markup to
|
||||
annotate and enrich your placemarks</description>
|
||||
<LookAt>
|
||||
<longitude>-122.0845787422371</longitude>
|
||||
<latitude>37.42215078726837</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-148.4126777488172</heading>
|
||||
<tilt>40.55750733930874</tilt>
|
||||
<range>365.2646826292919</range>
|
||||
</LookAt>
|
||||
<styleUrl>#noDrivingDirections</styleUrl>
|
||||
<Document>
|
||||
<name>Highlighted Icon</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Place your mouse over the icon to see it display the new
|
||||
icon</description>
|
||||
<LookAt>
|
||||
<longitude>-122.0856552124024</longitude>
|
||||
<latitude>37.4224281311035</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>0</heading>
|
||||
<tilt>0</tilt>
|
||||
<range>265.8520424250024</range>
|
||||
</LookAt>
|
||||
<Style id="highlightPlacemark">
|
||||
<IconStyle>
|
||||
<Icon>
|
||||
<href>http://maps.google.com/mapfiles/kml/paddle/red-stars.png</href>
|
||||
</Icon>
|
||||
</IconStyle>
|
||||
</Style>
|
||||
<Style id="normalPlacemark">
|
||||
<IconStyle>
|
||||
<Icon>
|
||||
<href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>
|
||||
</Icon>
|
||||
</IconStyle>
|
||||
</Style>
|
||||
<StyleMap id="exampleStyleMap">
|
||||
<Pair>
|
||||
<key>normal</key>
|
||||
<styleUrl>#normalPlacemark</styleUrl>
|
||||
</Pair>
|
||||
<Pair>
|
||||
<key>highlight</key>
|
||||
<styleUrl>#highlightPlacemark</styleUrl>
|
||||
</Pair>
|
||||
</StyleMap>
|
||||
<Placemark>
|
||||
<name>Roll over this icon</name>
|
||||
<visibility>0</visibility>
|
||||
<styleUrl>#exampleStyleMap</styleUrl>
|
||||
<Point>
|
||||
<coordinates>-122.0856545755255,37.42243077405461,0</coordinates>
|
||||
</Point>
|
||||
</Placemark>
|
||||
</Document>
|
||||
<Placemark>
|
||||
<name>Descriptive HTML</name>
|
||||
<visibility>0</visibility>
|
||||
<description><![CDATA[Click on the blue link!<br><br>
|
||||
Placemark descriptions can be enriched by using many standard HTML tags.<br>
|
||||
For example:
|
||||
<hr>
|
||||
Styles:<br>
|
||||
<i>Italics</i>,
|
||||
<b>Bold</b>,
|
||||
<u>Underlined</u>,
|
||||
<s>Strike Out</s>,
|
||||
subscript<sub>subscript</sub>,
|
||||
superscript<sup>superscript</sup>,
|
||||
<big>Big</big>,
|
||||
<small>Small</small>,
|
||||
<tt>Typewriter</tt>,
|
||||
<em>Emphasized</em>,
|
||||
<strong>Strong</strong>,
|
||||
<code>Code</code>
|
||||
<hr>
|
||||
Fonts:<br>
|
||||
<font color="red">red by name</font>,
|
||||
<font color="#408010">leaf green by hexadecimal RGB</font>
|
||||
<br>
|
||||
<font size=1>size 1</font>,
|
||||
<font size=2>size 2</font>,
|
||||
<font size=3>size 3</font>,
|
||||
<font size=4>size 4</font>,
|
||||
<font size=5>size 5</font>,
|
||||
<font size=6>size 6</font>,
|
||||
<font size=7>size 7</font>
|
||||
<br>
|
||||
<font face=times>Times</font>,
|
||||
<font face=verdana>Verdana</font>,
|
||||
<font face=arial>Arial</font><br>
|
||||
<hr>
|
||||
Links:
|
||||
<br>
|
||||
<a href="http://earth.google.com/">Google Earth!</a>
|
||||
<br>
|
||||
or: Check out our website at www.google.com
|
||||
<hr>
|
||||
Alignment:<br>
|
||||
<p align=left>left</p>
|
||||
<p align=center>center</p>
|
||||
<p align=right>right</p>
|
||||
<hr>
|
||||
Ordered Lists:<br>
|
||||
<ol><li>First</li><li>Second</li><li>Third</li></ol>
|
||||
<ol type="a"><li>First</li><li>Second</li><li>Third</li></ol>
|
||||
<ol type="A"><li>First</li><li>Second</li><li>Third</li></ol>
|
||||
<hr>
|
||||
Unordered Lists:<br>
|
||||
<ul><li>A</li><li>B</li><li>C</li></ul>
|
||||
<ul type="circle"><li>A</li><li>B</li><li>C</li></ul>
|
||||
<ul type="square"><li>A</li><li>B</li><li>C</li></ul>
|
||||
<hr>
|
||||
Definitions:<br>
|
||||
<dl>
|
||||
<dt>Google:</dt><dd>The best thing since sliced bread</dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Centered:<br><center>
|
||||
Time present and time past<br>
|
||||
Are both perhaps present in time future,<br>
|
||||
And time future contained in time past.<br>
|
||||
If all time is eternally present<br>
|
||||
All time is unredeemable.<br>
|
||||
</center>
|
||||
<hr>
|
||||
Block Quote:
|
||||
<br>
|
||||
<blockquote>
|
||||
We shall not cease from exploration<br>
|
||||
And the end of all our exploring<br>
|
||||
Will be to arrive where we started<br>
|
||||
And know the place for the first time.<br>
|
||||
<i>-- T.S. Eliot</i>
|
||||
</blockquote>
|
||||
<br>
|
||||
<hr>
|
||||
Headings:<br>
|
||||
<h1>Header 1</h1>
|
||||
<h2>Header 2</h2>
|
||||
<h3>Header 3</h3>
|
||||
<h3>Header 4</h4>
|
||||
<h3>Header 5</h5>
|
||||
<hr>
|
||||
Images:<br>
|
||||
<i>Remote image</i><br>
|
||||
<img src="http://code.google.com/apis/kml/documentation/googleSample.png"><br>
|
||||
<i>Scaled image</i><br>
|
||||
<img src="http://code.google.com/apis/kml/documentation/googleSample.png" width=100><br>
|
||||
<hr>
|
||||
Simple Tables:<br>
|
||||
<table border="1" padding="1">
|
||||
<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td></tr>
|
||||
<tr><td>a</td><td>b</td><td>c</td><td>d</td><td>e</td></tr>
|
||||
</table>
|
||||
<br>
|
||||
[Did you notice that double-clicking on the placemark doesn't cause the viewer to take you anywhere? This is because it is possible to directly author a "placeless placemark". If you look at the code for this example, you will see that it has neither a point coordinate nor a LookAt element.]]]></description>
|
||||
</Placemark>
|
||||
</Folder>
|
||||
<Folder>
|
||||
<name>Ground Overlays</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Examples of ground overlays</description>
|
||||
<GroundOverlay>
|
||||
<name>Large-scale overlay on terrain</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Overlay shows Mount Etna erupting on July 13th, 2001.</description>
|
||||
<LookAt>
|
||||
<longitude>15.02468937557116</longitude>
|
||||
<latitude>37.67395167941667</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-16.5581842842829</heading>
|
||||
<tilt>58.31228652890705</tilt>
|
||||
<range>30350.36838438907</range>
|
||||
</LookAt>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/etna.jpg</href>
|
||||
</Icon>
|
||||
<LatLonBox>
|
||||
<north>37.91904192681665</north>
|
||||
<south>37.46543388598137</south>
|
||||
<east>15.35832653742206</east>
|
||||
<west>14.60128369746704</west>
|
||||
<rotation>-0.1556640799496235</rotation>
|
||||
</LatLonBox>
|
||||
</GroundOverlay>
|
||||
</Folder>
|
||||
<Folder>
|
||||
<name>Screen Overlays</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Screen overlays have to be authored directly in KML. These
|
||||
examples illustrate absolute and dynamic positioning in screen space.</description>
|
||||
<ScreenOverlay>
|
||||
<name>Simple crosshairs</name>
|
||||
<visibility>0</visibility>
|
||||
<description>This screen overlay uses fractional positioning to put the
|
||||
image in the exact center of the screen</description>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/crosshairs.png</href>
|
||||
</Icon>
|
||||
<overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
|
||||
<screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
|
||||
<rotationXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
|
||||
<size x="0" y="0" xunits="pixels" yunits="pixels"/>
|
||||
</ScreenOverlay>
|
||||
<ScreenOverlay>
|
||||
<name>Absolute Positioning: Top left</name>
|
||||
<visibility>0</visibility>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/top_left.jpg</href>
|
||||
</Icon>
|
||||
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<size x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
</ScreenOverlay>
|
||||
<ScreenOverlay>
|
||||
<name>Absolute Positioning: Top right</name>
|
||||
<visibility>0</visibility>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/top_right.jpg</href>
|
||||
</Icon>
|
||||
<overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<screenXY x="1" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<size x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
</ScreenOverlay>
|
||||
<ScreenOverlay>
|
||||
<name>Absolute Positioning: Bottom left</name>
|
||||
<visibility>0</visibility>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/bottom_left.jpg</href>
|
||||
</Icon>
|
||||
<overlayXY x="0" y="-1" xunits="fraction" yunits="fraction"/>
|
||||
<screenXY x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<size x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
</ScreenOverlay>
|
||||
<ScreenOverlay>
|
||||
<name>Absolute Positioning: Bottom right</name>
|
||||
<visibility>0</visibility>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/bottom_right.jpg</href>
|
||||
</Icon>
|
||||
<overlayXY x="1" y="-1" xunits="fraction" yunits="fraction"/>
|
||||
<screenXY x="1" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<size x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
</ScreenOverlay>
|
||||
<ScreenOverlay>
|
||||
<name>Dynamic Positioning: Top of screen</name>
|
||||
<visibility>0</visibility>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/dynamic_screenoverlay.jpg</href>
|
||||
</Icon>
|
||||
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<size x="1" y="0.2" xunits="fraction" yunits="fraction"/>
|
||||
</ScreenOverlay>
|
||||
<ScreenOverlay>
|
||||
<name>Dynamic Positioning: Right of screen</name>
|
||||
<visibility>0</visibility>
|
||||
<Icon>
|
||||
<href>http://code.google.com/apis/kml/documentation/dynamic_right.jpg</href>
|
||||
</Icon>
|
||||
<overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<screenXY x="1" y="1" xunits="fraction" yunits="fraction"/>
|
||||
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
|
||||
<size x="0" y="1" xunits="fraction" yunits="fraction"/>
|
||||
</ScreenOverlay>
|
||||
</Folder>
|
||||
<Folder>
|
||||
<name>Paths</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Examples of paths. Note that the tessellate tag is by default
|
||||
set to 0. If you want to create tessellated lines, they must be authored
|
||||
(or edited) directly in KML.</description>
|
||||
<Placemark>
|
||||
<name>Tessellated</name>
|
||||
<visibility>0</visibility>
|
||||
<description><![CDATA[If the <tessellate> tag has a value of 1, the line will contour to the underlying terrain]]></description>
|
||||
<LookAt>
|
||||
<longitude>-112.0822680013139</longitude>
|
||||
<latitude>36.09825589333556</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>103.8120432044965</heading>
|
||||
<tilt>62.04855796276328</tilt>
|
||||
<range>2889.145007690472</range>
|
||||
</LookAt>
|
||||
<LineString>
|
||||
<tessellate>1</tessellate>
|
||||
<coordinates> -112.0814237830345,36.10677870477137,0
|
||||
-112.0870267752693,36.0905099328766,0 </coordinates>
|
||||
</LineString>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Untessellated</name>
|
||||
<visibility>0</visibility>
|
||||
<description><![CDATA[If the <tessellate> tag has a value of 0, the line follow a simple straight-line path from point to point]]></description>
|
||||
<LookAt>
|
||||
<longitude>-112.0822680013139</longitude>
|
||||
<latitude>36.09825589333556</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>103.8120432044965</heading>
|
||||
<tilt>62.04855796276328</tilt>
|
||||
<range>2889.145007690472</range>
|
||||
</LookAt>
|
||||
<LineString>
|
||||
<tessellate>0</tessellate>
|
||||
<coordinates> -112.080622229595,36.10673460007995,0
|
||||
-112.085242575315,36.09049598612422,0 </coordinates>
|
||||
</LineString>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Absolute</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Transparent purple line</description>
|
||||
<LookAt>
|
||||
<longitude>-112.2719329043177</longitude>
|
||||
<latitude>36.08890633450894</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-106.8161545998597</heading>
|
||||
<tilt>44.60763714063257</tilt>
|
||||
<range>2569.386744398339</range>
|
||||
</LookAt>
|
||||
<styleUrl>#transPurpleLineGreenPoly</styleUrl>
|
||||
<LineString>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>absolute</altitudeMode>
|
||||
<coordinates> -112.265654928602,36.09447672602546,2357
|
||||
-112.2660384528238,36.09342608838671,2357
|
||||
-112.2668139013453,36.09251058776881,2357
|
||||
-112.2677826834445,36.09189827357996,2357
|
||||
-112.2688557510952,36.0913137941187,2357
|
||||
-112.2694810717219,36.0903677207521,2357
|
||||
-112.2695268555611,36.08932171487285,2357
|
||||
-112.2690144567276,36.08850916060472,2357
|
||||
-112.2681528815339,36.08753813597956,2357
|
||||
-112.2670588176031,36.08682685262568,2357
|
||||
-112.2657374587321,36.08646312301303,2357 </coordinates>
|
||||
</LineString>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Absolute Extruded</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Transparent green wall with yellow outlines</description>
|
||||
<LookAt>
|
||||
<longitude>-112.2643334742529</longitude>
|
||||
<latitude>36.08563154742419</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-125.7518698668815</heading>
|
||||
<tilt>44.61038665812578</tilt>
|
||||
<range>4451.842204068102</range>
|
||||
</LookAt>
|
||||
<styleUrl>#yellowLineGreenPoly</styleUrl>
|
||||
<LineString>
|
||||
<extrude>1</extrude>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>absolute</altitudeMode>
|
||||
<coordinates> -112.2550785337791,36.07954952145647,2357
|
||||
-112.2549277039738,36.08117083492122,2357
|
||||
-112.2552505069063,36.08260761307279,2357
|
||||
-112.2564540158376,36.08395660588506,2357
|
||||
-112.2580238976449,36.08511401044813,2357
|
||||
-112.2595218489022,36.08584355239394,2357
|
||||
-112.2608216347552,36.08612634548589,2357
|
||||
-112.262073428656,36.08626019085147,2357
|
||||
-112.2633204928495,36.08621519860091,2357
|
||||
-112.2644963846444,36.08627897945274,2357
|
||||
-112.2656969554589,36.08649599090644,2357 </coordinates>
|
||||
</LineString>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Relative</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Black line (10 pixels wide), height tracks terrain</description>
|
||||
<LookAt>
|
||||
<longitude>-112.2580438551384</longitude>
|
||||
<latitude>36.1072674824385</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>4.947421249553717</heading>
|
||||
<tilt>44.61324882043339</tilt>
|
||||
<range>2927.61105910266</range>
|
||||
</LookAt>
|
||||
<styleUrl>#thickBlackLine</styleUrl>
|
||||
<LineString>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<coordinates> -112.2532845153347,36.09886943729116,645
|
||||
-112.2540466121145,36.09919570465255,645
|
||||
-112.254734666947,36.09984998366178,645
|
||||
-112.255493345654,36.10051310621746,645
|
||||
-112.2563157098468,36.10108441943419,645
|
||||
-112.2568033076439,36.10159722088088,645
|
||||
-112.257494011321,36.10204323542867,645
|
||||
-112.2584106072308,36.10229131995655,645
|
||||
-112.2596588987972,36.10240001286358,645
|
||||
-112.2610581199487,36.10213176873407,645
|
||||
-112.2626285262793,36.10157011437219,645 </coordinates>
|
||||
</LineString>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Relative Extruded</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Opaque blue walls with red outline, height tracks terrain</description>
|
||||
<LookAt>
|
||||
<longitude>-112.2683594333433</longitude>
|
||||
<latitude>36.09884362144909</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-72.24271551768405</heading>
|
||||
<tilt>44.60855445139561</tilt>
|
||||
<range>2184.193522571467</range>
|
||||
</LookAt>
|
||||
<styleUrl>#redLineBluePoly</styleUrl>
|
||||
<LineString>
|
||||
<extrude>1</extrude>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<coordinates> -112.2656634181359,36.09445214722695,630
|
||||
-112.2652238941097,36.09520916122063,630
|
||||
-112.2645079986395,36.09580763864907,630
|
||||
-112.2638827428817,36.09628572284063,630
|
||||
-112.2635746835406,36.09679275951239,630
|
||||
-112.2635711822407,36.09740038871899,630
|
||||
-112.2640296531825,36.09804913435539,630
|
||||
-112.264327720538,36.09880337400301,630
|
||||
-112.2642436562271,36.09963644790288,630
|
||||
-112.2639148687042,36.10055381117246,630
|
||||
-112.2626894973474,36.10149062823369,630 </coordinates>
|
||||
</LineString>
|
||||
</Placemark>
|
||||
</Folder>
|
||||
<Folder>
|
||||
<name>Polygons</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Examples of polygon shapes</description>
|
||||
<Folder>
|
||||
<name>Google Campus</name>
|
||||
<visibility>0</visibility>
|
||||
<description>A collection showing how easy it is to create 3-dimensional
|
||||
buildings</description>
|
||||
<LookAt>
|
||||
<longitude>-122.084120030116</longitude>
|
||||
<latitude>37.42174011925477</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-34.82469740081282</heading>
|
||||
<tilt>53.454348562403</tilt>
|
||||
<range>276.7870053764046</range>
|
||||
</LookAt>
|
||||
<Placemark>
|
||||
<name>Building 40</name>
|
||||
<visibility>0</visibility>
|
||||
<styleUrl>#transRedPoly</styleUrl>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -122.0848938459612,37.42257124044786,17
|
||||
-122.0849580979198,37.42211922626856,17
|
||||
-122.0847469573047,37.42207183952619,17
|
||||
-122.0845725380962,37.42209006729676,17
|
||||
-122.0845954886723,37.42215932700895,17
|
||||
-122.0838521118269,37.42227278564371,17
|
||||
-122.083792243335,37.42203539112084,17
|
||||
-122.0835076656616,37.42209006957106,17
|
||||
-122.0834709464152,37.42200987395161,17
|
||||
-122.0831221085748,37.4221046494946,17
|
||||
-122.0829247374572,37.42226503990386,17
|
||||
-122.0829339169385,37.42231242843094,17
|
||||
-122.0833837359737,37.42225046087618,17
|
||||
-122.0833607854248,37.42234159228745,17
|
||||
-122.0834204551642,37.42237075460644,17
|
||||
-122.083659133885,37.42251292011001,17
|
||||
-122.0839758438952,37.42265873093781,17
|
||||
-122.0842374743331,37.42265143972521,17
|
||||
-122.0845036949503,37.4226514386435,17
|
||||
-122.0848020460801,37.42261133916315,17
|
||||
-122.0847882750515,37.42256395055121,17
|
||||
-122.0848938459612,37.42257124044786,17 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Building 41</name>
|
||||
<visibility>0</visibility>
|
||||
<styleUrl>#transBluePoly</styleUrl>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -122.0857412771483,37.42227033155257,17
|
||||
-122.0858169768481,37.42231408832346,17
|
||||
-122.085852582875,37.42230337469744,17
|
||||
-122.0858799945639,37.42225686138789,17
|
||||
-122.0858860101409,37.4222311076138,17
|
||||
-122.0858069157288,37.42220250173855,17
|
||||
-122.0858379542653,37.42214027058678,17
|
||||
-122.0856732640519,37.42208690214408,17
|
||||
-122.0856022926407,37.42214885429042,17
|
||||
-122.0855902778436,37.422128290487,17
|
||||
-122.0855841672237,37.42208171967246,17
|
||||
-122.0854852065741,37.42210455874995,17
|
||||
-122.0855067264352,37.42214267949824,17
|
||||
-122.0854430712915,37.42212783846172,17
|
||||
-122.0850990714904,37.42251282407603,17
|
||||
-122.0856769818632,37.42281815323651,17
|
||||
-122.0860162273783,37.42244918858722,17
|
||||
-122.0857260327004,37.42229239604253,17
|
||||
-122.0857412771483,37.42227033155257,17 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Building 42</name>
|
||||
<visibility>0</visibility>
|
||||
<styleUrl>#transGreenPoly</styleUrl>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -122.0857862287242,37.42136208886969,25
|
||||
-122.0857312990603,37.42136935989481,25
|
||||
-122.0857312992918,37.42140934910903,25
|
||||
-122.0856077073679,37.42138390166565,25
|
||||
-122.0855802426516,37.42137299550869,25
|
||||
-122.0852186221971,37.42137299504316,25
|
||||
-122.0852277765639,37.42161656508265,25
|
||||
-122.0852598189347,37.42160565894403,25
|
||||
-122.0852598185499,37.42168200156,25
|
||||
-122.0852369311478,37.42170017860346,25
|
||||
-122.0852643957828,37.42176197982575,25
|
||||
-122.0853239032746,37.42176198013907,25
|
||||
-122.0853559454324,37.421852864452,25
|
||||
-122.0854108752463,37.42188921823734,25
|
||||
-122.0854795379357,37.42189285337048,25
|
||||
-122.0855436229819,37.42188921797546,25
|
||||
-122.0856260178042,37.42186013499926,25
|
||||
-122.085937287963,37.42186013453605,25
|
||||
-122.0859428718666,37.42160898590042,25
|
||||
-122.0859655469861,37.42157992759144,25
|
||||
-122.0858640462341,37.42147115002957,25
|
||||
-122.0858548911215,37.42140571326184,25
|
||||
-122.0858091162768,37.4214057134039,25
|
||||
-122.0857862287242,37.42136208886969,25 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Building 43</name>
|
||||
<visibility>0</visibility>
|
||||
<styleUrl>#transYellowPoly</styleUrl>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -122.0844371128284,37.42177253003091,19
|
||||
-122.0845118855746,37.42191111542896,19
|
||||
-122.0850470999805,37.42178755121535,19
|
||||
-122.0850719913391,37.42143663023161,19
|
||||
-122.084916406232,37.42137237822116,19
|
||||
-122.0842193868167,37.42137237801626,19
|
||||
-122.08421938659,37.42147617161496,19
|
||||
-122.0838086419991,37.4214613409357,19
|
||||
-122.0837899728564,37.42131306410796,19
|
||||
-122.0832796534698,37.42129328840593,19
|
||||
-122.0832609819207,37.42139213944298,19
|
||||
-122.0829373621737,37.42137236399876,19
|
||||
-122.0829062425667,37.42151569778871,19
|
||||
-122.0828502269665,37.42176282576465,19
|
||||
-122.0829435788635,37.42176776969635,19
|
||||
-122.083217411188,37.42179248552686,19
|
||||
-122.0835970430103,37.4217480074456,19
|
||||
-122.0839455556771,37.42169364237603,19
|
||||
-122.0840077894637,37.42176283815853,19
|
||||
-122.084113587521,37.42174801104392,19
|
||||
-122.0840762473784,37.42171341292375,19
|
||||
-122.0841447047739,37.42167881534569,19
|
||||
-122.084144704223,37.42181720660197,19
|
||||
-122.0842503333074,37.4218170700446,19
|
||||
-122.0844371128284,37.42177253003091,19 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
</Folder>
|
||||
<Folder>
|
||||
<name>Extruded Polygon</name>
|
||||
<description>A simple way to model a building</description>
|
||||
<Placemark>
|
||||
<name>The Pentagon</name>
|
||||
<LookAt>
|
||||
<longitude>-77.05580139178142</longitude>
|
||||
<latitude>38.870832443487</latitude>
|
||||
<heading>59.88865561738225</heading>
|
||||
<tilt>48.09646074797388</tilt>
|
||||
<range>742.0552506670548</range>
|
||||
</LookAt>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -77.05788457660967,38.87253259892824,100
|
||||
-77.05465973756702,38.87291016281703,100
|
||||
-77.05315536854791,38.87053267794386,100
|
||||
-77.05552622493516,38.868757801256,100
|
||||
-77.05844056290393,38.86996206506943,100
|
||||
-77.05788457660967,38.87253259892824,100 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
<innerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -77.05668055019126,38.87154239798456,100
|
||||
-77.05542625960818,38.87167890344077,100
|
||||
-77.05485125901024,38.87076535397792,100
|
||||
-77.05577677433152,38.87008686581446,100
|
||||
-77.05691162017543,38.87054446963351,100
|
||||
-77.05668055019126,38.87154239798456,100 </coordinates>
|
||||
</LinearRing>
|
||||
</innerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
</Folder>
|
||||
<Folder>
|
||||
<name>Absolute and Relative</name>
|
||||
<visibility>0</visibility>
|
||||
<description>Four structures whose roofs meet exactly. Turn on/off
|
||||
terrain to see the difference between relative and absolute
|
||||
positioning.</description>
|
||||
<LookAt>
|
||||
<longitude>-112.3348969157552</longitude>
|
||||
<latitude>36.14845533214919</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-86.91235037566909</heading>
|
||||
<tilt>49.30695423894192</tilt>
|
||||
<range>990.6761201087104</range>
|
||||
</LookAt>
|
||||
<Placemark>
|
||||
<name>Absolute</name>
|
||||
<visibility>0</visibility>
|
||||
<styleUrl>#transBluePoly</styleUrl>
|
||||
<Polygon>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>absolute</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -112.3382510731295,36.14888505105318,1784
|
||||
-112.3356128688403,36.14781540589019,1784
|
||||
-112.3368169371048,36.14658677734382,1784
|
||||
-112.3374408457543,36.14762778914076,1784
|
||||
-112.3382510731295,36.14888505105318,1784 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Absolute Extruded</name>
|
||||
<visibility>0</visibility>
|
||||
<styleUrl>#transRedPoly</styleUrl>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>absolute</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -112.3396586818843,36.14637618647505,1784
|
||||
-112.3380597654315,36.14531751871353,1784
|
||||
-112.3368254237788,36.14659596244607,1784
|
||||
-112.3384555043203,36.14762621763982,1784
|
||||
-112.3396586818843,36.14637618647505,1784 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Relative</name>
|
||||
<visibility>0</visibility>
|
||||
<LookAt>
|
||||
<longitude>-112.3350152490417</longitude>
|
||||
<latitude>36.14943123077423</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-118.9214100848499</heading>
|
||||
<tilt>37.92486261093203</tilt>
|
||||
<range>345.5169113679813</range>
|
||||
</LookAt>
|
||||
<styleUrl>#transGreenPoly</styleUrl>
|
||||
<Polygon>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -112.3349463145932,36.14988705767721,100
|
||||
-112.3354019540677,36.14941108398372,100
|
||||
-112.3344428289146,36.14878490381308,100
|
||||
-112.3331289492913,36.14780840132443,100
|
||||
-112.3317019516947,36.14680755678357,100
|
||||
-112.331131440106,36.1474173426228,100
|
||||
-112.332616324338,36.14845453364654,100
|
||||
-112.3339876620524,36.14926570522069,100
|
||||
-112.3349463145932,36.14988705767721,100 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
<Placemark>
|
||||
<name>Relative Extruded</name>
|
||||
<visibility>0</visibility>
|
||||
<LookAt>
|
||||
<longitude>-112.3351587892382</longitude>
|
||||
<latitude>36.14979247129029</latitude>
|
||||
<altitude>0</altitude>
|
||||
<heading>-55.42811560891606</heading>
|
||||
<tilt>56.10280503739589</tilt>
|
||||
<range>401.0997279712519</range>
|
||||
</LookAt>
|
||||
<styleUrl>#transYellowPoly</styleUrl>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates> -112.3348783983763,36.1514008468736,100
|
||||
-112.3372535345629,36.14888517553886,100
|
||||
-112.3356068927954,36.14781612679284,100
|
||||
-112.3350034807972,36.14846469024177,100
|
||||
-112.3358353861232,36.1489624162954,100
|
||||
-112.3345888301373,36.15026229372507,100
|
||||
-112.3337937856278,36.14978096026463,100
|
||||
-112.3331798208424,36.1504472788618,100
|
||||
-112.3348783983763,36.1514008468736,100 </coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
</Folder>
|
||||
</Folder>
|
||||
</Document>
|
||||
</kml>
|
1
vendor/phayes/geophp/tests/input/box.georss
vendored
Normal file
1
vendor/phayes/geophp/tests/input/box.georss
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<box>42.943 -71.032 43.039 -69.856</box>
|
19
vendor/phayes/geophp/tests/input/cdata.kml
vendored
Normal file
19
vendor/phayes/geophp/tests/input/cdata.kml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kml xmlns="http://www.opengis.net/kml/2.2">
|
||||
<Document>
|
||||
<Placemark>
|
||||
<name>CDATA example</name>
|
||||
<description>
|
||||
<![CDATA[
|
||||
<h1>CDATA Tags are useful!</h1>
|
||||
<p><font color="red">Text is <i>more readable</i> and
|
||||
<b>easier to write</b> when you can avoid using entity
|
||||
references.</font></p>
|
||||
]]>
|
||||
</description>
|
||||
<Point>
|
||||
<coordinates>102.595626,14.996729</coordinates>
|
||||
</Point>
|
||||
</Placemark>
|
||||
</Document>
|
||||
</kml>
|
1
vendor/phayes/geophp/tests/input/circle.georss
vendored
Normal file
1
vendor/phayes/geophp/tests/input/circle.georss
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<circle>42.943 -71.032 500</circle>
|
1
vendor/phayes/geophp/tests/input/empty_point.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/empty_point.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
POINT EMPTY
|
1077
vendor/phayes/geophp/tests/input/fells_loop.gpx
vendored
Normal file
1077
vendor/phayes/geophp/tests/input/fells_loop.gpx
vendored
Normal file
File diff suppressed because it is too large
Load diff
29
vendor/phayes/geophp/tests/input/geometrycollection.georss
vendored
Normal file
29
vendor/phayes/geophp/tests/input/geometrycollection.georss
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"
|
||||
xmlns:georss="http://www.georss.org/georss">
|
||||
<title>Earthquakes</title>
|
||||
<subtitle>International earthquake observation labs</subtitle>
|
||||
<link href="http://example.org/"/>
|
||||
<updated>2005-12-13T18:30:02Z</updated>
|
||||
<author>
|
||||
<name>Dr. Thaddeus Remor</name>
|
||||
<email>tremor@quakelab.edu</email>
|
||||
</author>
|
||||
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
|
||||
<entry>
|
||||
<title>This has multiple georss entries in it</title>
|
||||
<link href="http://example.org/2005/09/09/atom01"/>
|
||||
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
||||
<updated>2005-08-17T07:02:32Z</updated>
|
||||
<summary>We just had a big one.</summary>
|
||||
<georss:point>45.256 -71.92</georss:point>
|
||||
<georss:point>42.256 -69.92</georss:point>
|
||||
<georss:line>45.256 -110.45 46.46 -109.48 43.84 -109.86</georss:line>
|
||||
<georss:polygon>45.256 -110.45 46.46 -109.48 43.84 -109.86 45.256 -110.45</georss:polygon>
|
||||
</entry>
|
||||
<entry>
|
||||
<title>Another Entry</title>d
|
||||
<summary>Another point.</summary>
|
||||
<georss:point>46.256 -70.92</georss:point>
|
||||
</entry>
|
||||
</feed>
|
1
vendor/phayes/geophp/tests/input/geometrycollection.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/geometrycollection.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
GEOMETRYCOLLECTION (POINT (4 6), LINESTRING (4 6,7 10))
|
1
vendor/phayes/geophp/tests/input/line.georss
vendored
Normal file
1
vendor/phayes/geophp/tests/input/line.georss
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<line>45.256 -110.45 46.46 -109.48 43.84 -109.86</line>
|
1
vendor/phayes/geophp/tests/input/linestring.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/linestring.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
LINESTRING (30 10, 10 30, 40 40)
|
1
vendor/phayes/geophp/tests/input/long.geohash
vendored
Normal file
1
vendor/phayes/geophp/tests/input/long.geohash
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
xn76urx4epb0
|
1
vendor/phayes/geophp/tests/input/multilinestring.ewkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/multilinestring.ewkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
SRID=4269;MULTILINESTRING((-71.160281 42.258729,-71.160837 42.259113,-71.161144 42.25932))
|
1
vendor/phayes/geophp/tests/input/multilinestring.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/multilinestring.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
MULTILINESTRING ((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))
|
BIN
vendor/phayes/geophp/tests/input/multipolygon.wkb
vendored
Normal file
BIN
vendor/phayes/geophp/tests/input/multipolygon.wkb
vendored
Normal file
Binary file not shown.
1
vendor/phayes/geophp/tests/input/multipolygon.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/multipolygon.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
MULTIPOLYGON (((30 20, 10 40, 45 40, 30 20)), ((15 5, 40 10, 10 20, 5 10, 15 5)))
|
1
vendor/phayes/geophp/tests/input/multipolygon2.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/multipolygon2.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 45 20, 30 5, 10 10, 10 30, 20 35),(30 20, 20 25, 20 15, 30 20)))
|
1
vendor/phayes/geophp/tests/input/multipolygon_big.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/multipolygon_big.wkt
vendored
Normal file
File diff suppressed because one or more lines are too long
10
vendor/phayes/geophp/tests/input/opposite.gpx
vendored
Normal file
10
vendor/phayes/geophp/tests/input/opposite.gpx
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
|
||||
<trk>
|
||||
<name>Mons and its opposite</name>
|
||||
<trkseg>
|
||||
<trkpt lat="50.45409" lon="3.95626"></trkpt>
|
||||
<trkpt lat="-50.45409" lon="-176.04374"></trkpt>
|
||||
</trkseg>
|
||||
</trk>
|
||||
</gpx>
|
40
vendor/phayes/geophp/tests/input/path.kml
vendored
Normal file
40
vendor/phayes/geophp/tests/input/path.kml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kml xmlns="http://www.opengis.net/kml/2.2">
|
||||
<Document>
|
||||
<name>Paths</name>
|
||||
<description>Examples of paths. Note that the tessellate tag is by default
|
||||
set to 0. If you want to create tessellated lines, they must be authored
|
||||
(or edited) directly in KML.</description>
|
||||
<Style id="yellowLineGreenPoly">
|
||||
<LineStyle>
|
||||
<color>7f00ffff</color>
|
||||
<width>4</width>
|
||||
</LineStyle>
|
||||
<PolyStyle>
|
||||
<color>7f00ff00</color>
|
||||
</PolyStyle>
|
||||
</Style>
|
||||
<Placemark>
|
||||
<name>Absolute Extruded</name>
|
||||
<description>Transparent green wall with yellow outlines</description>
|
||||
<styleUrl>#yellowLineGreenPoly</styleUrl>
|
||||
<LineString>
|
||||
<extrude>1</extrude>
|
||||
<tessellate>1</tessellate>
|
||||
<altitudeMode>absolute</altitudeMode>
|
||||
<coordinates> -112.2550785337791,36.07954952145647,2357
|
||||
-112.2549277039738,36.08117083492122,2357
|
||||
-112.2552505069063,36.08260761307279,2357
|
||||
-112.2564540158376,36.08395660588506,2357
|
||||
-112.2580238976449,36.08511401044813,2357
|
||||
-112.2595218489022,36.08584355239394,2357
|
||||
-112.2608216347552,36.08612634548589,2357
|
||||
-112.262073428656,36.08626019085147,2357
|
||||
-112.2633204928495,36.08621519860091,2357
|
||||
-112.2644963846444,36.08627897945274,2357
|
||||
-112.2656969554589,36.08649599090644,2357
|
||||
</coordinates>
|
||||
</LineString>
|
||||
</Placemark>
|
||||
</Document>
|
||||
</kml>
|
1
vendor/phayes/geophp/tests/input/paths_big.json
vendored
Normal file
1
vendor/phayes/geophp/tests/input/paths_big.json
vendored
Normal file
File diff suppressed because one or more lines are too long
34
vendor/phayes/geophp/tests/input/pentagon.kml
vendored
Normal file
34
vendor/phayes/geophp/tests/input/pentagon.kml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kml xmlns="http://www.opengis.net/kml/2.2">
|
||||
<Placemark>
|
||||
<name>The Pentagon</name>
|
||||
<Polygon>
|
||||
<extrude>1</extrude>
|
||||
<altitudeMode>relativeToGround</altitudeMode>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates>
|
||||
-77.05788457660967,38.87253259892824,100
|
||||
-77.05465973756702,38.87291016281703,100
|
||||
-77.05315536854791,38.87053267794386,100
|
||||
-77.05552622493516,38.868757801256,100
|
||||
-77.05844056290393,38.86996206506943,100
|
||||
-77.05788457660967,38.87253259892824,100
|
||||
</coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
<innerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates>
|
||||
-77.05668055019126,38.87154239798456,100
|
||||
-77.05542625960818,38.87167890344077,100
|
||||
-77.05485125901024,38.87076535397792,100
|
||||
-77.05577677433152,38.87008686581446,100
|
||||
-77.05691162017543,38.87054446963351,100
|
||||
-77.05668055019126,38.87154239798456,100
|
||||
</coordinates>
|
||||
</LinearRing>
|
||||
</innerBoundaryIs>
|
||||
</Polygon>
|
||||
</Placemark>
|
||||
</kml>
|
21
vendor/phayes/geophp/tests/input/point.georss
vendored
Normal file
21
vendor/phayes/geophp/tests/input/point.georss
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"
|
||||
xmlns:georss="http://www.georss.org/georss">
|
||||
<title>Earthquakes</title>
|
||||
<subtitle>International earthquake observation labs</subtitle>
|
||||
<link href="http://example.org/"/>
|
||||
<updated>2005-12-13T18:30:02Z</updated>
|
||||
<author>
|
||||
<name>Dr. Thaddeus Remor</name>
|
||||
<email>tremor@quakelab.edu</email>
|
||||
</author>
|
||||
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
|
||||
<entry>
|
||||
<title>M 3.2, Mona Passage</title>
|
||||
<link href="http://example.org/2005/09/09/atom01"/>
|
||||
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
||||
<updated>2005-08-17T07:02:32Z</updated>
|
||||
<summary>We just had a big one.</summary>
|
||||
<georss:point>45.256 -71.92</georss:point>
|
||||
</entry>
|
||||
</feed>
|
11
vendor/phayes/geophp/tests/input/point.kml
vendored
Normal file
11
vendor/phayes/geophp/tests/input/point.kml
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kml xmlns="http://www.opengis.net/kml/2.2">
|
||||
<Placemark>
|
||||
<name>Simple placemark</name>
|
||||
<description>Attached to the ground. Intelligently places itself
|
||||
at the height of the underlying terrain.</description>
|
||||
<Point>
|
||||
<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
|
||||
</Point>
|
||||
</Placemark>
|
||||
</kml>
|
1
vendor/phayes/geophp/tests/input/point.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/point.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
POINT (10 12)
|
3
vendor/phayes/geophp/tests/input/polygon.georss
vendored
Normal file
3
vendor/phayes/geophp/tests/input/polygon.georss
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
<polygon>
|
||||
45.256 -110.45 46.46 -109.48 43.84 -109.86 45.256 -110.45
|
||||
</polygon>
|
1
vendor/phayes/geophp/tests/input/polygon.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/polygon.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))
|
1
vendor/phayes/geophp/tests/input/polygon2.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/polygon2.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10), (20 30, 35 35, 30 20, 20 30))
|
1
vendor/phayes/geophp/tests/input/polygon3.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/polygon3.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
POLYGON ((-123.222653196 49.1529676585, -89.4726531957 49.3823707987, -81.0351531957 44.0875828344, -71.1914031957 44.3395630636, -62.0507781957 48.4583498573, -60.2929656957 45.0890334085, -78.9257781957 37.4399716272, -82.0898406957 31.3536343332, -81.3867156957 26.4312253295, -91.9335906957 29.8406412505, -98.2617156957 26.4312253295, -107.753903196 32.2499718728, -116.894528196 33.1375486348, -122.519528196 36.0313293064, -126.035153196 42.2935619329, -123.222653196 49.1529676585))
|
1
vendor/phayes/geophp/tests/input/polygon4.wkt
vendored
Normal file
1
vendor/phayes/geophp/tests/input/polygon4.wkt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
POLYGON((4.8352495472368009 52.3561217600921438,4.8354139113045580 52.3561243429663534,4.8356082266282945 52.3561267417385281,4.8358010085903622 52.3561273083083663,4.8358010085903622 52.3561273083083663,4.8358035242637225 52.3559935212917722,4.8363777606561538 52.3559985348227173,4.8365863082998608 52.3560003600829731,4.8365523717335313 52.3570990145454189,4.8365884597636066 52.3572643433297529,4.8366320506970659 52.3574639095218686,4.8366736405531485 52.3576544056339870,4.8367264446828226 52.3578947700094304,4.8367922739966023 52.3581940807800450,4.8368228816936947 52.3583326871276356,4.8368228816936947 52.3583326871276356,4.8346348012064322 52.3583075969840550,4.8346348012064322 52.3583075969840550,4.8346348010943823 52.3583076059723282,4.8346348010943823 52.3583076059723282,4.8344931735728114 52.3583059732702338,4.8343773230572911 52.3583046496785585,4.8342182417472204 52.3583028092031384,4.8340047277034000 52.3583004442080195,4.8340047277034000 52.3583004442080195,4.8340047286008216 52.3583003723016063,4.8340047286008216 52.3583003723016063,4.8333843154510516 52.3582932434377639,4.8333843154510516 52.3582932434377639,4.8333915914677918 52.3580669388087898,4.8333968982183286 52.3578913129544787,4.8334415565569193 52.3563602568407660,4.8336003450092706 52.3563614767834267,4.8336013166539615 52.3563318721204567,4.8336013166539615 52.3563318721204567,4.8339582156582548 52.3563361223319603,4.8339656498645338 52.3561015845598732,4.8340692910524092 52.3561032110135258,4.8340692910524092 52.3561032110135258,4.8345511248958477 52.3561107854074095,4.8345511248958477 52.3561107854074095,4.8345513450958055 52.3561107864365809,4.8345513450958055 52.3561107864365809,4.8346742584771087 52.3561127181661092,4.8346742584771087 52.3561127181661092,4.8347750227755597 52.3561143035917596,4.8347750227755597 52.3561143035917596,4.8352495472368009 52.3561217600921438))
|
2
vendor/phayes/geophp/tests/input/polygon_spaces.wkt
vendored
Normal file
2
vendor/phayes/geophp/tests/input/polygon_spaces.wkt
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
POLYGON ((30 10 , 10 20 , 20 40 , 40 40 , 30 10 ))
|
4749
vendor/phayes/geophp/tests/input/route.gpx
vendored
Normal file
4749
vendor/phayes/geophp/tests/input/route.gpx
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
vendor/phayes/geophp/tests/input/short.geohash
vendored
Normal file
1
vendor/phayes/geophp/tests/input/short.geohash
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
xpssc0
|
1
vendor/phayes/geophp/tests/input/simple_point.json
vendored
Normal file
1
vendor/phayes/geophp/tests/input/simple_point.json
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-80.73029, 35.3936]}}
|
28
vendor/phayes/geophp/tests/input/track.gpx
vendored
Normal file
28
vendor/phayes/geophp/tests/input/track.gpx
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
|
||||
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" creator="Oregon 400t" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd">
|
||||
<metadata>
|
||||
<link href="http://www.garmin.com">
|
||||
<text>Garmin International</text>
|
||||
</link>
|
||||
<time>2009-10-17T22:58:43Z</time>
|
||||
</metadata>
|
||||
<trk>
|
||||
<name>Example GPX Document</name>
|
||||
<trkseg>
|
||||
<trkpt lat="47.644548" lon="-122.326897">
|
||||
<ele>4.46</ele>
|
||||
<time>2009-10-17T18:37:26Z</time>
|
||||
</trkpt>
|
||||
<trkpt lat="47.644550" lon="-122.326897">
|
||||
<ele>4.94</ele>
|
||||
<time>2009-10-17T18:37:31Z</time>
|
||||
</trkpt>
|
||||
<trkpt lat="47.644552" lon="-122.326899">
|
||||
<ele>6.87</ele>
|
||||
<time>2009-10-17T18:37:34Z</time>
|
||||
</trkpt>
|
||||
</trkseg>
|
||||
</trk>
|
||||
</gpx>
|
||||
|
82
vendor/phayes/geophp/tests/postgis.php
vendored
Normal file
82
vendor/phayes/geophp/tests/postgis.php
vendored
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?
|
||||
// Uncomment to test
|
||||
# run_test();
|
||||
|
||||
function run_test() {
|
||||
|
||||
header("Content-type: text");
|
||||
|
||||
include_once('../geoPHP.inc');
|
||||
|
||||
// Your database test table should contain 3 columns: name (text), type (text), geom (geometry)
|
||||
$host = 'localhost';
|
||||
$database = 'phayes';
|
||||
$table = 'test';
|
||||
$column = 'geom';
|
||||
$user = 'phayes';
|
||||
$pass = 'supersecret';
|
||||
|
||||
$connection = pg_connect("host=$host dbname=$database user=$user password=$pass");
|
||||
|
||||
// Truncate
|
||||
pg_query($connection, "DELETE FROM $table");
|
||||
|
||||
// Working with PostGIS and EWKB
|
||||
// ----------------------------
|
||||
|
||||
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
|
||||
$parts = explode('.',$file);
|
||||
if ($parts[0]) {
|
||||
$name = $parts[0];
|
||||
$format = $parts[1];
|
||||
$value = file_get_contents('./input/'.$file);
|
||||
print '---- Testing '.$file."\n";
|
||||
flush();
|
||||
$geometry = geoPHP::load($value, $format);
|
||||
test_postgis($name, $format, $geometry, $connection, 'wkb');
|
||||
$geometry->setSRID(4326);
|
||||
test_postgis($name, $format, $geometry, $connection, 'ewkb');
|
||||
}
|
||||
}
|
||||
print "Testing Done!";
|
||||
}
|
||||
|
||||
function test_postgis($name, $type, $geom, $connection, $format) {
|
||||
global $table;
|
||||
|
||||
// Let's insert into the database using GeomFromWKB
|
||||
$insert_string = pg_escape_bytea($geom->out($format));
|
||||
pg_query($connection, "INSERT INTO $table (name, type, geom) values ('$name', '$type', GeomFromWKB('$insert_string'))");
|
||||
|
||||
// SELECT using asBinary PostGIS
|
||||
$result = pg_fetch_all(pg_query($connection, "SELECT asBinary(geom) as geom FROM $table WHERE name='$name'"));
|
||||
foreach ($result as $item) {
|
||||
$wkb = pg_unescape_bytea($item['geom']); // Make sure to unescape the hex blob
|
||||
$geom = geoPHP::load($wkb, $format); // We now a full geoPHP Geometry object
|
||||
}
|
||||
|
||||
// SELECT and INSERT directly, with no wrapping functions
|
||||
$result = pg_fetch_all(pg_query($connection, "SELECT geom as geom FROM $table WHERE name='$name'"));
|
||||
foreach ($result as $item) {
|
||||
$wkb = pack('H*',$item['geom']); // Unpacking the hex blob
|
||||
$geom = geoPHP::load($wkb, $format); // We now have a geoPHP Geometry
|
||||
|
||||
// Let's re-insert directly into postGIS
|
||||
// We need to unpack the WKB
|
||||
$unpacked = unpack('H*', $geom->out($format));
|
||||
$insert_string = $unpacked[1];
|
||||
pg_query($connection, "INSERT INTO $table (name, type, geom) values ('$name', '$type', '$insert_string')");
|
||||
}
|
||||
|
||||
// SELECT and INSERT using as EWKT (ST_GeomFromEWKT and ST_AsEWKT)
|
||||
$result = pg_fetch_all(pg_query($connection, "SELECT ST_AsEWKT(geom) as geom FROM $table WHERE name='$name'"));
|
||||
foreach ($result as $item) {
|
||||
$wkt = $item['geom']; // Make sure to unescape the hex blob
|
||||
$geom = geoPHP::load($wkt, 'ewkt'); // We now a full geoPHP Geometry object
|
||||
|
||||
// Let's re-insert directly into postGIS
|
||||
$insert_string = $geom->out('ewkt');
|
||||
pg_query($connection, "INSERT INTO $table (name, type, geom) values ('$name', '$type', ST_GeomFromEWKT('$insert_string'))");
|
||||
}
|
||||
}
|
||||
|
258
vendor/phayes/geophp/tests/test.php
vendored
Normal file
258
vendor/phayes/geophp/tests/test.php
vendored
Normal file
|
@ -0,0 +1,258 @@
|
|||
<?php
|
||||
|
||||
// Uncomment to test
|
||||
if (getenv("GEOPHP_RUN_TESTS") == 1) {
|
||||
run_test();
|
||||
}
|
||||
else {
|
||||
print "Skipping tests. Please set GEOPHP_RUN_TESTS=1 environment variable if you wish to run tests\n";
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
set_time_limit(0);
|
||||
|
||||
set_error_handler("FailOnError");
|
||||
|
||||
header("Content-type: text");
|
||||
|
||||
include_once('../geoPHP.inc');
|
||||
|
||||
if (geoPHP::geosInstalled()) {
|
||||
print "GEOS is installed.\n";
|
||||
}
|
||||
else {
|
||||
print "GEOS is not installed.\n";
|
||||
}
|
||||
|
||||
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
|
||||
$parts = explode('.',$file);
|
||||
if ($parts[0]) {
|
||||
$format = $parts[1];
|
||||
$value = file_get_contents('./input/'.$file);
|
||||
print '---- Testing '.$file."\n";
|
||||
$geometry = geoPHP::load($value, $format);
|
||||
test_adapters($geometry, $format, $value);
|
||||
test_methods($geometry);
|
||||
test_geometry($geometry);
|
||||
test_detection($value, $format, $file);
|
||||
}
|
||||
}
|
||||
print "\e[32m" . "PASS". "\e[39m\n";
|
||||
}
|
||||
|
||||
function test_geometry($geometry) {
|
||||
|
||||
// Test common functions
|
||||
$geometry->area();
|
||||
$geometry->boundary();
|
||||
$geometry->envelope();
|
||||
$geometry->getBBox();
|
||||
$geometry->centroid();
|
||||
$geometry->length();
|
||||
$geometry->greatCircleLength();
|
||||
$geometry->haversineLength();
|
||||
$geometry->y();
|
||||
$geometry->x();
|
||||
$geometry->numGeometries();
|
||||
$geometry->geometryN(1);
|
||||
$geometry->startPoint();
|
||||
$geometry->endPoint();
|
||||
$geometry->isRing();
|
||||
$geometry->isClosed();
|
||||
$geometry->numPoints();
|
||||
$geometry->pointN(1);
|
||||
$geometry->exteriorRing();
|
||||
$geometry->numInteriorRings();
|
||||
$geometry->interiorRingN(1);
|
||||
$geometry->dimension();
|
||||
$geometry->geometryType();
|
||||
$geometry->SRID();
|
||||
$geometry->setSRID(4326);
|
||||
|
||||
// Aliases
|
||||
$geometry->getCentroid();
|
||||
$geometry->getArea();
|
||||
$geometry->getX();
|
||||
$geometry->getY();
|
||||
$geometry->getGeos();
|
||||
$geometry->getGeomType();
|
||||
$geometry->getSRID();
|
||||
$geometry->asText();
|
||||
$geometry->asBinary();
|
||||
|
||||
// GEOS only functions
|
||||
$geometry->geos();
|
||||
$geometry->setGeos($geometry->geos());
|
||||
$geometry->pointOnSurface();
|
||||
$geometry->equals($geometry);
|
||||
$geometry->equalsExact($geometry);
|
||||
$geometry->relate($geometry);
|
||||
$geometry->checkValidity();
|
||||
$geometry->isSimple();
|
||||
$geometry->buffer(10);
|
||||
$geometry->intersection($geometry);
|
||||
$geometry->convexHull();
|
||||
$geometry->difference($geometry);
|
||||
$geometry->symDifference($geometry);
|
||||
$geometry->union($geometry);
|
||||
$geometry->simplify(0);// @@TODO: Adjust this once we can deal with empty geometries
|
||||
$geometry->disjoint($geometry);
|
||||
$geometry->touches($geometry);
|
||||
$geometry->intersects($geometry);
|
||||
$geometry->crosses($geometry);
|
||||
$geometry->within($geometry);
|
||||
$geometry->contains($geometry);
|
||||
$geometry->overlaps($geometry);
|
||||
$geometry->covers($geometry);
|
||||
$geometry->coveredBy($geometry);
|
||||
$geometry->distance($geometry);
|
||||
$geometry->hausdorffDistance($geometry);
|
||||
|
||||
|
||||
// Place holders
|
||||
$geometry->hasZ();
|
||||
$geometry->is3D();
|
||||
$geometry->isMeasured();
|
||||
$geometry->isEmpty();
|
||||
$geometry->coordinateDimension();
|
||||
$geometry->z();
|
||||
$geometry->m();
|
||||
}
|
||||
|
||||
function test_adapters($geometry, $format, $input) {
|
||||
// Test adapter output and input. Do a round-trip and re-test
|
||||
foreach (geoPHP::getAdapterMap() as $adapter_key => $adapter_class) {
|
||||
if ($adapter_key != 'google_geocode') { //Don't test google geocoder regularily. Uncomment to test
|
||||
$output = $geometry->out($adapter_key);
|
||||
if ($output) {
|
||||
$adapter_loader = new $adapter_class();
|
||||
$test_geom_1 = $adapter_loader->read($output);
|
||||
$test_geom_2 = $adapter_loader->read($test_geom_1->out($adapter_key));
|
||||
|
||||
if ($test_geom_1->out('wkt') != $test_geom_2->out('wkt')) {
|
||||
print "Mismatched adapter output in ".$adapter_class."\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "Empty output on " . $adapter_key . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test to make sure adapter work the same wether GEOS is ON or OFF
|
||||
// Cannot test methods if GEOS is not intstalled
|
||||
if (!geoPHP::geosInstalled()) return;
|
||||
|
||||
foreach (geoPHP::getAdapterMap() as $adapter_key => $adapter_class) {
|
||||
if ($adapter_key != 'google_geocode') { //Don't test google geocoder regularily. Uncomment to test
|
||||
// Turn GEOS on
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
|
||||
$output = $geometry->out($adapter_key);
|
||||
if ($output) {
|
||||
$adapter_loader = new $adapter_class();
|
||||
|
||||
$test_geom_1 = $adapter_loader->read($output);
|
||||
|
||||
// Turn GEOS off
|
||||
geoPHP::geosInstalled(FALSE);
|
||||
|
||||
$test_geom_2 = $adapter_loader->read($output);
|
||||
|
||||
// Turn GEOS back On
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
|
||||
// Check to make sure a both are the same with geos and without
|
||||
if ($test_geom_1->out('wkt') != $test_geom_2->out('wkt')) {
|
||||
print "Mismatched adapter output between GEOS and NORM in ".$adapter_class."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function test_methods($geometry) {
|
||||
// Cannot test methods if GEOS is not intstalled
|
||||
if (!geoPHP::geosInstalled()) return;
|
||||
|
||||
$methods = array(
|
||||
//'boundary', //@@TODO: Uncomment this and fix errors
|
||||
'envelope', //@@TODO: Testing reveales errors in this method -- POINT vs. POLYGON
|
||||
'getBBox',
|
||||
'x',
|
||||
'y',
|
||||
'startPoint',
|
||||
'endPoint',
|
||||
'isRing',
|
||||
'isClosed',
|
||||
'numPoints',
|
||||
);
|
||||
|
||||
foreach ($methods as $method) {
|
||||
// Turn GEOS on
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
$geos_result = $geometry->$method();
|
||||
|
||||
// Turn GEOS off
|
||||
geoPHP::geosInstalled(FALSE);
|
||||
$norm_result = $geometry->$method();
|
||||
|
||||
// Turn GEOS back On
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
|
||||
$geos_type = gettype($geos_result);
|
||||
$norm_type = gettype($norm_result);
|
||||
|
||||
if ($geos_type != $norm_type) {
|
||||
print 'Type mismatch on '.$method."\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
// Now check base on type
|
||||
if ($geos_type == 'object') {
|
||||
$haus_dist = $geos_result->hausdorffDistance(geoPHP::load($norm_result->out('wkt'),'wkt'));
|
||||
|
||||
// Get the length of the diagonal of the bbox - this is used to scale the haustorff distance
|
||||
// Using Pythagorean theorem
|
||||
$bb = $geos_result->getBBox();
|
||||
$scale = sqrt((($bb['maxy'] - $bb['miny'])^2) + (($bb['maxx'] - $bb['minx'])^2));
|
||||
|
||||
// The difference in the output of GEOS and native-PHP methods should be less than 0.5 scaled haustorff units
|
||||
if ($haus_dist / $scale > 0.5) {
|
||||
print 'Output mismatch on '.$method.":\n";
|
||||
print 'GEOS : '.$geos_result->out('wkt')."\n";
|
||||
print 'NORM : '.$norm_result->out('wkt')."\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($geos_type == 'boolean' || $geos_type == 'string') {
|
||||
if ($geos_result !== $norm_result) {
|
||||
print 'Output mismatch on '.$method.":\n";
|
||||
print 'GEOS : '.(string) $geos_result."\n";
|
||||
print 'NORM : '.(string) $norm_result."\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//@@TODO: Run tests for output of types arrays and float
|
||||
//@@TODO: centroid function is non-compliant for collections and strings
|
||||
}
|
||||
}
|
||||
|
||||
function test_detection($value, $format, $file) {
|
||||
$detected = geoPHP::detectFormat($value);
|
||||
if ($detected != $format) {
|
||||
if ($detected) print 'detected as ' . $detected . "\n";
|
||||
else print "format not detected\n";
|
||||
}
|
||||
// Make sure it loads using auto-detect
|
||||
geoPHP::load($value);
|
||||
}
|
||||
|
||||
function FailOnError($error_level, $error_message, $error_file, $error_line, $error_context) {
|
||||
echo "$error_level: $error_message in $error_file on line $error_line\n";
|
||||
echo "\e[31m" . "FAIL" . "\e[39m\n";
|
||||
exit(1);
|
||||
}
|
287
vendor/phayes/geophp/tests/tests/20120702Test.php
vendored
Normal file
287
vendor/phayes/geophp/tests/tests/20120702Test.php
vendored
Normal file
|
@ -0,0 +1,287 @@
|
|||
<?php
|
||||
require_once('../geoPHP.inc');
|
||||
class Tests_20120702 extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp() {
|
||||
|
||||
}
|
||||
|
||||
function testMethods() {
|
||||
$format = 'gpx';
|
||||
$value = file_get_contents('./input/20120702.gpx');
|
||||
$geometry = geoPHP::load($value, $format);
|
||||
|
||||
$methods = array(
|
||||
array('name' => 'area'),
|
||||
array('name' => 'boundary'),
|
||||
array('name' => 'getBBox'),
|
||||
array('name' => 'centroid'),
|
||||
array('name' => 'length'),
|
||||
array('name' => 'greatCircleLength', 'argument' => 6378137),
|
||||
array('name' => 'haversineLength'),
|
||||
array('name' => 'y'),
|
||||
array('name' => 'x'),
|
||||
array('name' => 'numGeometries'),
|
||||
array('name' => 'geometryN', 'argument' => '1'),
|
||||
array('name' => 'startPoint'),
|
||||
array('name' => 'endPoint'),
|
||||
array('name' => 'isRing'),
|
||||
array('name' => 'isClosed'),
|
||||
array('name' => 'numPoints'),
|
||||
array('name' => 'pointN', 'argument' => '1'),
|
||||
array('name' => 'exteriorRing'),
|
||||
array('name' => 'numInteriorRings'),
|
||||
array('name' => 'interiorRingN', 'argument' => '1'),
|
||||
array('name' => 'dimension'),
|
||||
array('name' => 'geometryType'),
|
||||
array('name' => 'SRID'),
|
||||
array('name' => 'setSRID', 'argument' => '4326'),
|
||||
);
|
||||
|
||||
foreach($methods as $method) {
|
||||
$argument = NULL;
|
||||
$method_name = $method['name'];
|
||||
if (isset($method['argument'])) {
|
||||
$argument = $method['argument'];
|
||||
}
|
||||
$this->_methods_tester($geometry, $method_name, $argument);
|
||||
}
|
||||
}
|
||||
|
||||
function _methods_tester($geometry, $method_name, $argument) {
|
||||
|
||||
if (!method_exists($geometry, $method_name)) {
|
||||
$this->fail("Method ".$method_name.'() doesn\'t exists.');
|
||||
return;
|
||||
}
|
||||
|
||||
switch ($method_name) {
|
||||
case 'y':
|
||||
case 'x':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'geometryN':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'startPoint':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
//TODO: Add a method startPoint() to MultiLineString.
|
||||
//$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'endPoint':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
//TODO: Add a method endPoint() to MultiLineString.
|
||||
//$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'isRing':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'isClosed':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'pointN':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
//TODO: Add a method pointN() to MultiLineString.
|
||||
//$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'exteriorRing':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'numInteriorRings':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'interiorRingN':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'setSRID':
|
||||
//TODO: The method setSRID() should return TRUE.
|
||||
break;
|
||||
case 'SRID':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'getBBox':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'centroid':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'length':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertEquals($geometry->$method_name($argument), (float) '0.11624637315233', 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'numGeometries':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'numPoints':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'dimension':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'boundary':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'greatCircleLength':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotEquals($geometry->$method_name($argument), '9500.9359867418', 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'haversineLength':
|
||||
case 'area':
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
break;
|
||||
case 'geometryType':
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
break;
|
||||
default:
|
||||
$this->assertTrue($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
63
vendor/phayes/geophp/tests/tests/adaptersTest.php
vendored
Normal file
63
vendor/phayes/geophp/tests/tests/adaptersTest.php
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
require_once('../geoPHP.inc');
|
||||
class AdaptersTests extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp() {
|
||||
|
||||
}
|
||||
|
||||
function testAdapters() {
|
||||
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
|
||||
$parts = explode('.',$file);
|
||||
if ($parts[0]) {
|
||||
$format = $parts[1];
|
||||
$input = file_get_contents('./input/'.$file);
|
||||
echo "\nloading: " . $file . " for format: " . $format;
|
||||
$geometry = geoPHP::load($input, $format);
|
||||
|
||||
// Test adapter output and input. Do a round-trip and re-test
|
||||
foreach (geoPHP::getAdapterMap() as $adapter_key => $adapter_class) {
|
||||
if ($adapter_key != 'google_geocode') { //Don't test google geocoder regularily. Uncomment to test
|
||||
$output = $geometry->out($adapter_key);
|
||||
$this->assertNotNull($output, "Empty output on " . $adapter_key);
|
||||
if ($output) {
|
||||
$adapter_loader = new $adapter_class();
|
||||
$test_geom_1 = $adapter_loader->read($output);
|
||||
$test_geom_2 = $adapter_loader->read($test_geom_1->out($adapter_key));
|
||||
$this->assertEquals($test_geom_1->out('wkt'), $test_geom_2->out('wkt'), "Mismatched adapter output in ".$adapter_class .' (test file: ' . $file . ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test to make sure adapter work the same wether GEOS is ON or OFF
|
||||
// Cannot test methods if GEOS is not intstalled
|
||||
if (!geoPHP::geosInstalled()) return;
|
||||
|
||||
foreach (geoPHP::getAdapterMap() as $adapter_key => $adapter_class) {
|
||||
if ($adapter_key != 'google_geocode') { //Don't test google geocoder regularily. Uncomment to test
|
||||
// Turn GEOS on
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
|
||||
$output = $geometry->out($adapter_key);
|
||||
if ($output) {
|
||||
$adapter_loader = new $adapter_class();
|
||||
|
||||
$test_geom_1 = $adapter_loader->read($output);
|
||||
|
||||
// Turn GEOS off
|
||||
geoPHP::geosInstalled(FALSE);
|
||||
|
||||
$test_geom_2 = $adapter_loader->read($output);
|
||||
|
||||
// Turn GEOS back On
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
|
||||
// Check to make sure a both are the same with geos and without
|
||||
$this->assertEquals($test_geom_1->out('wkt'), $test_geom_2->out('wkt'), "Mismatched adapter output between GEOS and NORM in ".$adapter_class .' (test file: ' . $file . ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
vendor/phayes/geophp/tests/tests/bootstrap.php
vendored
Normal file
7
vendor/phayes/geophp/tests/tests/bootstrap.php
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
require_once ('../geoPHP.inc');
|
||||
if (!@include __DIR__ . '/../../vendor/autoload.php') {
|
||||
die('You must set up the project dependencies, run the following commands:
|
||||
wget http://getcomposer.org/composer.phar
|
||||
php composer.phar install');
|
||||
}
|
20
vendor/phayes/geophp/tests/tests/geohashTest.php
vendored
Normal file
20
vendor/phayes/geophp/tests/tests/geohashTest.php
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
require_once ('../geoPHP.inc');
|
||||
|
||||
class GeoHashTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp() {
|
||||
}
|
||||
|
||||
/**
|
||||
* test cases for adjacent geohashes.
|
||||
*/
|
||||
function testAdjacent() {
|
||||
$geohash = new Geohash();
|
||||
$this->assertEquals ( 'xne', $geohash->adjacent ( 'xn7', 'top' ), 'Did not find correct top adjacent geohash for xn7' );
|
||||
$this->assertEquals ( 'xnk', $geohash->adjacent ( 'xn7', 'right' ), 'Did not find correct right adjacent geohash for xn7' );
|
||||
$this->assertEquals ( 'xn5', $geohash->adjacent ( 'xn7', 'bottom' ), 'Did not find correct bottom adjacent geohash for xn7' );
|
||||
$this->assertEquals ( 'xn6', $geohash->adjacent ( 'xn7', 'left' ), 'Did not find correct left adjacent geohash for xn7' );
|
||||
$this->assertEquals ( 'xnd', $geohash->adjacent ( $geohash->adjacent ( 'xn7', 'left' ), 'top' ), 'Did not find correct top-left adjacent geohash for xn7' );
|
||||
}
|
||||
}
|
89
vendor/phayes/geophp/tests/tests/geosTest.php
vendored
Normal file
89
vendor/phayes/geophp/tests/tests/geosTest.php
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
require_once('../geoPHP.inc');
|
||||
class GeosTests extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp() {
|
||||
|
||||
}
|
||||
|
||||
function testGeos() {
|
||||
if (!geoPHP::geosInstalled()) {
|
||||
echo "Skipping GEOS -- not installed";
|
||||
return;
|
||||
}
|
||||
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
|
||||
$parts = explode('.',$file);
|
||||
if ($parts[0]) {
|
||||
$format = $parts[1];
|
||||
$value = file_get_contents('./input/'.$file);
|
||||
echo "\nloading: " . $file . " for format: " . $format;
|
||||
$geometry = geoPHP::load($value, $format);
|
||||
|
||||
$geosMethods = array(
|
||||
array('name' => 'geos'),
|
||||
array('name' => 'setGeos', 'argument' => $geometry->geos()),
|
||||
array('name' => 'PointOnSurface'),
|
||||
array('name' => 'equals', 'argument' => $geometry),
|
||||
array('name' => 'equalsExact', 'argument' => $geometry),
|
||||
array('name' => 'relate', 'argument' => $geometry),
|
||||
array('name' => 'checkValidity'),
|
||||
array('name' => 'isSimple'),
|
||||
array('name' => 'buffer', 'argument' => '10'),
|
||||
array('name' => 'intersection', 'argument' => $geometry),
|
||||
array('name' => 'convexHull'),
|
||||
array('name' => 'difference', 'argument' => $geometry),
|
||||
array('name' => 'symDifference', 'argument' => $geometry),
|
||||
array('name' => 'union', 'argument' => $geometry),
|
||||
array('name' => 'simplify', 'argument' => '0'),
|
||||
array('name' => 'disjoint', 'argument' => $geometry),
|
||||
array('name' => 'touches', 'argument' => $geometry),
|
||||
array('name' => 'intersects', 'argument' => $geometry),
|
||||
array('name' => 'crosses', 'argument' => $geometry),
|
||||
array('name' => 'within', 'argument' => $geometry),
|
||||
array('name' => 'contains', 'argument' => $geometry),
|
||||
array('name' => 'overlaps', 'argument' => $geometry),
|
||||
array('name' => 'covers', 'argument' => $geometry),
|
||||
array('name' => 'coveredBy', 'argument' => $geometry),
|
||||
array('name' => 'distance', 'argument' => $geometry),
|
||||
array('name' => 'hausdorffDistance', 'argument' => $geometry),
|
||||
);
|
||||
|
||||
foreach($geosMethods as $method) {
|
||||
$argument = NULL;
|
||||
$method_name = $method['name'];
|
||||
if (isset($method['argument'])) {
|
||||
$argument = $method['argument'];
|
||||
}
|
||||
|
||||
switch ($method_name) {
|
||||
case 'isSimple':
|
||||
case 'equals':
|
||||
case 'geos':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
359
vendor/phayes/geophp/tests/tests/methodsTest.php
vendored
Normal file
359
vendor/phayes/geophp/tests/tests/methodsTest.php
vendored
Normal file
|
@ -0,0 +1,359 @@
|
|||
<?php
|
||||
require_once('../geoPHP.inc');
|
||||
class MethodsTests extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp() {
|
||||
|
||||
}
|
||||
|
||||
function testMethods() {
|
||||
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
|
||||
$parts = explode('.',$file);
|
||||
if ($parts[0]) {
|
||||
$format = $parts[1];
|
||||
$value = file_get_contents('./input/'.$file);
|
||||
echo "\nloading: " . $file . " for format: " . $format;
|
||||
$geometry = geoPHP::load($value, $format);
|
||||
|
||||
$methods = array(
|
||||
array('name' => 'area'),
|
||||
array('name' => 'boundary'),
|
||||
array('name' => 'getBBox'),
|
||||
array('name' => 'centroid'),
|
||||
array('name' => 'length'),
|
||||
array('name' => 'greatCircleLength'),
|
||||
array('name' => 'haversineLength'),
|
||||
array('name' => 'y'),
|
||||
array('name' => 'x'),
|
||||
array('name' => 'numGeometries'),
|
||||
array('name' => 'geometryN', 'argument' => '1'),
|
||||
array('name' => 'startPoint'),
|
||||
array('name' => 'endPoint'),
|
||||
array('name' => 'isRing'),
|
||||
array('name' => 'isClosed'),
|
||||
array('name' => 'numPoints'),
|
||||
array('name' => 'pointN', 'argument' => '1'),
|
||||
array('name' => 'exteriorRing'),
|
||||
array('name' => 'numInteriorRings'),
|
||||
array('name' => 'interiorRingN', 'argument' => '1'),
|
||||
array('name' => 'dimension'),
|
||||
array('name' => 'geometryType'),
|
||||
array('name' => 'SRID'),
|
||||
array('name' => 'setSRID', 'argument' => '4326'),
|
||||
);
|
||||
|
||||
foreach($methods as $method) {
|
||||
$argument = NULL;
|
||||
$method_name = $method['name'];
|
||||
if (isset($method['argument'])) {
|
||||
$argument = $method['argument'];
|
||||
}
|
||||
|
||||
$this->_methods_tester($geometry, $method_name, $argument, $file);
|
||||
}
|
||||
|
||||
$this->_methods_tester_with_geos($geometry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _methods_tester($geometry, $method_name, $argument, $file) {
|
||||
|
||||
if (!method_exists($geometry, $method_name)) {
|
||||
$this->fail("Method ".$method_name.'() doesn\'t exists.');
|
||||
return;
|
||||
}
|
||||
|
||||
switch ($method_name) {
|
||||
case 'y':
|
||||
case 'x':
|
||||
if (!$geometry->isEmpty()) {
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'geometryN':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'startPoint':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
//TODO: Add a method startPoint() to MultiLineString.
|
||||
//$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'endPoint':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
//TODO: Add a method endPoint() to MultiLineString.
|
||||
//$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name);
|
||||
}
|
||||
break;
|
||||
case 'isRing':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'isClosed':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'pointN':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
//TODO: Add a method pointN() to MultiLineString.
|
||||
//$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'exteriorRing':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'numInteriorRings':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'interiorRingN':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'SRID':
|
||||
break;
|
||||
case 'getBBox':
|
||||
if (!$geometry->isEmpty()) {
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'centroid':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'length':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertEquals($geometry->$method_name($argument), 0, 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotEquals($geometry->$method_name($argument), 0, 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotEquals($geometry->$method_name($argument), 0, 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'numGeometries':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'numPoints':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'dimension':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'boundary':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'haversineLength':
|
||||
//TODO: Check if output is a float >= 0.
|
||||
//TODO: Sometimes haversineLength() returns NAN, needs to check why.
|
||||
break;
|
||||
case 'greatCircleLength':
|
||||
case 'area':
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
break;
|
||||
case 'geometryType':
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
break;
|
||||
case 'setSRID':
|
||||
//TODO: The method setSRID() should return TRUE.
|
||||
break;
|
||||
default:
|
||||
$this->assertTrue($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function _methods_tester_with_geos($geometry) {
|
||||
// Cannot test methods if GEOS is not intstalled
|
||||
if (!geoPHP::geosInstalled()) return;
|
||||
|
||||
$methods = array(
|
||||
//'boundary', //@@TODO: Uncomment this and fix errors
|
||||
'envelope', //@@TODO: Testing reveales errors in this method -- POINT vs. POLYGON
|
||||
'getBBox',
|
||||
'x',
|
||||
'y',
|
||||
'startPoint',
|
||||
'endPoint',
|
||||
'isRing',
|
||||
'isClosed',
|
||||
'numPoints',
|
||||
);
|
||||
|
||||
foreach ($methods as $method) {
|
||||
// Turn GEOS on
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
$geos_result = $geometry->$method();
|
||||
|
||||
// Turn GEOS off
|
||||
geoPHP::geosInstalled(FALSE);
|
||||
$norm_result = $geometry->$method();
|
||||
|
||||
// Turn GEOS back On
|
||||
geoPHP::geosInstalled(TRUE);
|
||||
|
||||
$geos_type = gettype($geos_result);
|
||||
$norm_type = gettype($norm_result);
|
||||
|
||||
if ($geos_type != $norm_type) {
|
||||
$this->fail('Type mismatch on '.$method);
|
||||
$this->dump($geos_type);
|
||||
$this->dump($norm_type);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Now check base on type
|
||||
if ($geos_type == 'object') {
|
||||
$haus_dist = $geos_result->hausdorffDistance(geoPHP::load($norm_result->out('wkt'),'wkt'));
|
||||
|
||||
// Get the length of the diagonal of the bbox - this is used to scale the haustorff distance
|
||||
// Using Pythagorean theorem
|
||||
$bb = $geos_result->getBBox();
|
||||
$scale = sqrt((($bb['maxy'] - $bb['miny'])^2) + (($bb['maxx'] - $bb['minx'])^2));
|
||||
|
||||
// The difference in the output of GEOS and native-PHP methods should be less than 0.5 scaled haustorff units
|
||||
if ($haus_dist / $scale > 0.5) {
|
||||
$this->fail('Output mismatch on '.$method);
|
||||
$this->dump('GEOS : ');
|
||||
$this->dump($geos_result->out('wkt'));
|
||||
$this->dump('NORM : ');
|
||||
$this->dump($norm_result->out('wkt'));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($geos_type == 'boolean' || $geos_type == 'string') {
|
||||
if ($geos_result !== $norm_result) {
|
||||
$this->fail('Output mismatch on '.$method);
|
||||
$this->dump('GEOS : ');
|
||||
$this->dump((string) $geos_result);
|
||||
$this->dump('NORM : ');
|
||||
$this->dump((string) $norm_result);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//@@TODO: Run tests for output of types arrays and float
|
||||
//@@TODO: centroid function is non-compliant for collections and strings
|
||||
}
|
||||
}
|
||||
}
|
60
vendor/phayes/geophp/tests/tests/placeholdersTest.php
vendored
Normal file
60
vendor/phayes/geophp/tests/tests/placeholdersTest.php
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
require_once('../geoPHP.inc');
|
||||
class PlaceholdersTests extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp() {
|
||||
|
||||
}
|
||||
|
||||
function testPlaceholders() {
|
||||
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
|
||||
$parts = explode('.',$file);
|
||||
if ($parts[0]) {
|
||||
$format = $parts[1];
|
||||
$value = file_get_contents('./input/'.$file);
|
||||
echo "\nloading: " . $file . " for format: " . $format;
|
||||
$geometry = geoPHP::load($value, $format);
|
||||
|
||||
$placeholders = array(
|
||||
array('name' => 'hasZ'),
|
||||
array('name' => 'is3D'),
|
||||
array('name' => 'isMeasured'),
|
||||
array('name' => 'isEmpty'),
|
||||
array('name' => 'coordinateDimension'),
|
||||
array('name' => 'z'),
|
||||
array('name' => 'm'),
|
||||
);
|
||||
|
||||
foreach($placeholders as $method) {
|
||||
$argument = NULL;
|
||||
$method_name = $method['name'];
|
||||
if (isset($method['argument'])) {
|
||||
$argument = $method['argument'];
|
||||
}
|
||||
|
||||
switch ($method_name) {
|
||||
case 'hasZ':
|
||||
if ($geometry->geometryType() == 'Point') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'LineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
if ($geometry->geometryType() == 'MultiLineString') {
|
||||
$this->assertNotNull($geometry->$method_name($argument), 'Failed on ' . $method_name .' (test file: ' . $file . ')');
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
case 'z':
|
||||
case 'coordinateDimension':
|
||||
case 'isEmpty':
|
||||
case 'isMeasured':
|
||||
case 'is3D':
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue