I want to clip a polygon layer to an extent of another polyline layer. I want to use extract layer by extent processing tool, I want to automatically fetch the extent of my polyline layer along with EPSG, but somehow the extent values are not matching with the degree decimal values I want.
As you can see the xmin, xmax values start with 525.. something, but when I use this code to fetch my polyline layer extent the values come as -
layer = QgsVectorLayer(polyline, 'polyline', 'ogr')
ext = layer.extent()
xmin = ext.xMinimum()
xmax = ext.xMaximum()
ymin = ext.yMinimum()
ymax = ext.yMaximum()
coords = "%f,%f,%f,%f" % (xmin, xmax, ymin, ymax)
print("coords - " + str(coords))
What am I missing here how to get the same 525.. values as in processing tool.
My project has a defined Projection system which is same as the layer's coordinate system. epsg - 2157