I suggest not to create such a matrix, which could be quite inefficient, but if you really need this, you create an ascii file with Long, lat, and value as columns, (which you can import in Matlab.)
gdal_translate -of XYZ input.tif output.asc
gdal is also available from qgis as a plugin (with a GUI), but you can use it directly as a command line.
Note that you can find your coordinates directly based on the row and column number. The easiest case is a starting from a matrix that is already in long/lat, in other words a regular grid in Lat/long coordinate system.
so you need to extract the upper left corner coordiantes, and the lat/long can be computed based on the index of you element
lat = upperLeftLat - Ysize*row
long = upperLeftLong + XSize*column
If you are not in this ideal case, you need to account for the rotation of the matrix and, potentially, the projection. But this can also be done "on the fly" without creating a new matrix (although if you need to reproject your data, it is better to do it first).
You can either reproject your polygon shapefile OR your dataset. EPSG is a short code for spatial projections. EPSG:4326 is the code for non-projected data in degrees using wgs84: http://spatialreference.org/ref/epsg/4326/
Reproject your polygon into 4326
france_wgs84 <- spTransform(france_L93, CRS("+init=epsg:4326"))
Reproject your dataset into Lambert93
data <- structure(list(centerid = c("0121H1", "0121H2", "0218H3", "0303H1",
"0303H2"), latitude = c(46.2236804, 46.2236804, 49.3700842, 46.3429172,
46.3429172), longitude = c(5.2108193, 5.2108193, 3.335127, 2.6089958,
2.6089958), adresse_complete = c("900 Route de Paris, 01440 Viriat, France",
"900 Route de Paris, 01440 Viriat, France", "46 Avenue du Général de Gaulle, 02200 Soissons, France",
"18 Avenue du 8 Mai 1945, 03100 Montluçon, France", "18 Avenue du 8 Mai 1945, 03100 Montluçon, France"
)), .Names = c("centerid", "latitude", "longitude", "adresse_complete"
), row.names = c(NA, 5L), class = "data.frame")
coordinates(data) <- ~longitude+latitude
proj4string(data) <- "+init=epsg:4326"
data_L93 <- spTransform(data, CRS("+proj=lcc +lat_1=44 +lat_2=49 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m
+no_defs"))
Best Answer
To my knowledge, Google Earth Pro does not directly have a way to provide you with the lat/long of the centroids of the polygons in your shapefile. It is possible to export out the coordinates (may not be lat/long) of the vertices of the polygons, as described in this video: https://www.youtube.com/watch?v=dlWhGSIXm1U. However, this will be a cleaner process if you work directly with the shapefile in a GIS application such as QGIS.
The following assumes you want one lat/long pair for each polygon centroid as a CSV file.
First, you want to be sure of what coordinate system the shapefile is using. Per https://opensourceforu.com/2015/03/assigning-map-projections-in-qgis :
If you do not have a geographic coordinate system assigned such as WGS84, your data will be in meters or feet rather than degrees. Coordinate systems are a deeper topic that you can explore elsewhere on the site or in tutorials. Todd Vachon's article gives a brief overview.
Once you have the data in WGS84, which has degrees as its unit and the coordinates are in lat/long, you can extract and export the centroids of each polgyon. The post linked by @FSimardGIS can help. You can create a centroid layer and add the coordinates directly to that layer as described by @Curlew, or you can simply create the centroids and save the layer to CSV format as described in Vachon's article: