フィルターのクリア

How can I filter out latitude & longitude data that lies outside of a designated region?

10 ビュー (過去 30 日間)
Alex Lojko
Alex Lojko 2017 年 11 月 12 日
回答済み: Veda Upadhye 2017 年 11 月 15 日
I suppose I am stuck on how to initially approach this problem. I am undertaking a project in which I would like to plot all lightning strikes that have occurred in a particular year within the territory of Poland. However, some of the data detected lies outside of this country. I would like to filter said data out so that I can produce a map of this data as well as do some analysis of it.
I have tried using a variety of methods, such as using the filterm command, using the geoshow command and trying to create a buffer of the country shape and only include data within the buffer, or simply trying to create a rough polygon around the country and trying to include data within the specified region.
I would just like to know whether any of these proposed methods will give me solution that I want? If so, which one would be the best to attempt or if there are any better suggestions?
I hope this is enough information to help answer my question as I am not expecting someone to just code up my data.
Thank-you.

回答 (1 件)

Veda Upadhye
Veda Upadhye 2017 年 11 月 15 日
Hi Alex,
You may find it useful to look at this example using the 'filterm' function:
https://www.mathworks.com/help/map/ref/filterm.html
The example goes through how you could choose specific latitude and longitude points using a reference matrix.
In case you are not working with latitude and longitude coordinates, you can use the 'inpolygon' function to get indices of points(x,y) that lie inside the boundary points/ closed region (xb,yb). With these indices, you can select your points which lie inside the given closed region.
Hope this helps!
-Veda

カテゴリ

Help Center および File ExchangeMap Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by