PHP Classes

Esri Grid: Parse Esri Grid ASCII GIS files

Recommend this page to a friend!
  Info   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (4 days ago) RSS 2.0 feedNot enough user ratingsTotal: 166 This week: 1All time: 8,866 This week: 348Up
Version License PHP version Categories
esrigrid 1.0.9GNU General Publi...5.2PHP 5, Geography, Parsers
Description 

Author

This class can parse Esri Grid ASCII GIS files.

It can open and parse an ASCII file defined the Esri grid format with attributes like elevation and surface slope within a grid that is associated to a rectangle in a certain geographic area.

The class can traverse the file to extract the information within a rectangle given its start and end X and Y coordinates.

It can handle large grid files like the SRTM 90m Digital Elevation Data.

The class can invoke a callback function that can process the attribute values for each position in the selected grid area.

Innovation Award
PHP Programming Innovation award nominee
November 2013
Number 8
Esri grid files are files that can be used to describe terrain attributes for a given geographic region.

This class can parse Esri grid files to extract the details of the information they contain.

Manuel Lemos
Picture of Karim Ratib
Name: Karim Ratib <contact>
Classes: 1 package by
Country: Canada Canada
Innovation award
Innovation award
Nominee: 1x

Details

# Esri ARC/INFO ASCII GRID reader Designed to handle large files. Tested with SRTM 90m Digital Elevation Data: http://srtm.csi.cgiar.org/. ## 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); ?> ```

  Files folder image Files  
File Role Description
Files folder imagelib (1 directory)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file LICENSE.txt Doc. Documentation
Accessible without login Plain text file README.md Doc. Auxiliary data

  Files folder image Files  /  lib  
File Role Description
Files folder imageinfojunkie (1 directory)

  Files folder image Files  /  lib  /  infojunkie  
File Role Description
Files folder imageEsriGrid (3 files)

  Files folder image Files  /  lib  /  infojunkie  /  EsriGrid  
File Role Description
  Plain text file Exception.php Class Auxiliary script
  Plain text file GridFile.php Class Class source
  Plain text file GridFiles.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imagedata (6 files)
Files folder imageunit (1 directory)
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Accessible without login Plain text file phpunit.xml Data Auxiliary data

  Files folder image Files  /  tests  /  data  
File Role Description
  Accessible without login Plain text file test_dem1.txt Data Documentation
  Accessible without login Plain text file test_dem2.txt Data Documentation
  Accessible without login Plain text file test_dem3.txt Data Documentation
  Accessible without login Plain text file test_dem4.txt Doc. Documentation
  Accessible without login Plain text file test_dem5.txt Data Documentation
  Accessible without login Plain text file test_dem6.txt Data Documentation

  Files folder image Files  /  tests  /  unit  
File Role Description
Files folder imagelib (1 directory)

  Files folder image Files  /  tests  /  unit  /  lib  
File Role Description
Files folder imageinfojunkie (1 directory)

  Files folder image Files  /  tests  /  unit  /  lib  /  infojunkie  
File Role Description
Files folder imageEsriGrid (1 file)

  Files folder image Files  /  tests  /  unit  /  lib  /  infojunkie  /  EsriGrid  
File Role Description
  Accessible without login Plain text file BasicTest.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:166
This week:1
All time:8,866
This week:348Up