mapbox-file-sniff

A Node module that detects the type of a spatial file and its protocol, such as shapefile, GPX, KML, GeoJSON or GeoTIFF. It is no longer actively maintained by Mapbox.

Share on XNo license declared

Overview

mapbox-file-sniff is a Node module that detects the type of a spatial file and the protocol used to open it. Recognized types include zipped and unzipped shapefiles, GPX, KML, GeoJSON, GeoTIFF, mbtiles, TileJSON, serialtiles, tm2z and CSV. The protocols match those used by tilelive. You pass in a buffer or a file and get the type back. Mapbox states the repository is no longer actively maintained.

Key features

  • Detects shapefile, GPX, KML, GeoJSON, GeoTIFF, CSV and more
  • Also recognizes mbtiles, TileJSON, serialtiles and tm2z
  • Returns a protocol name matching tilelive protocols
  • fromBuffer() sniffs a file from a buffer

Best for

Node developers who accept uploaded spatial files and must decide how to process each one. It is no longer actively maintained by Mapbox.

Upstream
mapbox/mapbox-file-sniff
Fork on GitHub
Guo-astro/mapbox-file-sniff
Upstream stars
14
Category
Maps and geospatial
Language
JavaScript
License
No license declaredWithout a license, the author keeps all rights. Ask the upstream owner before reusing the code.
Forked
2020-11-01
Sync status
In syncLast synced 2026-09-29