Skip to content

Modifying many_points.rs example to render elevation points #84

Answered by Maximkaaa
BogdanOlar asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @BogdanOlar . At least you can see the mountains, that is already cool! :-)

To project your points into correct coordinate system:

  1. Get the projection for Web Mercator CRS (the one that the map uses)
let projection = Crs::EPSG3857.get_projection();
  1. For every point in your data set create a 2d geo point and project it to your map's CRS:
let lat_p = lat + (res_inc * (xi as f64));
let lon_p = lon - (res_inc * (yi as f64));
let point = GeoPoint2d::latlon(lat, lon);
let projected = projection.project(&point);
  1. Create a 3d-point by adding elevation to the projected point.
let point3d = Point3d::new(projected.x, projected.y, z);

This will give you points in the right position of the …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@BogdanOlar
Comment options

@BogdanOlar
Comment options

Answer selected by BogdanOlar
Comment options

You must be logged in to vote
3 replies
@BogdanOlar
Comment options

@pka
Comment options

@Maximkaaa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants