Problems with wrapTo180, creates lines on map

조회 수: 8 (최근 30일)
Melissa
Melissa 2015년 2월 11일
댓글: Brian DeCicco 2021년 7월 27일
Hello,
I have a longitude vector that I want to convert from 0-360 to -180 - 180 The data shows perfectly find on a global map when in its original 360 form, but once I use wrapTo180, there seems to be lines all across my global map.
Has anyone else had this problem?
If so, how do I fix it?
Thank you,
Melissa
  댓글 수: 3
Melissa
Melissa 2015년 3월 7일
Hi Chad,
I will just upload the files so you know what I'm dealing with. I've never had this problem before with wrap, so it might be this specific data?
Brian DeCicco
Brian DeCicco 2021년 7월 27일
Melissa, I'm having the same issue as you are here. Did you ever get resolution to this?

댓글을 달려면 로그인하십시오.

답변 (1개)

Rob Comer
Rob Comer 2015년 2월 23일
Instead of wrapping your longitudes, try using the maptriml function with latlim = [-90 90] and lonlim = [-180 180]. Because these limits span the globe, this won't really trim away any data. What it will do is cut your data on the 180-degree meridian. This cut should eliminate the spurious lines that you're seeing across your global map.
  댓글 수: 1
Melissa
Melissa 2015년 3월 7일
When I use this approach, I get the error:
Error using checklatlon (line 26) Function MAPTRIML expected its first and second input arguments, LAT and LON, to match in size.
Error in maptriml (line 17) checklatlon(lat, lon, mfilename, 'LAT', 'LON', 1, 2)

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by