Borrar filtros
Borrar filtros

How to view a shape file in matlab

155 visualizaciones (últimos 30 días)
John
John el 24 de Dic. de 2012
Hello,
I have a .shp file of the country Ireland.
I read the file into matlab using the code:
S = shaperead('Ireland.shp')
My question is how can I view the map?
I would appreciate it if anybody had the time to show me.
Also, is it possible to overlay GPS data on a file of this type?
Thank you
  1 comentario
alessio grechi
alessio grechi el 18 de Oct. de 2018
Editada: alessio grechi el 18 de Oct. de 2018
ciao. Sei riuscito a far visualizzare la mappa in MatLab?

Iniciar sesión para comentar.

Respuesta aceptada

José-Luis
José-Luis el 24 de Dic. de 2012
doc mapshow
It can be as simple as:
S = shaperead(filename);
mapshow(S);
As long as you have latitude and longitude, you can plot pretty much anything
doc plotm
  6 comentarios
John
John el 24 de Dic. de 2012
Editada: John el 24 de Dic. de 2012
Hello,
When I use the plot function the point does not appear to be displayed on the map. I can't see it.
Also, I tried the other method, I displayed the map and typed "axesmui" but it says "not a map axis".
Can I ask the question, is the map I have suitable for overlaying latitude and longitude data on it. The axes scales don't seem to be in lat long format. Are they?
Would you know where I could source a suitable map?
What I am trying to do is overlay GPS data from a car on map and reproduce something like this:
I appreciate your help.
Thanks
J
José-Luis
José-Luis el 24 de Dic. de 2012
If you are plotting a point, are you sure your Marker is large enough so you can see it, try a large size first
plot(x,y,'LineStyle','none','Marker','o','MarkerSize',20);
The map you are linking to does not appear to be in lat-long, it looks like UTM.
I don't know where you could find a suitable map, but google can help you. You could also look at worldmap() from Matlab.

Iniciar sesión para comentar.

Más respuestas (2)

John
John el 25 de Dic. de 2012
Hi Jose,
Thank for your help with this. I managed to get it working in the end. I sourced a better map using your suggestion worldmap().
I have one further question if you don't mind.
I am getting this map using the code below.
ax = worldmap('ireland');
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(ax, land, 'FaceColor', [0.5 0.7 0.5])
How can I just limit the display to just display between Lat 51-55.5 and long 5-10.5. I just want to display Ireland.
Thank you
J
  5 comentarios
José-Luis
José-Luis el 25 de Dic. de 2012
Harold Steven Buitrago Segura
Harold Steven Buitrago Segura el 29 de Abr. de 2022
Maybe you could use the geolimit function

Iniciar sesión para comentar.


Clelia Massarino
Clelia Massarino el 20 de Sept. de 2018
Hello,
I am having problem displaying the Germany map. My final goal is to have one with the elevation or at least different colors to discern different altitudes. I used the same code of you but it starts running endlessly. Any suggestion?
  1 comentario
Alessandro Mura
Alessandro Mura el 21 de Dic. de 2021
@Clelia Massarino sei riuscito a cambiare i diversi colori della mappa della Germania? se si ti posso chiedere per favore lo script?
ti ringrazio

Iniciar sesión para comentar.

Categorías

Más información sobre Mapping Toolbox en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by