You are on page 1of 1

## Python Interface

iface

help(iface)

##Add Vector layer:

iface.addVectorLayer("d:/.../points.shp","points", "ogr") *Sesuaikan dengan repositori penyimpanan


masing-masing

##Zoom

iface.zoomFull()

iface.zoomToPrevious()

iface.zoomToNext()

##Active Layer

layer = iface.activeLayer()

##Attribute Table

iface.showAttributeTable(layer)

##Layer Properties
iface.showLayerProperties(layer)

##Coordinates (Lat, Long)


for f in layer.getFeatures():
geom = f.geometry()
print (geom.asPoint())

##Coordinates along with Other Fields

for f in layer.getFeatures():

geom = f.geometry()

print ('%s, %s, %f, %f' % (f['Rumah_Saki'], f['Alamat'], geom.asPoint().y(), geom.asPoint().x()))

## run python

.............................

You might also like