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 linestring generation #13

Merged
merged 6 commits into from Dec 20, 2017
Merged

Add linestring generation #13

merged 6 commits into from Dec 20, 2017

Conversation

@samuelbosch
Copy link
Contributor

@samuelbosch samuelbosch commented Dec 20, 2017

Hi,

I've added the creation of random linestrings, code structure is based on https://github.com/node-geojson/geojson-random/ but I've changed some parts to use spherical math.

Best,

Samuel

@codecov-io
Copy link

@codecov-io codecov-io commented Dec 20, 2017

Codecov Report

Merging #13 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #13   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           7      9    +2     
  Lines         101    144   +43     
=====================================
+ Hits          101    144   +43
Impacted Files Coverage Δ
R/geo_polygon.R 100% <ø> (ø) ⬆️
R/wkt_polygon.R 100% <ø> (ø) ⬆️
R/to_wkt.R 100% <100%> (ø) ⬆️
R/geo_linestring.R 100% <100%> (ø)
R/wkt_linestring.R 100% <100%> (ø)
R/zzz.R 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64469d3...c638cc7. Read the comment docs.

Copy link
Member

@sckott sckott left a comment

looks good, just a few comments


for(j in seq_len(num_vertices-1)) {
bearing <- prior_bearing + runif(1, -0.5, 0.5) * max_rotation * 2
distance <- runif(1, max = max_length)

This comment has been minimized.

@sckott

sckott Dec 20, 2017
Member

can you do stats::runif here

#' Random WKT linestring
#'
#' @export

This comment has been minimized.

@sckott

sckott Dec 20, 2017
Member

nitpicky, but can you remove this empty line

#' the line, numeric vector of the form \code{west (long), south (lat), east
#' (long), north (lat)}. optional
#' @param fmt (integer/numeric) number of digits. Default: 7
#' @return WKT; a character vector with one or more POLYGON strings

This comment has been minimized.

@sckott

sckott Dec 20, 2017
Member

s/POLYGON/LINESTRING

@samuelbosch
Copy link
Contributor Author

@samuelbosch samuelbosch commented Dec 20, 2017

I've added an extra commit as there was an issue with the wkt, which this web app http://arthur-e.github.io/Wicket/sandbox-gmaps3.html happily ignored.

@samuelbosch
Copy link
Contributor Author

@samuelbosch samuelbosch commented Dec 20, 2017

Hi Scott,

I've added the requested changes.

Samuel

@sckott
sckott approved these changes Dec 20, 2017
@samuelbosch
Copy link
Contributor Author

@samuelbosch samuelbosch commented Dec 20, 2017

Sorry for all the extra commits, time to stop working for today.

@sckott sckott added this to the v0.3 milestone Dec 20, 2017
@sckott
Copy link
Member

@sckott sckott commented Dec 20, 2017

LGTM

thanks so much for this contribution

@sckott sckott merged commit fea1394 into ropensci:master Dec 20, 2017
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.