1

I'm trying to add a feature to draw a map but this error: "Incomplete shapefile definition in 'eez v11.shp'" keeps popping. Here is the code I wrote:

fname = 'eez_v11.shp'
shape_feature = ShapelyFeature(Reader(fname).geometries(),
                                ccrs.PlateCarree(), edgecolor='k',facecolor='gray')
ax.add_feature(shape_feature)

Do you know how I can solve this issue?

2
  • Are the other three files which are part of the format present in the same directory (.shx,.dbf,.prj)? The third isn't required but ought to be present. Note that "eez v11.shp" is an invalid shapefile name, because it is not 8.3 conformant (most readers won't complain about prefix length, but the space might cause trouble).
    – Vince
    Commented May 5, 2021 at 11:08
  • Thanks, I did not pay attention to that. Now I saved the four files in the same directory, another error message appears : " Unable to open World_EEZ_v11_20191118/eez_v11.dbf or World_EEZ_v11_20191118/eez_v11.shp.", do you perhaps know why does this error occur ? Commented May 5, 2021 at 12:37

1 Answer 1

2

In Source code for cartopy.io.shapereader

if reader.shp is None or reader.shx is None or reader.dbf is None:
   raise ValueError("Incomplete shapefile definition "
                    "in '%s'." % filename)

So one of these files is missing

2
  • Thank you for your answer, unfortunately even with all the files in the same directory, a new error message appears Unable to open World_EEZ_v11_20191118/eez_v11.dbf or World_EEZ_v11_20191118/eez_v11.shp but I don't understand why Commented May 5, 2021 at 12:40
  • Without the original shapefile, we can do nothing.
    – gene
    Commented May 5, 2021 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.