Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

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

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 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
Contributor

@sckott sckott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do stats::runif here

#' Random WKT linestring
#'
#' @export

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/POLYGON/LINESTRING

@samuelbosch
Copy link
Contributor Author

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

Hi Scott,

I've added the requested changes.

Samuel

@samuelbosch
Copy link
Contributor Author

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
Contributor

sckott commented Dec 20, 2017

LGTM

thanks so much for this contribution

@sckott sckott merged commit fea1394 into ropensci-archive:master Dec 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants