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

Add ability to change coordinate precision when converting between formats #18

Closed
wants to merge 4 commits into from

Conversation

jczaplew
Copy link

I often find it desirable to trim the precision of coordinates to make the result more compact, and it is most convenient to do this within wellknown itself. I understand that it adds to the code footprint a bit, but it is hopefully unobtrusive and adds flexibility.

Thanks for putting together this module! I find it incredibly useful.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.49%) when pulling 1b84426 on jczaplew:master into 6337942 on mapbox:master.

@jczaplew
Copy link
Author

Before the Trace CI build was failing because of an error I introduced, but now it fails because of a preexisting error somewhere Bad response: 422 {"message":"Couldn't find a repository matching this job.","error":true}.

I cloned a fresh copy of this repo, ran the tests, and got the same error, so I don't think it was introduced with any of my commits.

@tmcw
Copy link
Contributor

tmcw commented Sep 30, 2014

Trimming coordinates is a different task than parsing/unparsing, and it's task common to many parsers (wellknown, tokml, togeojson, ogr2ogr) that would be better served by a separate module. Such that, on the cli, you could

wellknown foo.wkt | geojson-precision 9

And in js you would

geojsonPrecision(wellknown(foo), 9);

@tmcw tmcw closed this Sep 30, 2014
@jczaplew
Copy link
Author

jczaplew commented Oct 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants