{"id":19696163,"url":"https://github.com/mvtm-dn/shpfile","last_synced_at":"2026-05-13T11:34:13.894Z","repository":{"id":71392027,"uuid":"114960636","full_name":"mvtm-dn/shpFile","owner":"mvtm-dn","description":"Simple ESRI SHP file to GeoJSON convertor","archived":false,"fork":false,"pushed_at":"2019-01-23T07:13:19.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T14:24:14.188Z","etag":null,"topics":["esri-shp","geojson","parsed-shapes","parsing","shapefile"],"latest_commit_sha":null,"homepage":"","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/mvtm-dn.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":"2017-12-21T03:58:43.000Z","updated_at":"2019-01-23T07:13:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"aafda814-db49-4f89-b30c-f536147e96d9","html_url":"https://github.com/mvtm-dn/shpFile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mvtm-dn/shpFile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvtm-dn%2FshpFile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvtm-dn%2FshpFile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvtm-dn%2FshpFile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvtm-dn%2FshpFile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvtm-dn","download_url":"https://codeload.github.com/mvtm-dn/shpFile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvtm-dn%2FshpFile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32980812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T11:31:52.688Z","status":"ssl_error","status_checked_at":"2026-05-13T11:31:52.072Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["esri-shp","geojson","parsed-shapes","parsing","shapefile"],"created_at":"2024-11-11T19:34:09.200Z","updated_at":"2026-05-13T11:34:13.849Z","avatar_url":"https://github.com/mvtm-dn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shpFile\nVery simple ESRI SHP file to GeoJSON convertor. In fact parse subset of ESRI SHP. Now parsed next type of shapes:\n*  0 Null shape\n*  1 Point\n*  3 PolyLine\n*  5 Polygon\n*  8 MultiPoint\n* 11 PointZ\n* 15 PolygonZ\n\n# Installation\n\n```\nnpm install --save https://github.com/mvtm-dn/shpFile.git\n```\n\n\n# usage\n\nExample of usage:\n\n```\n    const shapeFile=require(\"shpFile\");\n\n    let geoJSONs=[];\n    shapeFile(filename).on(\"error\",(error)=\u003e{\n        console.log(\"Error open %s - %s\",filename,error);\n    })\n    .on(\"end\",(shapes)=\u003e{\n        console.log(\"Got %d shape(s)\",shapes.length);\n        for(let i=0;i\u003cthis.length;i+=1) {\n            geoJSONs.push(shapes.toGeoJSON(i));,\n        }\n    });\n    \n```\n## shapeFile object\n### methods\n\n`shapeFile(sources[,translate[,filter]])` Create parser object and start parsing shape file. Parameters\n* `sources` - either name of shape file or list `[\"name of shape file\", \"name of dbf file\"]`\n* `translate` - `proj4(..)` instance. Can be omitted. \n* `filter` - filter expression. If filter(shape)===false then shape don't append at resulting list\n\n`length` - returns numbers of readed objects\n`toString()` - returns string representation of shape file as a javascript Object\n`toGeoJSON([index])` - returns [GeoJSON](http://geojson.org/) representation of either of one of shape file object or all shapefile objects. \n\n### events\n`error` - emitted when the any error throws during parsing file. Passes along throwed error\n`end`  - emitted when shapes successfully parsed. Passes along shapeFile object reference.\n\n### shapes\n`shapeObject.shapes` is an array of parsed shapes. \n\n|Field | Value | Present in|\n|------|:-------:|:--------:|\n|type  | type of shape| 0,1,3,5,8,11,15|\n|points|array of points|1,3,5,8,11,15|\n|bbox  |bounding box|3,5,8,15|\n|parts |list of parts|3,5,15|\n|z|z value|11|\n|z|array of z values|15\n|m|m value|11|\n|zmin,zmax|zmin and zmax|15|\n### TODO\nTODO List\n* Extract m values for polylineZ\n* Parse rest of shape types\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvtm-dn%2Fshpfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvtm-dn%2Fshpfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvtm-dn%2Fshpfile/lists"}