You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
How to add a map as background in MATLAB to the points i have already plotted. I am interested in mapping the Surat city region as background
21 views (last 30 days)
Show older comments
lat = [21.1658 21.1655 21.16672 21.15832 21.16441 21.15638 21.17459 21.17103 21.17166 21.14175 21.17098 21.17521 21.16423 21.17525 21.16205];
lon = [72.7939 72.7937 72.79333 72.75241 72.77744 72.77798 72.77342 72.78658 72.78956 72.75316 72.77758 72.80426 72.79398 72.78943 72.75631];
plot(lon, lat, '.b', 'MarkerSize', 15);
grid on
11 Comments
Simran Sandhu
on 1 Sep 2018
So basically I don't have mapping toolbox How can it be done without toolbox
Simran Sandhu
on 1 Sep 2018
Or what are the ways to do it using mapping toolbox I can arrange a higher version of MATLAB
jonas
on 1 Sep 2018
Edited: jonas
on 1 Sep 2018
There are other options on fileexchange as well. But honestly I dont know what works with release 2013. See here for example
https://se.mathworks.com/matlabcentral/fileexchange/27627-zoharby-plot_google_map
https://se.mathworks.com/matlabcentral/fileexchange/50390-borders
Simran Sandhu
on 1 Sep 2018
This is something I got,,but they are overlapping,just the way I have India map I am willing to have for a city like Surat
jonas
on 1 Sep 2018
Edited: jonas
on 1 Sep 2018
I assueme you used the borders function, which is for plotting land and sea borders, not single cities. Did you try the m_map package that KSSV linked? I have not used it myself, but I've read that it has a m_shaperead() function, which is exactly what you need. You just have to find a shapefile (.shp) online.
Simran Sandhu
on 1 Sep 2018
Umm yeah even am thinking the same to update it. Thank You I'll try to do it
Accepted Answer
KSSV
on 1 Sep 2018
YOu have many ways to achieve that. I will list few:
1. Go to google maps, download the required domain you want and plot.
2. Go to google images, download the required images, fix the limits and plot.
3. Get surat shape file from google and plot.
24 Comments
Simran Sandhu
on 1 Sep 2018
Edited: Simran Sandhu
on 1 Sep 2018
no luck with it..i downloaded the shape file, but giving errors. Please help me with it The help would be appreciated
Simran Sandhu
on 1 Sep 2018
This is something I got,,but they are overlapping,just the way I have India map I am willing to have for a city like Surat
Simran Sandhu
on 2 Sep 2018
I downloaded the surat city map,,but while plotting the points they are not in the perfect location,,is there any way to sort that out?
Also I used borders syntax but still that doesnt have the surat city or gujarat any of it
KSSV
on 2 Sep 2018
If you use jpg, png ..you must know the exact (lat, Lon) ..do you know the limits? Go to Google maps and try to get the limits.
Simran Sandhu
on 2 Sep 2018
Yes I do have the exact lat longs, got the lats and longs from google maps itself
Simran Sandhu
on 2 Sep 2018
clc; clear all; close all; a=imread('surat.jpg'); imresize(a,20); imshow(a) hold on plot(21.1658,72.7939 , 'r*', 'LineWidth', 2, 'MarkerSize', 15); hold on; plot(21.1620,72.7563, 'b*', 'LineWidth', 2, 'MarkerSize', 15); hold on;
Simran Sandhu
on 2 Sep 2018
I know the latitude and longitude of surat city 21.1702° N, 72.8311° E but ain't aware of the limits. Also am not an expert to MATLAB so thank you for all the support you are giving
Simran Sandhu
on 2 Sep 2018
Edited: KSSV
on 3 Sep 2018
c=imread('surat.jpg');
image([ 21.1591425 21.1702401 ],[ 72.6822085 72.8310607 ], c);
hold on;
plot(21.1658,72.7939 , 'r*', 'LineWidth', 2, 'MarkerSize', 15);
hold on;
plot(21.1655,72.7937, 'b*', 'LineWidth', 2, 'MarkerSize', 15);
hold on;
plot(21.166718,72.7933298, 'c*', 'LineWidth', 2, 'MarkerSize', 15);
hold on;
plot(21.1583221,72.7524079, 'k*', 'LineWidth', 2, 'MarkerSize', 15);
hold on;
plot(21.16441411,72.7774434, 'g*', 'LineWidth', 2, 'MarkerSize', 15);
hold on;
plot(21.1563791,72.7779792, 'm*', 'LineWidth', 2, 'MarkerSize', 15);
hold on;
KSSV
on 3 Sep 2018
When you plot the image....you need to remove the grey borders....when you use the image function....it will consider the grey borders also.....you need to select the image properly.
Simran Sandhu
on 3 Sep 2018
Edited: KSSV
on 3 Sep 2018
lat = [21.1658 21.1655 21.16672 21.15832 21.16441 21.15638 21.17459 21.17103 21.17166 21.14175 21.17098 21.17521 21.16423 21.17525 21.16205];
lon = [72.7939 72.7937 72.79333 72.75241 72.77744 72.77798 72.77342 72.78658 72.78956 72.75316 72.77758 72.80426 72.79398 72.78943 72.75631];
plot(lon, lat, '.b', 'MarkerSize', 15);
grid on
plot_google_map('MapScale', 1)
Simran Sandhu
on 3 Sep 2018
plot_google_map('MapScale', 1) I used this function so it gave the background map of surat itself
Simran Sandhu
on 8 Sep 2018
This is the map i got,,now if i wish to create a coverage are that is show the are covered by one point how to do it?
jonas
on 8 Sep 2018
You should accept the answer when the original question is resolved. Also, what do you mean by coverage?
Simran Sandhu
on 8 Sep 2018
yes sorry.new to this all that is why.. coverage as in BTS coverage.. the area covered by BTS for providing services
More Answers (0)
See Also
Categories
Find more on Mapping Toolbox in Help Center and File Exchange
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.
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
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
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
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)