Skip to content

Commit 912d23c

Browse files
committed
Added an Esri JSON Adapter. phayes#129 (merges PR phayes#129)
1 parent c1a7af6 commit 912d23c

File tree

2 files changed

+531
-0
lines changed

2 files changed

+531
-0
lines changed

geoPHP.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// Adapters
1111
include_once("lib/adapters/GeoAdapter.class.php"); // Abtract class
1212
include_once("lib/adapters/GeoJSON.class.php");
13+
include_once("lib/adapters/EsriJSON.class.php");
1314
include_once("lib/adapters/WKT.class.php");
1415
include_once("lib/adapters/EWKT.class.php");
1516
include_once("lib/adapters/WKB.class.php");
@@ -97,6 +98,8 @@ class geoPHP
9798
'wkb' => 'WKB',
9899
'ewkb' => 'EWKB',
99100
'json' => 'GeoJSON',
101+
'esrijson' => 'EsriJSON',
102+
'arcgis' => 'EsriJSON',
100103
'geojson' => 'GeoJSON',
101104
'kml' => 'KML',
102105
'gpx' => 'GPX',
@@ -257,6 +260,9 @@ class geoPHP
257260

258261
// Detect GeoJSON - first char starts with {
259262
if ($bytes[1] == 123) {
263+
if (strpos($input, 'esri') !== FALSE) {
264+
return 'esrijson';
265+
}
260266
return 'json';
261267
}
262268

0 commit comments

Comments
 (0)