How to produce georeferenced maps?

2 views (last 30 days)
Shadi
Shadi on 16 Jul 2024
Answered: Anshuman on 3 Sep 2024
I am using Snap2StAMPS thrid-party module installed over matlab and I create maps that contains persistent scatterer points/pixel that contains annual ground displacement velocity over period of time and i would like to know how to make matlab georeference the produced figures so that i can export them into google earth and arcgis. I have got the X,Y coordinate of the the study area boundaries [32.1013 , 29.6010 ] , [32.6143 , 29.2054]

Answers (1)

Anshuman
Anshuman on 3 Sep 2024
To georeference your figures in MATLAB and export them for use in Google Earth, you can follow these steps:
  1. Use the boundary coordinates you've provided to define the extent of your map. These coordinates correspond to the corners of your study area.
  2. If your data is in pixel coordinates, you'll need to transform it to geographic coordinates (latitude and longitude) based on the extent.
  3. Use the 'maprefcells' function to create a referencing object that defines the relationship between the pixel grid and geographic coordinates.
  4. You can use the 'kmlwrite' function to export your georeferenced data to a KML file, which can be opened in Google Earth.
% Create a KML file
kml_filename = 'displacement_velocity.kml';
% Assuming you have a matrix 'your_data' containing the displacement values
% and a colormap 'cmap' to represent the data visually
kmlwrite(kml_filename, R, your_data, 'ColorMap', cmap);
5. To export your data to ArcGIS, you might want to save it as a GeoTIFF file. You can use the 'geotiffwrite' function
% Create a GeoTIFF file
geotiff_filename = 'displacement_velocity.tif';
% Write the data to a GeoTIFF file
geotiffwrite(geotiff_filename, your_data, R, 'CoordRefSysCode', 'EPSG:4326');
You can refere to these documentations for more details:

Community Treasure Hunt

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

Start Hunting!