geo-file-type
v0.0.3
Published
Detect the Types of Geospatial Input, including ASCII Grid, Auxiliary XML, GeoTIFF, JPG, PNG, SHP (Shapefile), and World File
Downloads
15
Maintainers
Readme
geo-file-type
Detect the Types of Geospatial Input, including ASCII Grid, Auxiliary XML, GeoTIFF, JPG, PNG, SHP (Shapefile), and World File
features
- Memory Safe: avoids loading the whole file into memory
usage
const geoFileType = require("geo-file-type");
const fs = require("fs");
const buffer = fs.readFileSync("./data/chattanooga.shp");
const result = geoFileType({
data: buffer,
debug: false // set debug to true for extra logging
});
// result is { type: "SHP (Shapefile)" }
file types
| Name | Supported | | ---- | --------- | | ASCII Grid | Yes | | Auxiliary XML| Yes | | Cloud Optimized GeoTIFF | Yes | | GeoRaster | Yes | | GeoJSON | No | | GeoTIFF | Yes | | NetCDF | Yes | | JPG | Yes | | PNG | Yes | | PRJ | Yes | | SHP (Shapefile) | Yes | | TopoJSON | No | | World File | Yes |
further reading:
If you'd like to learn more about the formats, please consult the following:
- ASCII Grid: https://en.wikipedia.org/wiki/Esri_grid
- Cloud Optimized GeoTIFF: https://www.cogeo.org/
- GeoTIFF: https://en.wikipedia.org/wiki/GeoTIFF
- GeoRaster: https://github.com/geotiff/georaster
- GeoJSON: https://geojson.org/
- JPG: https://en.wikipedia.org/wiki/JPEG
- PNG: https://en.wikipedia.org/wiki/Portable_Network_Graphics
- NetCDF: https://en.wikipedia.org/wiki/NetCDF
- TopoJSON: https://github.com/topojson/topojson
- World File: https://en.wikipedia.org/wiki/World_file