cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
utsav_ghosh1
Frequent Visitor

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
dynamicsedge Power Participant
Power Participant

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,270)