Good morning,
Sorry, maybe the title is not clair.
I have georeferenced data, all these data can be bounded with [80',81'] in longitude and [80',81'] in latitude
my question is : if I want to draw these data in a caneva, did this imply that the caneva must be square,
I mean if I draw these data in a square of [1000,1000] pixels, did I twist (distortion) these data? if it is the case how can I find the appropriate scale?
thank you.
Related
I'm trying to overlay the coastlines and country borders onto the R map I've drawn.
I'm trying the simple worldHires function to do this but it's not scaling correctly to my map. I downloaded my data from https://www.esrl.noaa.gov/psd/data/gridded/data.UDel_AirT_Precip.html and the file name is precip.mon.total.v401
This is my code when I try to plot my map (excluding the first few lines of reading data and variables into R):
>image.plot(lon,lat,precip[,ncol(precip):1,8],
main="Precipitation (August, 2001)",
xlab=expression(paste("Longitude(",degree,"E)")),
ylab=expression(paste("Latitude(",degree,"N)")),
zlim=c(0,15),xlim = c(min(lon),max(lon)),
ylim = c(min(lat),max(lat)),cex=0.5)
> map('world2Hires', fill=FALSE, add=T)
The boundary layer from world2Hires is very small, scaling from -90 to 90 for Latitude and 0 to 360 for Longitude.
My data's range is Latitude -180 to 180 and Longitude 0 to 720. So how do I scale the world2Hires to match my data? Or is that not possible? See image in link
In your question, you seem to be mixing the latitude values (-90:90) degrees with the matrix indices. Since the map is of resolution 0.5 degrees, these run 0:360. The same for the longitudes.
So from your question, I am not sure whether the problem is that your vectors "lon" and "lat" are incorrect (they should probably be something like lon=seq(0,360,by=0.5); lat=seq(-90,90,by=0.5)). Obviously, the map() command expects the co-ordinates to be in degrees.
But the illustration on the link you provided, shows that the data is on longitude [0,360] while the data in worldHires is on [-180,180].
I think the simplest solution is to use "world2Hires", which is the same map but with longitudes shifted to [0,360], which should fit your map.
As a side remark, using worldHires is possibibly not the best choice of world map. The country borders in some parts of the world are outdated, and the high resolution is not so important at a global scale. Just using "world2" (the "2" again is for the shift to [0,360]) would probably look just as good on a global map.
I may add that in the very near future, the next version of "map" will make such shifting of longitudes much easier, whithout the need for an extra data set.
I am using the Spatstat package in R for spatial point analysis. My dataset comprises location coordinates i.e. latitude and longitude of some event upto 6 places of decimal. It has some 9898 observations.
Here`s the output of the summary for the point pattern:
Planar point pattern: 9898 points
Average intensity 149786.3 points per square unit
Coordinates are given to 6 decimal places
units
Window area = 0.0660808 square units
My question is that how can the Average Intensity value be so huge? Or is my approach of creating a point pattern is wrong? Please help!
You are using a geographic coordinate system coordinates which spatstat doesn't support.
The coordinates are simply interpreted as units and since the window area is only 0.0660803 square units the point density is extrapolated to an average intensity of 149786.3 points per square unit.
Have a look at this thread how you convert (project) your coordinates to points on a flat map:
Unit length in spatstat
I want to generate a plot in which I'm capable of visualising the distribution of a given variable in space.
Let's say I want to know how the values of frequency bandwidth (Hz) of a bird's song are spread in space.
I tried with scatterplot3d. But I'm think this is not right.
x<-a vector with easting coordinates
y<-a vector with northing coordinates
z<-a vector with the bandwidth values (in Hz)
Then I do:
scatterplot3d(x,y,z)
Should "z" be a coordinate or can I use it as a vector of values of a given variable?
Thanks in advance!
I did it with scatterplot3d.
scatterplot3d(Hypo$Easting,Hypo$Northing,Hypo$Song_Dur,angle=118,color="red",pch=16,highlight.3d=TRUE,xlab="Easting",ylab="Northing",type="h",lwd=1)
Where Hypo$Easting==x, Hypo$Northing==y and Hypo$Song_Dur==z(variable).
I am looking to calculate the distance between points (about 47K) and the closest X countries (of all world countries). I have imported the lat/long of points as SpatialPoints, and loaded a world map as a SpatialPolygons. I think I could build off of the advice given here:
SpatialLinesDataFrame: how to calculate the min. distance between a point and a line
It looks like I have to calculate the distance between all countries and all points and then extract the X closest, which is a bit intense with so many points.
In short, is there a way to impose a polygon limit? If not, what would you suggest- my only thought is to import a smaller number of points and then loop through this code (I am a new R user).
Thanks!
I have a list of cities, each of them obviously has a longitude and latitude.
Now selecting one of these cities, i want to obtain all the other cities that have a longitude / latitude in a range of 50 km from the selected city.
What formula should I use?
I am only interested in the mathematical formula to convert km to latidutine and longitude from a know city position
Then i will calculate the maximum and minimum latitude and longitude, for considering an acceptable range. (like a Square)
tks
I don't want to calculate the distance between two points!+
I want to calculate min e max latitude and longitude and then filter my cities by this coordinates.
I've found a sample in Php that worked for me.
(i've ported it to C#)
http://blog.fedecarg.com/2009/02/08/geo-proximity-search-the-haversine-equation/
You'd probably want to use the Haversine formula.
You may want to check out the following articles for further reading and for a few implementations in various languages:
Calculate distance, bearing and more between Latitude/Longitude points by Chris Veness.
Calculate Distance Between Two Points on a Globe in 11 languages.
You are looking for the Great Circle calculation. It returns the shortest distance across the surface of the planet given two points and their respective latitude and longitude. There is a great Wikipedia article here:
http://en.wikipedia.org/wiki/Great-circle_distance
There is a pretty decent implementation - source code in javascript here:
http://trac.osgeo.org/openlayers/wiki/GreatCircleAlgorithms