Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Takes GeoJSON in one projection/CRS and transforms, or reprojects, it to another.
install:
$ npm install -g reproject
use:
$ echo '{"type":"Point","coordinates":[319180, 6399862]}' | reproject --crs-defs=crs-defs.json --from=EPSG:3006 --to=EPSG:4326
A sample file of CRS definitions, crs-defs.json, is supplied. Its contents is a dictionary of CRS names to Proj4 definitions.
reproject can be used together with for example wellknown and geojsonio-cli:
$ echo "POINT(319180 6399862)" | wellknown | reproject --crs-defs=crs-defs.json --from=EPSG:3006 --to=EPSG:4326 | geojsonio
Sometimes your data has reversed the axis order such that x has become y and vice versa. reproject can help you get them in the correct order before transforming by using the --reverse argument:
$ echo '{"type":"Point","coordinates":[6399862, 319180]}' | reproject --reverse --crs-defs=crs-defs.json --from=EPSG:3006 --to=EPSG:4326
reproject currently only works with node.js, since proj4node, which reproject relies on, does not play nice with for example browserify. Installation is easy with npm:
npm install reproject
Reprojects the given GeoJSON from the CRS given in from to the CRS given in to.
The from and to arguments can either be a proj4node projection object, or a string containing a CRS name. In the case of a CRS name, the proj4node projection instance is looked up using the crss argument. crss is assumed to be a dictionary of projection names to proj4node objects.
If from is left undefined or null, the CRS will be detected from the GeoJSON's crs property and looked up in the crss dictionary.
Shortcut equivalent to
reproject(geojson, from, proj4node.WGS84, crss)
Detects the CRS defined in the given GeoJSON and returns the corresponding proj4node projection instance from crss. If no CRS is defined in the GeoJSON, or the defined CRS isn't present in crss, an error is thrown.
Reverses the axis order of the coordinates in the given GeoJSON, such that x becomes y and y becomes x.
FAQs
Reproject GeoJSON from one projection/CRS to another
We found that reproject demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.