Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default param coordinates to 3 @turf/truncate #757

Merged
merged 1 commit into from
May 26, 2017

Conversation

DenisCarriere
Copy link
Member

@turf/truncate coordinate param to 3

Change the default coordinates param from 2 to 3.

The GeoJSON spec suggests using 6 decimals & no more than 3 coordinates (z coordinate optional). This change prevents the "accident" (@stebogit) removal of the z coordinate.

http://geojson.org/geojson-spec.html#positions

A position is represented by an array of numbers. There must be at least two elements, and may be more. The order of elements must follow x, y, z order (easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). Any number of additional elements are allowed -- interpretation and meaning of additional elements is beyond the scope of this specification.

Example

const pt = point([50, 40, 1100, 3000]);
//= [x, y, z, m]

Before

truncate(pt);
//= [x, y]
//= [50, 40]

Now

truncate(pt);
//= [x, y, z]
//= [50, 40, 1100]

@DenisCarriere DenisCarriere added this to the 4.4.0 milestone May 25, 2017
@DenisCarriere DenisCarriere self-assigned this May 25, 2017
@DenisCarriere DenisCarriere merged commit 27fdadd into master May 26, 2017
@DenisCarriere DenisCarriere deleted the turf-truncate branch May 26, 2017 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant