{"id":22290358,"url":"https://github.com/mbloch/mapshaper-proj","last_synced_at":"2025-04-06T03:11:58.135Z","repository":{"id":57303627,"uuid":"62059448","full_name":"mbloch/mapshaper-proj","owner":"mbloch","description":"A JavaScript port of the Proj.4 map projection library.","archived":false,"fork":false,"pushed_at":"2024-11-19T19:58:38.000Z","size":2128,"stargazers_count":38,"open_issues_count":7,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T02:07:54.911Z","etag":null,"topics":["datum","epsg","proj4","projection"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbloch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-06-27T13:46:27.000Z","updated_at":"2024-11-19T19:58:38.000Z","dependencies_parsed_at":"2024-01-12T01:15:00.731Z","dependency_job_id":"f8698624-b12c-46ab-a5d0-ca202d35b308","html_url":"https://github.com/mbloch/mapshaper-proj","commit_stats":{"total_commits":126,"total_committers":1,"mean_commits":126.0,"dds":0.0,"last_synced_commit":"bab6e153d2954a7cc6257e2ea907f26075ae269a"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbloch%2Fmapshaper-proj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbloch%2Fmapshaper-proj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbloch%2Fmapshaper-proj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbloch%2Fmapshaper-proj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbloch","download_url":"https://codeload.github.com/mbloch/mapshaper-proj/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427012,"owners_count":20937214,"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":["datum","epsg","proj4","projection"],"created_at":"2024-12-03T17:12:35.588Z","updated_at":"2025-04-06T03:11:58.118Z","avatar_url":"https://github.com/mbloch.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# mapshaper-proj\n\nThis software is a JavaScript port of v4.9.3 of the [Proj.4](http://proj4.org/) map projection library. Although it was created to be used by [mapshaper](https://github.com/mbloch/mapshaper), all are welcome to use and improve it.\n\nWhy create another Proj.4 port, when there is already [proj4js](https://github.com/proj4js/proj4js)? Unlike proj4js, this port is a very literal translation to JavaScript, so staying up-to-date with future changes to Proj.4 should be relatively simple. Also, this software's output is more consistent with Proj.4's output.\n\n##### Missing features\n\n* No support for datum transformations using grid files.\n\n* About 1/5 of Proj.4's 130-odd projections have not been ported.\n\n\n## Command line programs: mproj and mcs2cs\n\nThese are workalike versions of the `proj` and `cs2cs` programs from Proj.4.\n\nTo install the current versions system-wide, run `npm install -g mproj`.\n\n\n## Node API\n\nThe software can be used in either the Proj.4 style or the proj4js style.\n\n##### proj4js style\n\n```\nvar proj = require('mproj');\n# create functions for translating between two coordinate systems\n# returned object has forward() and inverse() functions\nvar obj = proj(\u003csource definition\u003e, \u003cdest definition\u003e);\n\n# WGS84 is assumed if a source definition is not given\nvar obj = proj(\u003cdest definition\u003e);\n\n# a shortcut for translating a single point\n# \u003cpoint\u003e is an [x, y] array or an object with x and y properties\nvar xy = proj([\u003csource definition\u003e,] dest definition, \u003cpoint\u003e);\n```\n\nSee the [proj4js.org website](http://proj4js.org/) for more detailed help.\n\n##### Proj.4 style\n\n```\nvar proj = require('mproj');\n# create a projection object from a proj4 string\nvar P = proj.pj_init(\u003cproj4 crs definition\u003e);\n\n# project and inverse-project geographical coordinates\nvar xy = proj.pj_fwd({lam: \u003clongitude in radians\u003e, phi: \u003clatitude in radians\u003e}, P);\nvar lp = proj.pj_inv({x: \u003ceasting in meters\u003e, y: \u003cnorthing in meters\u003e}, P);\n\n# transform arrays of coordinates from one coordinate system to another\nproj.pj_transform(\u003csource crs\u003e, \u003cdest crs\u003e, \u003cx array\u003e, \u003cy array\u003e[, \u003cz array\u003e]);\n```\n\n##### Error handling\nThe x and y coordinates of unprojectable points are set to `Infinity`. Other errors cause an Error to be thrown containing an appropriate message.\n\n\n## Building\n\nmapshaper-proj uses the (old-fashioned) technique of concatenating source files and wrapping them in a function to create a  module with a shared scope. This method allows for global variables that are invisible outside of the program, making porting from the original C much simpler than if we were to make each source file a separate module.\n\nRunning `build` creates a build containing all supported projections in the `dist/` directory.\n\nRunning `build merc,lcc,aea` creates a build containing only the listed projections. You can customize the comma-separated list to include only the projections that you want. Run `mproj -l` to see a list of all supported projections.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbloch%2Fmapshaper-proj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbloch%2Fmapshaper-proj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbloch%2Fmapshaper-proj/lists"}