I suspect this is a trivial question to answer but how do I load mapinfo mid/mif files into GeoPandas?
While it's trivial to load and manipulate .shp files, I can't work out what code to use:
Here's a few examples of the data I'm trying to play with: http://www.stoke.gov.uk/ccm/content/business/general/open-geospatial-consortium-data-catalogue.en
cylpaths = geopandas.GeoDataFrame.from_file(path)
I tried to test the geometry, which shows:
cylpaths.crs
Out[15]:
{u'ellps': u'airy',
u'k': 0.9996012717,
u'lat_0': 49,
u'lon_0': -2,
u'no_defs': True,
u'proj': u'tmerc',
u'towgs84': u'375,-111,431,-0,-0,-0,0',
u'units': u'm',
u'x_0': 400000,
u'y_0': -100000}
But when I try to preview the data, I get an empty dataframe:
cylpaths
Out[16]:
Int64Index([], dtype='int64') Empty GeoDataFrame
I'm a bit lost in working out what I need to do next.
Best Answer
I think you were doing things just fine, I'm wondering if it's just the dataset. I'm thinking you were trying to open the Cycleways dataset, yes (based on your variable name of
cylpaths
)? I first tried the "Car Parks" dataset on that site, and it worked with your code:I then tried the "Cycleways" dataset, and got the same thing as you, nothing:
Finally, I tried to open the "Existing Shopping Areas" dataset, and it worked fine as well:
So, maybe it's just the original Mapinfo files perhaps?