Sage: How to import a graph from a shapefile into Sage?
I would like to import a graph and afterwards use functions from the networkx library in the Sage Notebook. Python is totally new for me and I have not that much experience with programming. How to transfer a shapefile into Sage? I tried
import networkx as nx
g=nx.read_shp(r‘D:\Useres\...\ver06_l.shp’)
That gives
ImportError: read_shp requires OGR: http://www.gdal.org/
Unfortunately, this link doesn’t help me. Thank you in advance
Looks like this requires a special library to be loaded.
Well, it's not clear how exactly you run Sage. Do you run it in a VM on Windows?
installing gdal is not easy. You might be better off doing a conversion of shapfiles into networkx graphs in an installation of Python with gdal installed, and writing these graphs into files; and then read the latter files in Sage.
Yes, I run it in the Oracle VM. Thanks for your answers!