> Do you know places where I can find precise border for small countries like Singapore?
Search the internet for shp files containing information about Singapore. I briefly searched data.gov.sg and found 294 shp files on Singapore from census data, municiple planning areas, and lots of different maps.
- Go to the 2010 census link above, download the zip file; unzip all files.
- Add the folder containing Region_Census2010.shp to your MATLAB path using addpath(...)
- Run the code below to see the map produced below. Note, these data break Singapore into Central, West, North, North-East, and East regions but is also includes at least some of the island borders.
- See notes in code below for more info.
First let's look at the shape info
info = shapeinfo('Region_Census2010.shp')
struct with fields:
Filename: [3×108 char]
BoundingBox: [2×2 double]
Attributes: [8×1 struct]
CoordinateReferenceSystem: [1×1 projcrs]
projcrs with properties:
GeographicCRS: [1×1 geocrs]
ProjectionMethod: "Transverse Mercator"
ProjectionParameters: [1×1 map.crs.ProjectionParameters]
The ProjectionMethod is "Transverse Mercator" which is "tranmerc" in Matlab if you choose to use map axes (eg, axesm('tranmerc')).
The coordinate reference system is not a geocrs object so this dataset does not use geographical coordinates (lat/lon) as described here. If you need Lat/Lon you'll either need to find a different sph file or perhaps these values can be converted.
S = shaperead('Region_Census2010.shp','UseGeoCoords',true)