Displaying 16 results from an estimated 16 matches for "lat2".
Did you mean:
lat
2018 May 20
1
How to average values from grid cells with coordinates
...,pop=pop)
plot(0,type="n",xlim=c(97.5,108.5),ylim=c(27.5,38.5),
xlab="Longitude",ylab="Latitude")
abline(h=27.5)
abline(h=lat+0.5)
abline(v=97.5)
abline(v=lon+0.5)
text(blackcells$lon,blackcells$lat,pop)
# the red cells will be centered on the corners of 4 black cells
lat2<-rep(seq(28.5,34.5,by=2),4)
lon2<-rep(seq(99.5,105.5,by=2),each=4)
redcells<-data.frame(lat=lat2,lon=lon2,value=NA)
display the red cells
rect(lon2-1,lat2-1,lon2+1,lat2+1,border="red",lwd=2)
nblackcells<-dim(blackcells)[1]
nredcells<-dim(redcells)[1]
for(redcell in 1:nredce...
2011 Jan 20
1
Generating time progressing line for Google Earth
...n (degree) {
radian = degree * (pi/180.0)
return(radian)
}
#radians to degrees
Degrees <- function (radian) {
degree = radian * (180.0/pi)
return(degree)
}
# Calculates the distance between two points using the
# Spherical Law of Cosines
gcd.slc <- function(lon1, lat1, lon2, lat2) {
R = 6371.0 # Earth mean radius [km]
lon1 = Radians(lon1)
lat1 = Radians(lat1)
lon2 = Radians(lon2)
lat2 = Radians(lat2)
d = acos(sin(lat1)*sin(lat2) + cos(lat1)*cos(lat2) *
cos(lon2-lon1)) * R
return(d) # Distance in km
}
##############...
2005 Jan 19
1
looking for a basic spatial diff function
...release: R 2.0.0
editor: GNU Emacs 21.3.2
front-end: ESS 5.2.3
---------------------------------
Colleagues
Is there a function to calculate distances between adjacent latitude/
longitude pairs in a matrix? It is basically a spatial diff() function that
I have in mind.
Data:
long1, lat1
long2, lat2
long3, lat3
looking for: diff(data$long, data$lat)
function Result
long1, lat1
long2, lat2, distance = long/lat2 - long/lat1
long3, lat3, distance = long/lat3 - long/lat2
I've probably missed it but a search of the maillist archives and quick scan
of the packages (map*) did not solve my que...
2010 Jan 05
3
R matching lat/lon pairs from two datasets?
...> data2
V1 V2 V3
1 -123.76 47.82 8
2 -123.75 47.82 11
> data[1:2]
V1 V2
1 47.82 -123.76
2 47.82 -123.75
3 47.82 -123.74
4 47.82 -123.73
#Subset of current R code :
lat <- data$V1
lon <- data$V2
yrs <- c(1,2,5,10,25,50,100,200,500,1000)
lon2 <- data2$V1
lat2 <- data2$V2
ppt2 <- data2$V3
for(i in 1:length(lat2)) {
loc <- match(lat2[i],lat)
loc2 <- match(lon2[i], lon)
print(loc); print(loc2)
#Need to test to make sure loc equals loc2
freq_ppt <-
c(data[i,4],data[i,6],data[i,8],data[i,10],data[i,12...
2018 May 22
0
How to average values from grid cells with coordinates
...=c(97.5,108.5),ylim=c(27.5,38.5),
> xlab="Longitude",ylab="Latitude")
> abline(h=27.5)
> abline(h=lat+0.5)
> abline(v=97.5)
> abline(v=lon+0.5)
> text(blackcells$lon,blackcells$lat,pop)
> # the red cells will be centered on the corners of 4 black cells
> lat2<-rep(seq(28.5,34.5,by=2),4)
> lon2<-rep(seq(99.5,105.5,by=2),each=4)
> redcells<-data.frame(lat=lat2,lon=lon2,value=NA)
> display the red cells
> rect(lon2-1,lat2-1,lon2+1,lat2+1,border="red",lwd=2)
> nblackcells<-dim(blackcells)[1]
> nredcells<-dim(redcel...
2008 Sep 12
2
Join data by minimum distance
I am wondering if there is a function which will do a join between 2 data.frames by minimum distance, as it is done in ArcGIS for example. For people who are not familiar with ArcGIS here it is an explanation:
Suppose you have a data.frame with x, y, coordinates called track, and a second data frame with different x, y coordinates and some other attributes called classif. The track data.frame has
2010 Jul 23
1
Midpoint between coordinates
Dear R users,
I need to find the coordinates for the point (midpoint) located half
way between two pairs of coordinates (lon1,lat1 and lon2,lat2)
assuming a straight line between them. What would be the best way? I
tried to find an answer in the help archives but without success. I
would greatly appreciate any help.
df<- data.frame(lon1=c(-4.568,-4.3980), lat1=c(59.235,56.369),
lon2=c(-5.123,-4.698), lat2=c(60.258,59.197) )
Thanking in...
2011 Apr 12
1
How to set the dimension of a matrix correctly?
...pvalxx <- which(kc$predict < 0) kc$predict[pvalxx] <- 0 pptpred <- kc$predict }else{ pptpred <- 0*(1:pdim[1]) }}
newpptpred <- matrix(pptpred, nrow=62, ncol=165) # need to fit the lat/lon frame
plat <- seq(37.5,42,by=0.07273)plon <- seq(-105.5,-93.5,by=0.07273)
lat2 <- which((plat> 37)&(plat< 42))lon2 <- which((plon> -106)&(plon< -93))
newpptpred <- tpptpred[lat2,pon2]
nLevel <- 60
quartz()filled.contour(plon,plat,t(newpredppt),col=rainbow(nLevel),plot.axes={axis(1);axis(2)})
-------------- next part -------------...
2007 Oct 30
2
calculate spatial distance
Hi,
I have a set of locations defined by longitude and latitude (in degrees),
and want to calculate the spatial (or geographic) distance among all
locations.
I did not find such a function in the spatial-related packages. (I *cannot*
use 'dist', as I have geographic, not cartesian coordinates).
thanks!
Robert
Robert Ptacnik
Norwegian Institute for Water Research (NIVA)
Gaustadall?en 21
2012 Dec 19
1
"For" loop and "if" question
All -
I have a large data frame that looks like
ID p1 p2 p3...p20 Lat1 Lat2 Lat3...Lat20
Long1 Long2 Long3...Long20
1 0 0 1 0 NA NA 29.xx NA
NA NA -89.xx NA
2 1 0 0 1 27.xx NA NA 29.00
-88.00 NA NA -89.xx
3 0 0 0 0...
2011 Feb 08
0
favorite pattern for adding functionality to an AR?
Do you have a preferred programming pattern for adding functionality to
an ActiveRecord? As an example, say I have some gnarly trig functions
for distance and bearing between pairs of latitude and longitude:
=== file: latlng.rb
module LatLng
def haversine_distance(lat1, lng1, lat2, lng2)
...
end
def bearing(lat1, lng1, lat2, lng2)
...
end
=== EOF
... and I want to mix in haversine_distance(other_ar) and
bearing(other_ar) methods into an ActiveRecord. The shim functions
would look like this:
===
def haversine_distance(other_ar)
haversine_distance(self.lat, self.lng...
2014 Jul 07
1
Conversion error: Incomplete multibyte sequence
.../samba-tool domain classicupgrade, I will see error:
"Conversion error: Incomplete multibyte sequence"
I had in my old smb.conf:
display charset = iso8859-2
dos charset = cp852
unix charset = iso8859-2
In i18n:
LANG="cs_CZ"
SUPPORTED="cs_CZ:cs:en_US:en"
SYSFONT="lat2-sun16"
SYSFONTACM="iso02"
I am thinking probable cause is encode file passdb.tdb
Could you please solution to this?
Thank you,
Honza
2008 Nov 17
2
How to calculate the linear distance between 2 points
Deemed colleagues
I would appreciate your help with a sentence to calculate the linear
distance between 2 geographical points (coordinates in UTM).
In advance thnks for your attention,
--
Ricardo Bandin Llanos
rbandin@udec.cl
Estudiante - Magíster Cs. m. Pesquerías
Universidad de Concepción, Región del Bio-Bio, Chile
Celular: (0056-41) 97949957
[[alternative HTML version deleted]]
2019 Oct 27
0
Font for cyrillic letters
...nts. And there are very few of them:
file * | grep -v "Linux/i386 PC Screen Font v1"
eurlatgr.psfu: Linux/i386 PC Screen Font v1 data, 512 characters, Unicode directory, 8x16
lat0-sun16.psfu: Linux/i386 PC Screen Font v1 data, 256 characters, Unicode directory, 8x16
lat2-sun16.psfu: Linux/i386 PC Screen Font v1 data, 256 characters, Unicode directory, 8x16
latarcyrheb-sun16.psfu: Linux/i386 PC Screen Font v1 data, 512 characters, Unicode directory, 8x16
LatGrkCyr-8x16.psfu: Linux/i386 PC Screen Font v1 data, 512 characters, Unicode directory, 8x1...
2009 Nov 15
1
R crashing
Hello,
This is what I am trying to do: I wrote a little function that takes
addresses (coordinates) as input, and returns the road distance between
every two points using Google Maps. Catch is, there are 2000 addresses, so I
have to get around 2x10^6 addresses. On my first go, this is what I did:
#########################################
getRoadDist = function(X,complete=F){ # X must be a
2019 Oct 26
2
Font for cyrillic letters
Hi,
On 26/10/2019 11:53, Ady Ady via Syslinux wrote:
>
>> Hi.
>> I was trying to make syslinux to display russian letters.
>>
>> This page
>> https://wiki.syslinux.org/wiki/index.php?title=Directives/font says
>> that for Cyrillic you need a CP855. Is that correct? All other
>> guides in internet say that you need CP866.
>
>
> The