-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetCoords and Mercator Projection ? #422
Comments
Hi, I think this is because the tutorial is for the maps using equi-rectangular projection only, it can be applied for other projections. For the mercator, you will have to define the proper algorithm to convert the coordinates. Feel free to take a look at this pull-request that includes a map with a mercator projection to see how the getCoords() function is built : #169 |
Thank you. I have tried to translate the mercator getcoords function (from the link provided) in VBA. But when I test RIO DE JANEIRO, lat, long = (-43.23, -22.9) Below the VBA code : '// Width of the map, in pixel Public Sub teste() Call getCoords(-43.23, -22.9) 'RIO DE JANEIRO lat, lon End Sub '* Dim xLeftPrime As Double, xRightPrime As Double, yTopPrime As Double, yBottomPrime As Double Dim xPrime As Double, yPrime As Double
Debug.Print x End Sub ' * Transform a longitude coordinate into projection-specific x' coordinate 'Compute longitude in radian '* |
Hello,
I have a SOUTHAMERICA map (png) from a mercator projection, and want to use it in Excel by applying on it an X/Y chart.
I want to use your very interesting getCoords function to translate the long/lat into X/Y coords (but I see it is for EQUIRECTANGULAR translation, not Mercator)
When I apply the factors and offsets calculated, points are not well positioned :(

For example for Bazil points :
Below my setting (I have set x2 and Y2 with Width/ Height of my map image):

For example , for rio de Janeiro, I have the following long/lat : -43,23 / -22,9
If I apply factor, I get : 406,41 / 403,18
Is it normal ? Is there a way to get the right factor/offset to help on plot on a mercator projection ?
Thank your for your valuable help.
The text was updated successfully, but these errors were encountered: