How to prevent wraparound using geoplot
I am trying to accomplish something similar to the below post, namely prevent my data from wrapping at the meridians. So far, no luck:
https://www.mathworks.com/matlabcentral/answers/2172159-how-to-wrap-axes-using-geoplot
If I set the lonLim to [-360 360] and call geolimits(latlim,lonlim), the longitude limits do NOT change to [-360 360] but to [-180.3914 181.1743]. Why is this? Is there a bult-in max limit in geolimits? It’s possible that the function is confused by the [-360 360] values, which are effectively equivalent.
But back to the wraparound issue. I am plotting NetCDF-type satellite observation data.
figure
gx = geoaxes;
geobasemap(gx,’usgsimagery’);
hold on
latLim = [-72 85];
lonLim = [-180 180];
geolimits(gx, latLim, lonLim);
lat = ncread(filepath, ‘Latitude’); % read NetCDF-type data
lon = ncread(filepath, ‘Longitude’);
lat1 = double(lat(:,:,1)) ; % read just the 1st of 6 layers
lon1 = double(lon(:,:,1));
lon1 = wrapTo180(lon1); % limit to +/- 180 degrees
k = boundary(lat1(:),lon1(:)); % get just the edge data
pgon = geopolyshape(lat1(k),lon1(k));
geoplot(gx,pgon);
I am able to plot the satellite observation patches on the Mercator projection geoaxes display. However, when a patch crosses the International Date Line, it does not straddle the line but whangs all the way to the right, to the Prime Meridian.
If I use geoplot instead of geopolyshape I get the same effect, only with vectors instead of shapes.When the longitude data reaches -180, the vectors jump all the way to the right instead of straddling the dateline.
geoplot(gx,lat1(k),lon1(k));
How can I massage my NetCDF data to prevent this?
My goal is to collect all the patches and merge them into a single surface as described here:
https://www.mathworks.com/matlabcentral/answers/80524-combine-surfaces-into-one-big-surfaceI am trying to accomplish something similar to the below post, namely prevent my data from wrapping at the meridians. So far, no luck:
https://www.mathworks.com/matlabcentral/answers/2172159-how-to-wrap-axes-using-geoplot
If I set the lonLim to [-360 360] and call geolimits(latlim,lonlim), the longitude limits do NOT change to [-360 360] but to [-180.3914 181.1743]. Why is this? Is there a bult-in max limit in geolimits? It’s possible that the function is confused by the [-360 360] values, which are effectively equivalent.
But back to the wraparound issue. I am plotting NetCDF-type satellite observation data.
figure
gx = geoaxes;
geobasemap(gx,’usgsimagery’);
hold on
latLim = [-72 85];
lonLim = [-180 180];
geolimits(gx, latLim, lonLim);
lat = ncread(filepath, ‘Latitude’); % read NetCDF-type data
lon = ncread(filepath, ‘Longitude’);
lat1 = double(lat(:,:,1)) ; % read just the 1st of 6 layers
lon1 = double(lon(:,:,1));
lon1 = wrapTo180(lon1); % limit to +/- 180 degrees
k = boundary(lat1(:),lon1(:)); % get just the edge data
pgon = geopolyshape(lat1(k),lon1(k));
geoplot(gx,pgon);
I am able to plot the satellite observation patches on the Mercator projection geoaxes display. However, when a patch crosses the International Date Line, it does not straddle the line but whangs all the way to the right, to the Prime Meridian.
If I use geoplot instead of geopolyshape I get the same effect, only with vectors instead of shapes.When the longitude data reaches -180, the vectors jump all the way to the right instead of straddling the dateline.
geoplot(gx,lat1(k),lon1(k));
How can I massage my NetCDF data to prevent this?
My goal is to collect all the patches and merge them into a single surface as described here:
https://www.mathworks.com/matlabcentral/answers/80524-combine-surfaces-into-one-big-surface I am trying to accomplish something similar to the below post, namely prevent my data from wrapping at the meridians. So far, no luck:
https://www.mathworks.com/matlabcentral/answers/2172159-how-to-wrap-axes-using-geoplot
If I set the lonLim to [-360 360] and call geolimits(latlim,lonlim), the longitude limits do NOT change to [-360 360] but to [-180.3914 181.1743]. Why is this? Is there a bult-in max limit in geolimits? It’s possible that the function is confused by the [-360 360] values, which are effectively equivalent.
But back to the wraparound issue. I am plotting NetCDF-type satellite observation data.
figure
gx = geoaxes;
geobasemap(gx,’usgsimagery’);
hold on
latLim = [-72 85];
lonLim = [-180 180];
geolimits(gx, latLim, lonLim);
lat = ncread(filepath, ‘Latitude’); % read NetCDF-type data
lon = ncread(filepath, ‘Longitude’);
lat1 = double(lat(:,:,1)) ; % read just the 1st of 6 layers
lon1 = double(lon(:,:,1));
lon1 = wrapTo180(lon1); % limit to +/- 180 degrees
k = boundary(lat1(:),lon1(:)); % get just the edge data
pgon = geopolyshape(lat1(k),lon1(k));
geoplot(gx,pgon);
I am able to plot the satellite observation patches on the Mercator projection geoaxes display. However, when a patch crosses the International Date Line, it does not straddle the line but whangs all the way to the right, to the Prime Meridian.
If I use geoplot instead of geopolyshape I get the same effect, only with vectors instead of shapes.When the longitude data reaches -180, the vectors jump all the way to the right instead of straddling the dateline.
geoplot(gx,lat1(k),lon1(k));
How can I massage my NetCDF data to prevent this?
My goal is to collect all the patches and merge them into a single surface as described here:
https://www.mathworks.com/matlabcentral/answers/80524-combine-surfaces-into-one-big-surface geoplot, geopolyshape, netcdf, geoaxes, geolimits MATLAB Answers — New Questions