I like to extract a buffer of a railway system to a .poly file and use this one to extract further object within this buffer from an OSM file of germany.
I have defined a CRS for the layer of interest (UTM 32N)
The message QgsCoordinateReferenceSystem' is not defined
is displayed when I try to use the plugin osmpoly in QGIS.
how to fix this?
I tried both suggestions. Did not work. neither the combination of them. New messages are displayed for
suggestion 1)
suggestion 2)
sugestion 1) and 2) combined (do not know if this makes sense at all)
after suggestion 1) and change linie 166 as below:
When I export my layer out of the used geopackage to .shp in WGS 84 (4326), the failure messages do not show anymore but the .poly is not created either.
Best Answer
Apparently there is a bug in the code. Error message QgsCoordinateReferenceSystem is not defined is related to plug-in Python code rather than to lack of CRS defined in your layer. Now there are two options - you could obviously contact developer or you can try to fix the code yourself. If you choose the latter, go to the file C:/Users/User.../osmpoly_export/polygenerator.py (full path as in you screenshot), open it in text (or Python) editor and uncomment line 32 i.e. remove hash in the line:
#from qgis.core import *
or alternatively (and more pythonic) add in from section:
Another required change is to the line in the code (look for it around line 170): Replace:
With:
After that reload the plug-in (or restart QGIS)