Displaying 20 results from an estimated 61 matches for "polylines".
Did you mean:
polyline
2018 Jan 30
2
Calculating angle of a polyline
Dear R users
I am trying to find a formula to calculate the angle of a polyline. Is
there a way to do this?
Many thanks.
--
Best Regards
Javad Bayat
M.Sc. Environment Engineering
Alternative Mail: bayat194 at yahoo.com
[[alternative HTML version deleted]]
2018 Jan 30
2
Calculating angle of a polyline
Assuming your polyline is defined by two vectors, one for the x
coordinates, one for the y coordinates, you can try the following
library(NISTunits)
polyangles <- function(xV,yV) {
stopifnot( (length(xV)==length(yV)) && (length(xV) >= 3))
v <- function(i) { c( xV[i]-xV[i-1], yV[i]-yV[i-1])}
vlen <- function(v) { sqrt(sum(v*v)) }
lV <- rep(NA_real_,length(xV))
for
2018 Jan 30
0
Calculating angle of a polyline
A polyline by definition has many angles, so your question is ill-formed. And this is a question about math, not R, so is off topic here. I suggest reading Wikipedia.
--
Sent from my phone. Please excuse my brevity.
On January 29, 2018 11:10:02 PM PST, javad bayat <j.bayat194 at gmail.com> wrote:
>Dear R users
>I am trying to find a formula to calculate the angle of a polyline. Is
2009 Mar 17
0
removeEventListener and polylines
...iously added with the method addEventListener. I found nothing on the documention so I coded a removeEventListener method. If you think it will be useful I can post it (but as i said I''m a newbie to both Javascript and Mapstraction so it can be ful of errors :) )
Another question is about polylines. Is there a way to remove a polyline with the method removePolyline if it was previously added with addPolyline(polyline,true) ?
The problem lies in the boolean parameter : if it is true the polyline object is not added to polylines array so the remove method won''t delete anything.
Thank...
2007 Jul 13
0
layers of polylines, events building up on map
...;s my situation:
I have a little route creation app that lets a user create a route.
I''m using the mapstraction version of ym4r...
here is the workflow:
first page has a map displaying the start point of existing routes.
if they click "new route:
creates a route_object
clears all polylines in case there are any
clears all the markers and adds an onclick event.
for each click I:
clear all polylines with RJS
add point to the waypoint table (with route_id)
select all waypoints for the route and build a polyline
display the polyline
that all works fine....
but if I hit...
2018 Jan 30
0
Calculating angle of a polyline
I like to use complex numbers for 2-dimensional geometry. E.g.,
> polyAngles2
function (xV, yV)
{
stopifnot((length(xV) == length(yV)) && (length(xV) >= 3))
z <- complex(re = xV, im = yV)
c(NA, diff(Arg(diff(z))), NA) # radians, positive is counter-clockwise
}
> x <- c(0:3)
> y <- c(0,0,1,1)
> polyAngles2(x,y) / pi * 180
[1] NA 45 -45 NA
Bill
2007 Jul 25
1
regarding polylines
hi all, i am experimenting with ym4r mapstraction, i am using yahoo api
, when i tried polylines , its not showing up.. the code is
var map;
window.onload = addCodeToFunction(window.onload,function() {
map = new Mapstraction("map_div","yahoo");
map.setCenterAndZoom(new LatLonPoint(37.3853,-122.0172
),12);map.addSmallControls();
map.addMarkerGroup(new MarkerGroup([addDa...
2011 Nov 22
5
x, y for point of intersection
Hi everyone,
?
I am trying to get a point of intersection between a
polyline and a straight line ?.. and get the x and y coordinates of this point.
For exemplification consider this:
?
?
set.seed(123)
?
k1 <-rnorm(100, mean=1.77, sd=3.33)
?k1 <- sort(k1)
q1 <- rnorm(100, mean=2.37, sd=0.74)
q1 <- sort(q1, decreasing = TRUE)
plot(k1, q1, xlim <- c((min(k1)-5),
2023 Mar 26
0
Inconsistency in grid::grid.polyline
Hi
The general "evolution" of grid.*() functions (that I have written) have
tended towards the grid.polyline() style ...
grid.*(...) {
grid.draw(*Grob(...))
}
With my thinking at least heading towards: if you are calling grid.*(),
then you want to actually draw something; if you want to just create a
description of something to draw, then you want to call *Grob().
In other
2009 Feb 02
0
Polyline toMicrosoft() change
Hi guys at mapstraction,
I made a change in the Polyline.toMicrosoft() function, in order to have
all the power that a VEShape has, for instance fill color. Below is the new
code, if you want to use it, change it, or whatever.
Cheers,
Beta
/**
* toMicrosoft returns a Microsoft polyline
* @returns a VEShape
*/
Polyline.prototype.toMicrosoft = function() {
var mpolyline;
var mpoints
2010 Apr 30
6
addListener
I am trying to use the marker method addlistener(). A simplified version
of what I''m trying to do:
var map;
var marker;
map = new mxn.Mapstraction(''myMap'',''google'');
map.setCenterAndZoom(new mxn.LatLonPoint(45.559242,-122.636467),
15);
marker = new mxn.Marker(new mxn.LatLonPoint(45.559242,
2009 Mar 04
5
Detect polyline relationship to map bounds?
...extends the radius beyond the
visible edges of the map and adjust the zoom level. I''m not seeing
how to test this when redrawing the circle. I thought maybe I wanted
to use polylineCenterAndZoom() but that is zooming out to the whole
earth even though I haven''t added any polylines besides the filtering
circle.
I have been digging around a bit, and I''m stumped. Any guidance would
be greatly appreciated.
Joe
PS Mapstraction is incredible!
--
Joe Germuska
Joe at Germuska.com * http://blog.germuska.com
"I felt so good I told the leader how to follow.&quo...
2004 Feb 26
1
writing polygons/segments to shapefiles (.shp) or other A rcGIS compatible file
The main limitation of the shapefiles package that I put together is that it
does not create shapefiles from R objects - rather it only writes shapefiles
that have been read into R and manipulated within the constraints of the
existing file structure. By this I mean that for example you can change the
coordinates of points and write them back out. Or you can add a bunch of
blank columns in the
2009 Jun 01
0
[mapstraction commit] r12 - Implemented most Cloudmade functions. Still requires image, tile and KML/GeoRSS overlays
Author: duvander
Date: Sun May 31 17:34:27 2009
New Revision: 12
Modified:
trunk/source/mxn.cloudmade.core.js
Log:
Implemented most Cloudmade functions. Still requires image, tile and
KML/GeoRSS overlays
Modified: trunk/source/mxn.cloudmade.core.js
==============================================================================
--- trunk/source/mxn.cloudmade.core.js (original)
+++
2007 Apr 04
5
how to image.plot a XY grid file into a lat-lon map
Hi All,
I have a netcdf gridded file with LCC projection. I can easily use
image.plot to visualize it. However, as the axises are in X,Y, not Lat and
Lon, I could not add state or country maps onto it (or lat lon information).
I do have a grid2d file that describes the lat and lon for each (X,Y) grid,
but the lat and lon are not regularly spaced, so I could not use image.plot.
Does anyone know
1999 Apr 17
1
Maps in R
Apologies in advance from an R newbie if this is a dumb question. Is it
possible to produce choropleth maps in R? I gather from some nice research
papers on the AT&T (sorry, Lucent) S web site that in S (and S Plus) there
is a map() function which uses arrays of polylines and regions to draw map
borders and then fill them with patterns or shades according to some scalar
quantity. We currently produce such maps (of disease rates) using PROC GMAP
in SAS/GRAPH which also uses the same sort of polyline format for definition
of the areas. The problem in SAS is that altho...
2002 Nov 21
1
Distance between points and a polygon?
Dear R users,
I know that this could easily be solved within a GIS-package, but
sometimes it's more convenient to use R. So here's my question anyway...
Does anyone of you know about any R-functions/code that calculates the
distance between a number points and a polygon or polyline? I have
looked thru the different libraries that deals with spatial statistics
but haven't found
2005 Sep 06
0
Revised shapefiles package
Now available on CRAN is a revised version of the shapefiles package for
reading and writing shapefiles in R. New additions, courtesy of others,
include the ability to convert a simple R data frame of points,
polylines or polygons to a shp format list, which can then be written
out to a shapefile with write.shp. There is also a function to convert
the read.shp shp format list to a simple data frame as well. In
addition, there is a basic implementation of the Douglas-Peucker
polyline (and polygon) simplification...
2009 Dec 13
0
r65 committed - Use the GeoCommons addOverlay method
Revision: 65
Author: ajturner
Date: Sun Dec 13 11:10:04 2009
Log: Use the GeoCommons addOverlay method
http://code.google.com/p/mapstraction/source/detail?r=65
Modified:
/trunk/source/mxn.geocommons.core.js
/trunk/tests/index.htm
=======================================
--- /trunk/source/mxn.geocommons.core.js Sun Dec 13 11:10:00 2009
+++ /trunk/source/mxn.geocommons.core.js Sun Dec 13
2008 Jun 03
3
OpenSpace support for mapstraction
Attached is patch to provide support for OpenSpace in mapstraction. A demo
can be seen at http://yvonnesplants.co.uk/openspace_demo.html.
Note that OpenSpace seems sometimes to have a problem with links clicked
from email. If you get an error ''HTTP referrer not valid'' then open a new
browser window and paste in the link and it should be ok.
The following features are not