Giter Site home page Giter Site logo

mcanthony / filegdb.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from calvinmetcalf/filegdb.js

1.0 2.0 0.0 24.56 MB

parse a file GDB

Home Page: http://calvinmetcalf.github.io/fileGDB.js

License: MIT License

JavaScript 98.86% HTML 0.34% CSS 0.79%

filegdb.js's Introduction

fileGDB.js

Implementing this amazing reverse engineering by rouault in JavaScript

Produces valid geojson with coordinates converted to wgs84.

build with npm run build, build the site with npm run site

all ways of calling it return the same thing, an object with keys being feature class names and values being geojson.

either give it a path, in node to a .gdb folder or in the browser to a zipped .gdb file.

var fgdb = require('fgdb');
fgdb('path/to/something.gdb(.zip)').then(function(objectOfGeojson){
	//do something
},function(error){
	//do something else
});

in the browser you can also just pass a fileList aka from something like this:

<input id="upload" class="upStuff" type='file' webkitdirectory directory multiple></input>

which in chrome they can select a folder, or in other browsers they can select all the files inside the folder.

document.getElementById("upload").addEventListener("change", function() {
	fgdb(fileInput.files).then(function(objectOfGeojson){
		//do something
	},function(error){
		//do something else
	});
});

Both the browser and node will accept a buffer (node Buffer or ArrayBuffer) for a zipped .gdb, that simply returns the object.

todo:

  • Figure out how feature names are stored in the database
  • zipped files
  • Faster
  • put it in a web worker or maybe in multiple web workers
  • Promises, promises can fit in here somehow

not a high priority:

  • Anything projections beyond wgs84 all of the things.
  • M coordinates
  • MultiPatch, curves or type of feature that doesn't translate to GeoJSON
  • Support for browsers that aren’t the two more recent versions

filegdb.js's People

Contributors

calvinmetcalf avatar rouault avatar sainsb avatar

Stargazers

Michael Anthony avatar

Watchers

Michael Anthony avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.