terraformer-js / terraformer

A geographic toolkit for dealing with geometry, geography, formats, and building geodatabases
MIT License
182 stars 28 forks source link

`geojsonToArcGIS` has falsy checks for z-values #78

Closed rgwozdz closed 2 years ago

rgwozdz commented 2 years ago

Checks for z-values are falsy, and as result they don't evaluate as we'd hope if the z-value has a zero-value.

Imagine a coordinate array [-170, 42, 0] flowing through the following code:

if (geojson.coordinates[2]) {
  result.z = geojson.coordinates[2];
}

Since the z-coordinate is 0 the check evaluates to false and the result.z is never set.

jgravois commented 2 years ago

hey @rgwozdz! 👋

nice catch. i'm the sole maintainer of this lib and i don't use it for anything personally so a PR would be welcome.

if you have any trouble running tests locally or run into anything weird along the way, just holler. i'm happy to help.

rgwozdz commented 2 years ago

Cool, one of us will pick it up. Are you looking for additional maintainers? Given that we are using it, we could help out. Or if you want to move it to koop, that's always an option.

jgravois commented 2 years ago

Are you looking for additional maintainers? Given that we are using it, we could help out.

of course. the more the merrier!

move it to koop

I'm happy at the helm of the @terraformer-js ghost ship for now, but i'll definitely keep that offer in mind.

overall the code is pretty stable and external contributors like yourself are doing most of the work to pinpoint additional fixes and enhancements. my experience since moving it out of the @Esri org a couple years ago has been overwhelmingly positive.

jgravois commented 2 years ago

published as v2.1.1. thank you both!