Mapbox Terrain v2: how do I modify contour elevation range? - mapbox

I'm using Mapbox Terrain vector tileset to show elevation contours on my map. But my region of interest is quite flat, so there aren't any visible contours in that area. (basically, I see contours all around my region, but not in the actual region I need the contours for.)
How do I modify the ele field of the contour layer to change the contour density? Thank you!
Mapbox Terrain-v2, #contour, ele field

Based on the documentation, you have to use the exaggeration param, that will exaggerates the elevation of the terrain by multiplying the data from the DEM with this value
map.setTerrain({
'source': 'mapbox-dem',
'exaggeration': 1.5 // x1.5 multiplier to exaggerate DEM data
});

Related

How to "correct" the roundness of the earth leading to ellipsis instead of circle in react leaflet

I'm trying to programatically "draw" a circle with multiple Marker with React leaflet.
I'm doing it with cosinus and sinus trying to calculate theirs coordinate from the center point ...
But the more I'm near the pole the more the circle is an ellipssis ... Is it a way to transform the calculus to take this into account ?
In this example I'm in Oulu (near the pole) If you just change the x var into '0' you'll notice that the markers are now in circle !
please see this CodePen
Because a Leaflet map is a projection of a sphere onto a flat map, distortions will happen near the poles. You want to project your spherical Lat/Lng into flat Points, calculate the marker placements in flat Points and then unproject the points back to spherical LatLng.

Display Earth map in Azimuthal Equidistant Projection

I have to display the Earth's map in azimuthal equidistant projection, by giving the lattitude and longnitude as input in Matlab. I am using the eqdazim projection, but I am still getting the map with point (0,0) in the center. I want to be able to change the point that is the center if the circle map.
landareas = shaperead('landareas.shp','UseGeoCoords',true);
axesm ('eqdazim', 'Frame', 'on');
geoshow(landareas);
Also, I don't know how to change the radius of the image. I don't need the circle with the whole Earth but instead something about ~2000km radius around center point.
I need it in order to put its image on a dome. Below is a simple example with such a dome and random fragment of the Earth's surface. Keep in mind, that it's just an image that I cropped manually from large Mercator map.
I was hoping that I can use the Mapping Toolbox in order to get such a map automatically, by giving lattitude, longnitude and radius. I have all necessary data, which is:
Lattitude & Longnitude
The radius of the circle
I just don't know how can I get this part of Earth's map. I think I have to use the azimuthal equidistant projection. I just don't know how to do this in MATLAB/Mapping Toolbox.

Volume reconstruction from 3D image gradient in Matlab

For 2D images- Gx and Gy gives the information on vertical and horizontal edge infromation respectively. Angle of the gradient direction vector can be calculated from inverse of tan(Gy/Gx) and edge direction will be perpendicular to the gradient direction vector.
I have 3D Z-stacked image datset so each pixel will be represented by (x,y,z) co-ordinate and with respective intensity value as well. I have used 3D image gradient link for initial reference.
(1) What if I want to derive whole volume/wireframe model just with the information of 3D image gradient magnitude and direction?
(2) Do I need X, Y and Z-stacked image data seperately in order to generate whole volume/wireframe model out of it?
In matlab, I can also develop whole volume just with 2D z-stacked masks using isosurface command. Here I am exploring other possibilities to generate wireframe volume/3D model.
Thanking you in anticipation.

Minimizing area of a triangle containing data points in 3D plane

I have a set of data in 3D which are in the same plane. I have a Triangle containing those data points in the same plane. But the Area of the Triangle is much larger. I want to find the smallest area triangle (co-ordinate of its 3 points) containing all the data point inside it. There are some concepts available for 2D data points, but I need to find this in 3D dimension.
It looks like Matlab has a function for this, convhull. You want to find the convex hull of the data set. http://www.mathworks.com/help/matlab/ref/convhull.html This function works for points in 2d or 3d space.

How to draw 2D contour in MATLAB from a set of unsorted x-y coordinates in a non-rectangular domain

I have the electric potential value at a set of unsorted points. I know the x-y coordinates of all points and the mesh is like the following.
Now I want to draw the potential contour in the blue region. There is a similar problem here Matlab 2D contour using X-Y coordinate data. However, it only gives answer on how to draw this contour in a rectangular region, but what I need is to draw contours only in the blue region. Is there anybody who can help me with this? Thank you so much.
If we assume the size of the rectangular is Lx1 by Hy1 and the size of the right one is Lx2 by Hy2, the code I tried to connect two contours is as follows:
xdim1 = 0:dx:Lx1;
ydim1 = 0:dy:Hy1;
xdim2 = Lx1:dx:(Lx1+Lx2);
ydim2 = (Hy1-Hy2):dy:Hy1;
figure
contourf(xdim1, ydim1, phi1); %phi1 is the sorted potential value in this region
hold on
contourf(xdim2, ydim2, phi2); %phi2 is the sorted potential value in this region
hold off
However, this code failed. Is there any bugs in this piece of code?
Possible solution:
Thanks #Inox, #ysakamoto and #R. Schifini for their suggestions. I tried to assign the potential in the white rectangular region to be NaN and plot contour in the outermost rectangular region. The plots looks good.