Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- layer = iface.addVectorLayer("C:/Users/denni/Desktop/Qgis daten/TM_WORLD_BORDERS-0.3/TM_WORLD_BORDERS-0.3.shp","TM_WORLD_BORDERS-0.3","ogr")
- for feature in layer.getFeatures():
- geometry=feature.geometry(), centroid = geometry.centroid().asPoint(), name = feature.attribute("NAME"), print name,centroid.x(), centroid.y()
- Traceback (most recent call last):
- File "C:OSGEO4~1appsPython37libcode.py", line 63, in runsource
- code = self.compile(source, filename, symbol)
- File "C:OSGEO4~1appsPython37libcodeop.py", line 168, in __call__
- return _maybe_compile(self.compiler, source, filename, symbol)
- File "C:OSGEO4~1appsPython37libcodeop.py", line 99, in _maybe_compile
- raise err1
- File "C:OSGEO4~1appsPython37libcodeop.py", line 87, in _maybe_compile
- code1 = compiler(source + "n", filename, symbol)
- File "C:OSGEO4~1appsPython37libcodeop.py", line 133, in __call__
- codeob = compile(source, filename, symbol, self.flags, 1) File "<input>", line 2
- geometry=feature.geometry(), centroid = geometry.centroid().asPoint(), name = feature.attribute("NAME"), print name,centroid.x(), centroid.y()
- ^ IndentationError: expected an indented block
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement