Skip to content

Commit

Permalink
Added an Esri JSON Adapter. phayes#129 (merges PR phayes#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
itamair committed Feb 4, 2023
1 parent c1a7af6 commit 912d23c
Show file tree
Hide file tree
Showing 2 changed files with 531 additions and 0 deletions.
6 changes: 6 additions & 0 deletions geoPHP.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// Adapters
include_once("lib/adapters/GeoAdapter.class.php"); // Abtract class
include_once("lib/adapters/GeoJSON.class.php");
include_once("lib/adapters/EsriJSON.class.php");
include_once("lib/adapters/WKT.class.php");
include_once("lib/adapters/EWKT.class.php");
include_once("lib/adapters/WKB.class.php");
Expand Down Expand Up @@ -97,6 +98,8 @@ class geoPHP
'wkb' => 'WKB',
'ewkb' => 'EWKB',
'json' => 'GeoJSON',
'esrijson' => 'EsriJSON',
'arcgis' => 'EsriJSON',
'geojson' => 'GeoJSON',
'kml' => 'KML',
'gpx' => 'GPX',
Expand Down Expand Up @@ -257,6 +260,9 @@ class geoPHP

// Detect GeoJSON - first char starts with {
if ($bytes[1] == 123) {
if (strpos($input, 'esri') !== FALSE) {
return 'esrijson';
}
return 'json';
}

Expand Down
Loading

0 comments on commit 912d23c

Please sign in to comment.