1.0.0 • Published 2 years ago

infokartasplitdxfjson v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

GeoConvert

Converting between Geojson and GIS file formats

KML(KMZ), GPX, Shapefile, DXF(unfinished), WKT(unfinished)

Rreference the JavaScript file manually:

<script src="dist/GeoConvert.min.js"></script>

Note that coordinate transformations depend on proj4.js (this means proj4.js must be included before including the file).

<script src="lib/proj4.js"></script>

Usage

kml to geojson

GeoConvert.kml2Geojson(kml);

geojson to kml

GeoConvert.geojson2Kml(geojson);

gpx to geojson

GeoConvert.gpx2Geojson(kml);

geojson to gpx

GeoConvert.geojson2Gpx(geojson);

shapefile to geojson

//shapefile is a object that contain shp, dbf [arrayBuffer], prj? [string]
var shapefile = {};
shapefile.shp = arrayBuffer_shp;
shapefile.dbf = arrayBuffer_dbf;

//optional
shapefile.prj = string_prj;

GeoConvert.shapefile2Geojson(shapefile);

wkt to geojson

GeoConvert.wkt2Geojson(wkt);