Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DonZalmrol 220 posts 833 karma points
    Oct 31, 2020 @ 17:18
    DonZalmrol
    0

    GPS Degrees Minutes Seconds (DMS) to (DD) from within Umbraco (/ Razor)

    Hi,

    I am looking for a way to convert my DMS to DD from within Razor itself so that I can add the new DD value to a simple Google link for displaying the GPS.

    My DMS works and fetches data that is stored in the EXIF GPS data. Problem is that it returns the unicode values for the degree, double quote and single quote and so on.

    e.g. https://www.google.com/maps/place/51°7'2.77",30°7'20.14";"

    https://www.google.com/maps/place/51°7'2.77",30°7'20.14""
    

    So some options are:

    1. Remove the unicode and replace it by a simple comma (tested, not working)
    2. Convert the DMS to DD

    Though for both options I would need to be able to remove the unicode...

  • DonZalmrol 220 posts 833 karma points
    Nov 08, 2020 @ 11:15
    DonZalmrol
    100

    Ok, found a workaround.

    Since DMS is accepted by Google (and other mapping APIs) I was able to found a workaround using @Url.Encode and giving it my DMS value.

    gpsDegreesMinutesSecondsURL = @Url.Encode(gpsDegreesMinutesSeconds);
    

    Which returns

    51%c2%b0+7%27+2.77%22%2c+30%c2%b0+7%27+20.14%22

    For one of my DMS values fetched :)

Please Sign in or register to post replies

Write your reply to:

Draft