Comments (11)
aha!! I was getting "TypeError: Object(...) is not a function"
errors and assumed it was an issue with my converter function.
After digging a little deeper applyConverter
is missing in the exports section in the t-spatial.esm.js and t-spatial.umd.js files. I added it in my source code and everything's gravy.
from terraformer.
looks like this hasn't been updated yet, any chance someone can make the fix? is this something i can do? i've never contributed to a project before, unsure what the rules are.
from terraformer.
import { applyConverter } from '@terraformer/spatial'
// Runs the passed function against every Coordinate in the geojson object.
// Your function will be passed a Coordinate and will be expected to return a Coordinate.
applyConverter(geojson, yourFunction);
if someone is interested in adding JSDoc for the method to ensure it shows up in the documentation, that'd be welcome.
from terraformer.
if someone wants to export the utility function in the file below and add JSDoc, i'd be more than happy to publish the change.
https://github.com/terraformer-js/terraformer/blob/master/packages/spatial/src/index.js
from terraformer.
is this something i can do? i've never contributed to a project before, unsure what the rules are.
absolutely. to do this you'd just need to:
- clone the repo
- run
npm install && npm test
locally to ensure all is well - add the relevant
export
inpackages/spatial/src/index.js
- supplement that export with the JSDoc below
- run
npm run doc
to update the README for the spatial package to mention the new method - run
npm test
again to confirm all is still well - commit the result in your own branch and open up a PR
/**
* Runs the passed function against every Coordinate in the geojson object.
* @function
* @param {object} GeoJSON - The input [GeoJSON](https://tools.ietf.org/html/rfc7946) Geometry, Feature, GeometryCollection or FeatureCollection.
* @param {function} function - Your function will be passed a Coordinate and will be expected to return a Coordinate.
* @return {object} GeoJSON - [GeoJSON](https://tools.ietf.org/html/rfc7946) with altered coordinates.
* ```js
* import { applyConverter } from "@terraformer/spatial"
*
* applyConverter({
* type: "Point",
* coordinates: [ 45, 60 ]
* }, (coord) => [coord[0] + 1, coord[1] - 1])
*
* >> { type: "Point", coordinates: [ 46, 59 ] }
* ```
*/
from terraformer.
Well I'm having issues with npm-install
. Getting tarball and ultimately EINTEGRITY errors when it tries to install jison@git+ssh.
lerna ERR! npm install exited 1 in '@terraformer/wkt'
lerna ERR! npm install stderr:
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN tarball tarball data for jison@git+ssh://[email protected]/GabrielRatener/jison.git#2668d7efbb628c763dc7cce41ab24a4632528942 (sha512-NHThbqidF4gPr4YwTd6MUFqGiUdWbYqcBAFH1gPYWaLmoHWafH/kCGjDmJkFKEV2XkeWAyODEBT95mzZVa67sA==) seems to be corrupted. Trying again.
npm WARN tarball tarball data for jison@git+ssh://[email protected]/GabrielRatener/jison.git#2668d7efbb628c763dc7cce41ab24a4632528942 (sha512-NHThbqidF4gPr4YwTd6MUFqGiUdWbYqcBAFH1gPYWaLmoHWafH/kCGjDmJkFKEV2XkeWAyODEBT95mzZVa67sA==) seems to be corrupted. Trying again.
npm ERR! code EINTEGRITY
npm ERR! sha512-NHThbqidF4gPr4YwTd6MUFqGiUdWbYqcBAFH1gPYWaLmoHWafH/kCGjDmJkFKEV2XkeWAyODEBT95mzZVa67sA== integrity checksum failed when using sha512: wanted sha512-NHThbqidF4gPr4YwTd6MUFqGiUdWbYqcBAFH1gPYWaLmoHWafH/kCGjDmJkFKEV2XkeWAyODEBT95mzZVa67sA== but got sha512-ZBsVuTEO3DrliKB3f8FABrVAz6p2fazutqBn3inowySvzbUEfvJc9tF+fwvBX1WJm58FeU2rVRg6i3USFrNYeg==. (33143 bytes)
However I saw you very recently made a branch "patch-68" that looks like it handles the fix! Whats up with that?
from terraformer.
if you use Node.js 16x or 17x, the install should succeed.
patch-68
can't be merged as is. it has a bunch of unrelated whitespace changes.
from terraformer.
node --version
v16.14.0
Failing w/ 16x. npm cache verify
and npm cache clean --force
didn't help either.
I'll update to 17x and give it a shot.
from terraformer.
Failing w/ 16x
hmmm, that's a surprise.
Lines 5 to 6 in 0d8379a
https://app.travis-ci.com/github/terraformer-js/terraformer/builds/251360143
from terraformer.
Well I'm having issues with
npm install
i think what i did in #87 will fix your issue.
from terraformer.
released in v2.1.2
.
from terraformer.
Related Issues (20)
- the JSDoc for a few functions and constants aren't making it to the README
- Primitive.prototype.convexHull does not support GeometryCollection
- add performance benchmarks
- typescript typings HOT 3
- The type field of the Geometry class is missing in @terraformer/arcgis HOT 2
- Add support for Z values HOT 2
- wire up github actions to run tests HOT 1
- Typescript typings for @terraformer/wkt HOT 1
- Is there any replacement for Terraformer Core and Geostore? HOT 4
- polygonContainsPoint returns false for intersections. Is this intended? HOT 5
- Support Typescript HOT 1
- [typescript] PR review request for adding types into DefinitelyTyped
- `geojsonToArcGIS` has falsy checks for z-values HOT 4
- wkt not support GEOMETRYCOLLECTION HOT 4
- Error with "intersects" method when using Feature Collections. HOT 6
- intersects has unexpected result with multipolygon geometry HOT 3
- this.parseError is not a function HOT 2
- invalid type signature for arcgisToGeoJSON HOT 4
- Allow for a possibility to override standard SRS warning HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraformer.