New answers tagged

5

The +init= syntax is deprecated. So all you need is the ESRI:102001 part. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#init-auth-auth-code-should-be-replaced-with-auth-auth-code inputGDF.crs = 'esri:102001'


2

The issue you are having is due to axis order changes in PROJ 6+: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 One solution is to use always_xy: from shapely.geometry import LineString from shapely.ops import transform from functools import partial import pyproj roadsegment = LineString([(5.318945751388698, 50....


1

Could you try something like this for python file? C:\PROGRA~1\QGIS3~1.4\apps\Python37\python.exe c:/Users/user/Desktop/xx/run.py


3

You need to set the environment variables to run the QGIS python outside. In this case my QGIS installation is in D:\QGIS, so you should only change OSGEO4W_ROOT. @ECHO OFF set OSGEO4W_ROOT=D:\QGIS call "%OSGEO4W_ROOT%\bin\o4w_env.bat" call "%OSGEO4W_ROOT%\bin\qt5_env.bat" call "%OSGEO4W_ROOT%\bin\py3_env.bat" path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH% ...


1

@jelleve, your answer is correct and in line with https://pyproj4.github.io/pyproj/stable/advanced_examples.html#optimize-transformations. Additionally, you may be interested in geopandas. It will enable you to read/write these geometries and reproject them using the same method you showed above using one line of code: gdf = geopandas.read_file("input....


0

After some experimenting, it seems that I was just plain wrong. My initial code looked as follows: def convertCoordinates(polygon): transformer = pyproj.Transformer.from_proj(pyproj.Proj(init='epsg:27563'), pyproj.Proj(init='epsg:4326')) projected = shapely.ops.transform(transformer.transform, polygon) return projected for polygon in polygons: ...


Top 50 recent answers are included