Saving a figure as shape file

14 views (last 30 days)
Effat Behboudi
Effat Behboudi on 11 Feb 2022
Answered: Anjaneyulu Bairi on 11 Jan 2024
Hi everyone,
I'm trying to export a figure to a shape file so that I import it into ArcGIS. The figure is made up of arcs and lines.
I've already created the figure (attached), but I'm not sure how to export it as a shape file that includes all latc, longc, and Depth values. I'd also like to fill these bowties. Is there anyone who knows how to do it?
Thank you.
radius=0.15;
longitude=Data_FM(:,4);
latitude=Data_FM(:,5);
Depth=Data_FM(:,6);
AZ1=Data_FM(:,7);
Mean_AZ=Data_FM(:,8);
AZ2=Data_FM(:,9);
%arc
[latc1,longc1] = scircle1(latitude,longitude,radius*ones(length(Data_FM),1),[AZ1 AZ2]);
[latc2,longc2] = scircle1(latitude,longitude,radius*ones(length(Data_FM),1),[AZ1+180 AZ2+180]);
% connecting arcs
arclen=radius; %In units of degrees of arc
[latc3,longc3] = track1(latitude,longitude,AZ1,arclen*ones(length(Data_FM),1));
[latc4,longc4] = track1(latitude,longitude,AZ2,arclen*ones(length(Data_FM),1));
[latc5,longc5] = track1(latitude,longitude,AZ1+180,arclen*ones(length(Data_FM),1));
[latc6,longc6] =track1(latitude,longitude,AZ2+180,arclen*ones(length(Data_FM),1));
figure;axesm('mercator','MapLatLimit',[-42 -36],'MapLonLimit',[174 180]);
hold on;
plotm(latc1,longc1,'m');
plotm(latc2,longc2,'m');
plotm(latc3,longc3,'-m');
plotm(latc4,longc4,'-m');
plotm(latc5,longc5,'-m');
plotm(latc6,longc6,'-m');
hold off;
  2 Comments
Benjamin Thompson
Benjamin Thompson on 11 Feb 2022
Can you provide a sample of a shape file, or a link to the file specification?
Effat Behboudi
Effat Behboudi on 11 Feb 2022
Hi Benjamin,
I'm looking to a shape file as following figure to colour code the bowties based on depth.
Thanks,
Effat

Sign in to comment.

Answers (1)

Anjaneyulu Bairi
Anjaneyulu Bairi on 11 Jan 2024
Hi,
I understand that you are trying to create a shape file which contains geographic data to import into ArcGIS. In MATLAB, converting image file which contains raster data to a shape file containing vector data is not possible. You can try the below troubleshooting steps to resolve your query.
  • Create Geospatial Table from your data. There are multiple ways to create “Geospatial Table”, refer the documentation provided at the end.
  • Use the shapewrite” function to create shape with the following signature shapewrite(GT,filename)” ,where GT is Geospatial Table, the filename is location and name of the file at which to create the shapefile, specified as a string scalar or character vector. If you include a file extension, it must be .shp or .SHP.
Visit the below documentation for more information.
I hope it helps to resolve your query

Categories

Find more on Printing and Saving in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!