{"id":16694032,"url":"https://github.com/haoliangyu/gtran-shapefile","last_synced_at":"2025-04-10T01:33:14.861Z","repository":{"id":2260887,"uuid":"46098207","full_name":"haoliangyu/gtran-shapefile","owner":"haoliangyu","description":"convert geojson to shapefile and backwards","archived":false,"fork":false,"pushed_at":"2025-02-19T18:26:13.000Z","size":227,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T03:11:29.560Z","etag":null,"topics":["conversion","geojson","shapefile"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haoliangyu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-13T03:41:11.000Z","updated_at":"2025-02-19T18:26:09.000Z","dependencies_parsed_at":"2024-06-19T05:28:16.544Z","dependency_job_id":"4f47e21f-8844-45f9-8d54-6aeb777d4f71","html_url":"https://github.com/haoliangyu/gtran-shapefile","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haoliangyu%2Fgtran-shapefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haoliangyu%2Fgtran-shapefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haoliangyu%2Fgtran-shapefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haoliangyu%2Fgtran-shapefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haoliangyu","download_url":"https://codeload.github.com/haoliangyu/gtran-shapefile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247959797,"owners_count":21024842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conversion","geojson","shapefile"],"created_at":"2024-10-12T16:43:31.868Z","updated_at":"2025-04-10T01:33:14.833Z","avatar_url":"https://github.com/haoliangyu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gtran-shapefile\n\n[![NPM Version](https://img.shields.io/npm/v/gtran-shapefile.svg)](https://www.npmjs.com/package/gtran-shapefile) [![Build Status](https://travis-ci.org/haoliangyu/gtran-shapefile.svg?branch=master)](https://travis-ci.org/haoliangyu/gtran-shapefile)\n\nconvert geojson to shapefile and backwards\n\n## Installation\n\n```javascript\nnpm install gtran-shapefile\n```\n\n## Functions\n\n* **setPromiseLib(object)**\n\n    Specify the promise library. If not, the library will use the native Promise.\n\n* **fromGeoJson(geojson, fileName, options)**\n\n    Save the geojson into the given file name.\n\n    Options:\n\n    * **esriWKT**: ESRI WTK string that specifies the shapefile's spatial reference and generates .prj file. It could be found at [SpatialReference.org](http://spatialreference.org/).\n\n\n* **toGeoJson(fileName)**\n\n    Read the given file and convert it into geojson.\n\n## Use Example\n\n```javascript\nvar shp = require('gtran-shapefile');\n\n// if specific promise library is needed\nshp.setPromiseLib(require('bluebird'));\n\n// Read shapefile\nshp.toGeoJson('source.shp')\n.then(function(object) {\n    var geojson = object;\n});\n\n// Save geojson into shapefile\nshp.fromGeoJson(geojson, 'point.shp', {\n  // ESRI WKT string of WGS84\n  esriWKT: 'GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]'\n})\n.then(function(fileNames) {\n    console.log('files have been saved at:' + fileNames);\n});\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaoliangyu%2Fgtran-shapefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaoliangyu%2Fgtran-shapefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaoliangyu%2Fgtran-shapefile/lists"}