How to Solve m_gshhs_i Error

I encountered a small problem when running m_gshhs_i after installing High Precision Shoreline GSHHS

First, review the installation method:

Download GSHHS coastlines and WDBII rivers/borders in native binary format ( zip archive )‘’ from

Step 2:
unzip the zip file to the (……\MATLAB\toolbox\m_map\private) path

If there is no problem using m_gshhs_i in matlab after the above two steps, then there is no need to perform the operation and just use it normally. If the error is reported using m_gshhs_i as follows.

WARNING: Coastline file private/gshhs_i.b not found \n(Have you installed it?See the M_Map User's Guide for details)\n ---Using default coastline instead 

Then we need to go to ……\MATLAB\toolbox\m_map\path to find the m_gshhs.m file, open it and find


Modify it with:


After saving, use m_gshhs_i again and find that it works fine. If it does not work properly after modification, then try modifying it to

FILNAME='The path to matlab on your computer\MATLAB\toolbox\m_map\private\';

At this time, it can be used normally m_gshhs_i.

Read More: