cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

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
Highlighted
Community Support
Community Support

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
Highlighted
Super User II
Super User II

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.

 

 

Highlighted
Community Support
Community Support

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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,546)