필터 지우기
필터 지우기

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

조회 수: 10 (최근 30일)
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 CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by