Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
How can I calculate distance between a point in a given radius inside a geographic coordinate grid?
9 commentaires
- What I'd like, is an algorithm that could divide the area into a uniform grid points, with intervals of 0.5 km in the horizontal coordiatnes
Réponse acceptée
66 commentaires
- how to incorporate a way to count data points inside every circle, and the distance between each data point and the circle's center?
- I don't completely understand how to extract the needed information from this.
- Also, would it be possible to incorporate the haversine distance equation to calculate the distance between each grid point (Circle's center) and every data event that lies within that given circle?
- I'm not able to retrieve which data points (i.e. earthquake event) lie within a given circle from the matrix results. The matrices i and j return a count value. Is there a way to identify which data event is inside the circle (i.e. giving the data points an I.D. string value to be able to identify them later on)?
- My problem is incorporating it into automatically calculating distances between data points that lie within a circle and the center of that given circle. Hence, ignoring circles which contain no data points within them.
- Also, would it be possible to incorporate the haversine distance equation
- About Haversine formula
- NaN values
- NaN values
- When use plot() you can control number of points. Can draw circle in 20 points or 200
- It's not that I don't like too many NaN values, it's that they are NaN that I don't understand. These should be numerical values for distance, or am I mistaken?
- Also, would this calculate the distance between EVERY data point inside the circle, and the reference grid point?
- When I set the step size to 0.009, which is the decimal degrees equivalent for 1 km for the grid size, I still don't get as many grids. Also, the distribution of the earthquakes in my figure is the mirror of the image you attached:
- Why are the axis labelled in this manner? Shouldn't be these the longitude/latitude values?
- Suppose I take the most north-western grid in your figure, the first one at the top from the left, it seems to only have one earthquake inside the circle. Which one would that be in the tables?
- When I set the step size to 0.009, which is the decimal degrees equivalent for 1 km for the grid size, I still don't get as many grids. Also, the distribution of the earthquakes in my figure is the mirror of the image you attached:
- Why are the axis labelled in this manner? Shouldn't be these the longitude/latitude values?
- Suppose I take the most north-western grid in your figure, the first one at the top from the left, it seems to only have one earthquake inside the circle. Which one would that be in the tables?
- The grid should have way too many small squares if 0.009 is treated as decimal degrees (1 km increment)
- So what is needed is: the count of earthquakes within 6 km radius of a grid point
- I think it's better to keep using the previous scripts since it was going in the right direction
- So from that I want to ask: what is the smallest step size that our computers can handle with that code?
- Why do you need to calculate distance from every point to every grid point? Because you don't know how far each point form current grid.
- By the way, can you explain more about kernel distribution? You want number of earthquakes for each grid point in 6km radius. What do you want to do with them?
- Plot earthquakes on a grid with intervals of 1 km and plot a circle around each grid point with a radius of 6 km.
- How many earthquakes are in each circle.
- What is the distance of each earthquake from the circles from step 2.
- Account for the magnitude of each earthquake from step 3.
- Bear with me, but what is sig^2 , and T?
- Also the p=p/pi*R^2 , is this replacing anything?
- Haha, you tell me, those are your formulas
- Just dividing all data by circle area (didn't wanted to do this inside for loop)
- check units
- Look what viscircles is doing
- UNITS
- X-Y plane: specifiy axis
- It was a joke actually. Look at the minus sign, it should be inside exp(). Distance is already squared (no need for 2 power)
- I'd assume D(ix) is in degrees as well in this script. Right?
- 1. This line:
- plot(long(ix),lat(ix),'ob') %plot data inside circle (if exists)
- 2. Which variable defines the distance between earthquakes in a given circle, and that same circle's center (the grid point)? I'm assuming it is D(ix)? However, the ix is a 51x1 logical column of 0's only
- 3. What do the colors represent? and why is the majority of the plot overlain by yellow?
- 4. ... The following screenshot represents some of the values in that double. They're negative.
- It is the question to you: what you are calculating?
- Did you replace minus sign inside exp() function?
- You don't use earthquake magnitude?
- If you take a closer look at image, do you any difference between points? they are look similar
- Most of them look the same
- Do you have coordinates of that grid point?
- For simplicity, I attached two data files with ten earthquakes only to make it easier to control and compute.
- I need the distance between each one of these earthquake to the grid point
- I need to be able to distuinguish between these earthquakes since the next part of the analysis is magnitude dependant. I'm still having a hard time with this.
- And only one advice from me
- Sure. You can use pdist2 again (note: distance between points in degrees)
Plus de réponses (1)
2 commentaires
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asie-Pacifique
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)