I have a dataframe which have columns with type “Shapefile”. So I guess it is not easy to share it here. But it looks like this:
THESE ARE THE LIBRARIES BEING USED
using Shapefile
using DataFrames
using Colors
using Compose
using Gadfly
THIS IS THE FUNCTION IN CODE
# Going from one kind of polygon to another
ESRI2Compose(poly::Shapefile.Polygon) = Compose.FormTree(Compose.Polygon([Compose.Point(point.x,point.y) for point in poly.points]))
THIS IS MY ATTEMPT
for row in df_x
c = compose(c,compose(canvas(template),ESRI2Compose(row["x1"][1]),
linewidth(0.05mm),stroke(color),fill(nothing)))
end
Your example is not an MWE (see Please read: make it easier to help you), but it looks like you’re calling compose(c, ...) in your loop without first defining c.
It might be useful to have a look at the Julia language docs and maybe the documentation for the packages you’re using to get the hang of the basic usage, as step-by-step debugging via Discourse might be pretty time consuming…
Not sure I understand - do you mean in terms of an MWE? There are many shapefiles available freely online, or you could equally just create a shapefile object manually in an MWE.
Currently none of the errors you encountered were related to actual shapefiles, so any DataFrame would have worked as an MWE. If you absolutely need a shapefile for the MWE you could either read it in from a publicly available URL or construct one using the constructor in the relevant package (I don’t work with shapefiles so wouldn’t know what this is, but above you are getting a String because "a" constructs a String, you would probably need something like ShapeFile(-80.1133, 43.5557, -79.9648, 43.7129) but the form of the constructor will depend on the package you’re using)