<filename>Chapter04/B13346_04_18-ogr.py
# Examine a shapefile with ogr

# https://github.com/GeospatialPython/Learning/raw/master/point.zip

import ogr
shp = ogr.Open("point.shp")
layer = shp.GetLayer()
feature = layer.GetNextFeature()
while feature:
    geometry = feature.GetGeometryRef()
    print(geometry.GetX(), geometry.GetY(), feature.GetField("FIRST_FLD"))
    feature = layer.GetNextFeature()

<filename>Chapter04/B13346_04_18-ogr.py
# Examine a shapefile with ogr

# https://github.com/GeospatialPython/Learning/raw/master/point.zip

import ogr
shp = ogr.Open("point.shp")
layer = shp.GetLayer()
feature = layer.GetNextFeature()
while feature:
    geometry = feature.GetGeometryRef()
    print(geometry.GetX(), geometry.GetY(), feature.GetField("FIRST_FLD"))
    feature = layer.GetNextFeature()

# Examine a shapefile with ogr # https://github.com/GeospatialPython/Learning/raw/master/point.zip