Giter Site home page Giter Site logo

Comments (11)

allmondjoy87 avatar allmondjoy87 commented on June 15, 2024 1

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.

allmondjoy87 avatar allmondjoy87 commented on June 15, 2024 1

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.

jgravois avatar jgravois commented on June 15, 2024
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.

jgravois avatar jgravois commented on June 15, 2024

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.

jgravois avatar jgravois commented on June 15, 2024

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:

  1. clone the repo
  2. run npm install && npm test locally to ensure all is well
  3. add the relevant export in packages/spatial/src/index.js
  4. supplement that export with the JSDoc below
  5. run npm run doc to update the README for the spatial package to mention the new method
  6. run npm test again to confirm all is still well
  7. 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.

allmondjoy87 avatar allmondjoy87 commented on June 15, 2024

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.

jgravois avatar jgravois commented on June 15, 2024

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.

allmondjoy87 avatar allmondjoy87 commented on June 15, 2024
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.

jgravois avatar jgravois commented on June 15, 2024

Failing w/ 16x

hmmm, that's a surprise.

- 16
- 17

https://app.travis-ci.com/github/terraformer-js/terraformer/builds/251360143

from terraformer.

jgravois avatar jgravois commented on June 15, 2024

Well I'm having issues with npm install

i think what i did in #87 will fix your issue.

https://github.com/terraformer-js/terraformer/pull/87/files#diff-a2fe61aa17681ca122cfdd06603e7462426b0672cea3517deefdd96b6d4e3523R13

from terraformer.

jgravois avatar jgravois commented on June 15, 2024

released in v2.1.2.

from terraformer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.