Creating custom DataFrame types

Have you tried struct GeoData <: AbstractDataFrame? Then all you need to do (assuming there’s a well-defined one) is to implement the basic DataFrame interface your GeoData type, and all functions that 1) take an AbstractDataFrame and 2) use the interface should automatically work.

This is how we did it in MetaGraphs.

Also: you might reconsider your GeoData struct:

struct GeoData{T<:AbstractDataFrame} <: AbstractDataFrame
  data::T
  coordnames::Vector{Symbol}
end

This avoids having an abstract type as a field, which supposedly improves performance.

2 Likes