My main goal is to create a new feature indicating if the line features intersect each other as well as if they are not connected to a feature.
My problem is how to identify the intersecting and not connected points and converting them to another geometry layer.
The only thing I came up with is:
import ogr
driver = ogr.GetDriverByName('ESRI Shapefile')
inDatasource = driver.Open('test.shp', 0)
inLayer = inDatasource.GetLayer()
#loop through features in the layer
feature = inLayer.GetNextFeature()
while feature:
#condition
feature.Destroy()
feature = inLayer.GetNextFeature()
#check topology
outData = driver.CreateDataSource('TopologyResult.shp')
outLayer = outData.CreateLayer ('TopologyResult', geom_type = ogr.wkbPoint)
fieldDefn = ogr.FieldDefn ('id', ogr.OFTInteger)
outLayer.CreateField(fieldDefn)
featureDefn = outLayer.GetLayerDefn()
outFeature = ogr.Feature(featureDefn)
outFeature.SetGeometry(point)