Plot latitude and longitude on google map (2024)

89 views (last 30 days)

Show older comments

Manoj Pai on 20 Feb 2019

  • Link

    Direct link to this question

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map

  • Link

    Direct link to this question

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map

Edited: cui,xingxing on 27 Apr 2024

Open in MATLAB Online

I have set of latitude and longitude data need to plot real time.

Read values from .csv file

plot(lon1(1:i),lat1(1:i),'bo-');

pause(0.1);

drawnow

Following are set of values need to plot on google map.

33.87381314 -118.38231

33.87381315 -118.3823182

33.87381315 -118.3823263

33.87381316 -118.3823345

33.87381316 -118.3823429

33.87381317 -118.3823513

33.87381317 -118.3823598

33.87381318 -118.3823679

33.87381318 -118.3823761

33.87381319 -118.3823842

33.87381319 -118.3823926

33.8738132 -118.3824011

33.8738132 -118.3824098

33.87381321 -118.3824185

33.87381321 -118.3824276

33.87381322 -118.3824366

33.87381322 -118.3824454

33.87381323 -118.3824538

33.87381323 -118.3824623

33.87381324 -118.3824707

33.87381324 -118.3824794

33.87381325 -118.3824885

33.87381325 -118.3824972

33.87381326 -118.3825057

33.87381326 -118.3825144

33.87381327 -118.3825234

33.87381327 -118.3825325

33.87381328 -118.3825415

33.87381328 -118.3825506

33.87381329 -118.3825596

33.87381329 -118.3825687

33.8738133 -118.3825774

33.8738133 -118.3825858

33.87381331 -118.382594

33.87381331 -118.3826024

33.87381332 -118.3826105

33.87381332 -118.3826187

33.87381333 -118.3826268

33.87381333 -118.382635

33.87381334 -118.3826431

33.87381334 -118.3826512

33.87381335 -118.3826594

33.87381335 -118.3826675

33.87381336 -118.382676

33.87381336 -118.3826847

33.87381337 -118.3826934

33.87381337 -118.3827025

33.87381338 -118.3827115

33.87381338 -118.3827206

33.87381339 -118.3827293

1 Comment

Show -1 older commentsHide -1 older comments

Shashwat Jaiswal on 21 Jan 2023

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_2574425

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_2574425

use geoplot

Sign in to comment.

Sign in to answer this question.

Answers (3)

cui,xingxing on 4 Apr 2020

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#answer_423901

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#answer_423901

Edited: cui,xingxing on 27 Apr 2024

Open in MATLAB Online

Use matlab mobile to record the sensor data or your data, and then use the following code to draw (requires mapping toolbox)):

load('sensorlog_20200402_193813.mat');

latitude = Position.latitude;

longitude = Position.longitude;

%%

wm = webmap('World Imagery');

s = geoshape(latitude,longitude);

wmline(s,'Color', 'red', 'Width', 3);

-------------------------Off-topic interlude, 2024-------------------------------

I am currently looking for a job in the field of CV algorithm development, based in Shenzhen, Guangdong, China,or a remote support position. I would be very grateful if anyone is willing to offer me a job or make a recommendation. My preliminary resume can be found at: https://cuixing158.github.io/about/ . Thank you!

Email: cuixingxing150@gmail.com

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

KSSV on 20 Feb 2019

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#answer_361853

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#answer_361853

Refer this: https://in.mathworks.com/matlabcentral/fileexchange/27627-zoharby-plot_google_map

4 Comments

Show 2 older commentsHide 2 older comments

Manoj Pai on 20 Feb 2019

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_673176

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_673176

When I run, it shows the error:

plot_google_map

Warning:

error was: Error using urlreadwrite (line 98)

Error downloading URL. Your network connection may be down or your proxy settings improperly configured.

Possible reasons: missing write permissions, no network connection, quota exceeded, or some other error.

Consider using an API key if quota problems persist.

To debug, try pasting the following URL in your browser, which may result in a more informative error:

> In plot_google_map (line 451)

ans =

[]

Please suggest.

KSSV on 20 Feb 2019

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_673178

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_673178

Error downloading URL. Your network connection may be down or your proxy settings improperly configured.

Manoj Pai on 20 Feb 2019

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_673185

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_673185

I have ensured, I have good internet connection.

Sjors Huijbers on 22 May 2019

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_707727

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#comment_707727

To debug, try pasting the following URL in your browser, which may result in a more informative error:

Check if you can access this map. If not, your API key for google static maps is missing. You will have to buy one.

Sign in to comment.

MathWorks Support Team on 11 Jul 2023

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#answer_1271063

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/445951-plot-latitude-and-longitude-on-google-map#answer_1271063

Open in MATLAB Online

You can plot latitude and longitude data onto a basemap using geoplot or geoscatter. You can also update the basemap using geobasemapor add a custom basemap using addCustomBasemap. Here is an example to plot the first six points:

lat = [33.87381314 33.87381315 33.87381315 33.87381316 33.87381316 33.87381317];

lon = [-118.38231 -118.3823182 -118.3823263 -118.3823345 -118.3823429 -118.3823513];

geoplot(lat,lon,"Marker","o")

geobasemap streets

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Sign in to answer this question.

See Also

Categories

Mathematics and OptimizationMapping ToolboxData Import and ExportWeb Map Service

RadarMapping ToolboxData Import and ExportWeb Map Service

Find more on Web Map Service in Help Center and File Exchange

Tags

  • matlab
  • csv
  • plot

Products

  • MATLAB

Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


Plot latitude and longitude on google map (10)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

Plot latitude and longitude on google map (2024)
Top Articles
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 6493

Rating: 4.2 / 5 (63 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.