npm.io
0.0.3 • Published 5 years ago

geo-file-type

Licence
CC0-1.0
Version
0.0.3
Deps
10
Size
11 kB
Vulns
0
Weekly
0

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:

Keywords