Shapefile.jl icon indicating copy to clipboard operation
Shapefile.jl copied to clipboard

"MethodError: no method matching length(::Shapefile.Row{Shapefile.Polygon})" in Pluto.jl

Open schneiderfelipe opened this issue 3 years ago • 1 comments

Hi, I got the following error while reading a shapefile (the exact shapefile can be downloaded here) in Pluto.jl:

Captura de tela de 2021-03-21 15-46-45

On the other hand, the following is obtained in the REPL:

julia> using Shapefile

julia> geotable = Shapefile.Table("SC_Municipios_2020.shp")
Shapefile.Table{Union{Missing, Shapefile.Polygon}} with 295 rows and the following 5 columns:
	
geometry, CD_MUN, NM_MUN, SIGLA_UF, AREA_KM2

For now, I solved the issue by suppressing the output with ; in Pluto.jl, but is there a way to make the output work there too? (Maybe this is an issue with Pluto.jl, in which case I could open an issue there.)

schneiderfelipe avatar Mar 21 '21 18:03 schneiderfelipe

Thanks for the report. It looks like Pluto calls length(::Shapefile.Row) when showing tabular data, and this method does not exist. Rather than just adding this method, it seems the best solution is to make the Row a Tables.Abstractrow, as is suggested here: https://github.com/JuliaData/DBFTables.jl/pull/13. So first we should finish that PR, then do something similar here.

visr avatar Mar 24 '21 08:03 visr