cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
utsav_ghosh1
Level: Powered On

Use GPS coordinate to get Lat and Long

Hello Team,

I have a SharePoint column with GPS coordinates (53°22'16.9"N 6°08'58.8"E). How do i convert this to Lat and long so that i can use it in powerapps.

 

Regards,

Utsav

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Use GPS coordinate to get Lat and Long

Hi @utsav_ghosh1 ,

Could you please share a bit more about your scenario?

Do you want to convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into Lat and long value within an app?

 

If you want to convert the convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into Lat and long value within an app within an app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Currently, there is no function or connector supported in PowerApps to convert the convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into corresponding Lat and long value. If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into Lat and long value using the following expression:

Latitude/Longitude = D + ((S/60)+M)/60

Where D and M and S are the values that compose the DMS format : D°M'S''

Please check the following article for more details:

https://stackoverflow.com/questions/6945008/converting-latitude-longitude-valuesdmscompass-direction...

On your side, please take a try with the following workaround:

Add a Gallery control in your app, set the Items property to your SP List data source. Add a Label control in the Gallery, set the Text property to following:

(Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(First(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),3)).Result))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(First(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),2)).Result)))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(First(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),1)).Result)) & 
", " 
&(Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(Last(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),3)).Result))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(Last(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),2)).Result)))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(Last(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),1)).Result))

Note: The GPSText column represents the column in your SP List to store the GPS coordinates value. Please make sure you use Text type column rather than Location type column to store the GPS coordinates value in your SP List. If you use Location type column to store the GPS coordinates value, you could not access the "GPS Column: Coordinate" value within your app.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
dynamicsedge
Level 10

Re: Use GPS coordinate to get Lat and Long

@utsav_ghosh1 

  1. Split on N or S with Split function then get first result
  2. Split on W or E with Split function then get first result

 

Then, for #1:

 

  1. Split on ° then get first result (53)
  2. Split on ' then get first result (22)
    1. take this result (22) and divide by 60
  3. Split on " then get first result (16.9)
    1. take this result (16.9) and divide by 3600
  4. Add 53 + (22/60) + (16.9/3600) and then you have your result for Latitude
  5. Repeat the above for the Longitude

 

Hope this initial summary and pseudocode above helps.

 

 

Community Support Team
Community Support Team

Re: Use GPS coordinate to get Lat and Long

Hi @utsav_ghosh1 ,

Could you please share a bit more about your scenario?

Do you want to convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into Lat and long value within an app?

 

If you want to convert the convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into Lat and long value within an app within an app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Currently, there is no function or connector supported in PowerApps to convert the convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into corresponding Lat and long value. If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider convert the GPS coordinates (53°22'16.9"N 6°08'58.8"E) into Lat and long value using the following expression:

Latitude/Longitude = D + ((S/60)+M)/60

Where D and M and S are the values that compose the DMS format : D°M'S''

Please check the following article for more details:

https://stackoverflow.com/questions/6945008/converting-latitude-longitude-valuesdmscompass-direction...

On your side, please take a try with the following workaround:

Add a Gallery control in your app, set the Items property to your SP List data source. Add a Label control in the Gallery, set the Text property to following:

(Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(First(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),3)).Result))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(First(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),2)).Result)))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(First(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),1)).Result)) & 
", " 
&(Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(Last(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),3)).Result))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(Last(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),2)).Result)))/60 +
Value(Trim(Last(FirstN(Split(Substitute(Substitute(Substitute(Last(Split(ThisItem.GPSText," ")).Result, "°","/"), "'","/"), """","/"), "/"),1)).Result))

Note: The GPSText column represents the column in your SP List to store the GPS coordinates value. Please make sure you use Text type column rather than Location type column to store the GPS coordinates value in your SP List. If you use Location type column to store the GPS coordinates value, you could not access the "GPS Column: Coordinate" value within your app.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,025)