PHP Classes


Recommend this page to a friend!
  Classes of Karim Ratib   Esri Grid   Download  
Role: Documentation
Content type: text/plain
Description: Auxiliary data
Class: Esri Grid
Parse Esri Grid ASCII GIS files
Author: By
Last change: Update of
Date: 8 days ago
Size: 954 bytes


Class file image Download
# Esri ARC/INFO ASCII GRID reader Designed to handle large files. Tested with SRTM 90m Digital Elevation Data: ## Usage ### Single tile handling ```php <?php use infojunkie\EsriGrid; $max = -99999; $min = 100000; $file = new GridFile('test_dem1.txt'); $grid = $file->getGridFromPoints(0, 0, 140, 230, 'calc_stats'); echo "max: $max, min: $min\n"; var_dump($grid); function calc_stats($x, $y, $elevation) { global $max, $min; echo "$x, $y: $elevation\n"; if (!is_null($elevation)) { $max = max($max, $elevation); $min = min($min, $elevation); } } ?> ``` ### Multiple tile handling ```php <?php use infojunkie\EsriGrid; $files = new GridFiles(array( 'test_dem1.txt', 'test_dem2.txt', 'test_dem3.txt', 'test_dem4.txt', 'test_dem5.txt', 'test_dem6.txt', )); $grid = $files->getGridFromPoints(175, 225, 325, 675, 'calc_stats'); echo "max: $max, min: $min\n"; var_dump($grid); ?> ```