Questions tagged [pyproj]
A Python interface to the PROJ library to perform cartographic transformations and geodetic computations.
253
questions
2
votes
2
answers
41
views
Getting wrong coordinates converting UTM to lon/lat with Proj
I have tried many ways to convert UTM to lon/lat, and getting always the same weird result.
Getting UTM and lon/lat for a point using GoogleEarth:
from pyproj import Proj
lon = -40.729124
lat = -20....
0
votes
0
answers
20
views
Is there a way to get/use a specific Datum Transformation in Pyproj not suggested by TransformerGroup?
I need a pyproj transformer (or at least a wkt string for the operation) going from CRS EPSG:3035 to CRS EPSG:28992 specifically using the datum transformation operation EPSG:4830. Very similar to ...
0
votes
1
answer
34
views
Conversion from wgs-84 to Minnesota state plane(NAD83(NSRS2007) / Minnesota South) gives NaN values
I am trying to convert latitude and longitude(EPSG:4326) to projected coordinate systems(NAD83(NSRS2007) / Minnesota South).
I followed this tutorial.
My code:
TRAN_4326_TO_3596 = Transformer.from_crs(...
2
votes
1
answer
39
views
What is an "ographic" latitude (such as in IAU projection 39916)?
In pyproj, I defined/loaded projection IAU 39916. This has the name "Earth (2015) / Ographic / Equirectangular, clon = 180". (I was looking for an equirectangular projection for ...
0
votes
1
answer
27
views
What projection to use for checking how near a point is to a polygon?
I'm using Shapely to do some GIS analysis in Python. I have a Polygon and a Point, both in EPSG 3857 (web Mercator). I want to check whether the point is within a given distance (in metres) of the ...
0
votes
2
answers
50
views
Pyproj and a custom CRS
I am converting the geographic coordinates used on old historic maps into WGS84. Through educated guesswork I can establish all the necessary parameters to rebuild the grid system and generate a wkt ...
2
votes
1
answer
90
views
Mask rotated/curvilinear grid (NetCDF) with rectilinear grid (geotiff)
I have two datasets:
Climate:
avg one month temperature
NetCDF File (CF Convention 1.6)
grid_mapping_name: rotated_latitude_longitude (with rlat and rlong coordinates defining the grid)
curvilinear ...
0
votes
1
answer
27
views
Why does this suggested change in a Python pyproj initalisation future warning result in an error?
I Recently updated to pyproj v2.6. and started getting future warnings when initalisating a Proj class like so:
Proj("+init=world:bng")
Proj("+init=EPSG:22770")
Both of these ...
2
votes
2
answers
70
views
PyProj doesn't reproduce original coordinate when transforming back
Why does PyProj give me a different coordinate to the original when I convert from EPSG:4326 to EPSG:7856 and back again?
from pyproj import Proj, Transformer
long, lat = (151.19203152785565, -33....
0
votes
2
answers
79
views
Given Web Mercator (EPSG:3857) coordinates, how to determine the relevant NAD83 local UTM Zone [duplicate]
I have a set of coordinates in epsg:3857:
webmerc_coords = (-8956562.6 5368787.8)
Is there a way to determine what the appropriate local NAD83 UTM projection should be for this point?
I'm specifically ...
3
votes
1
answer
37
views
Getting specific block from UTM CRS, not the zone
from pyproj import CRS, Proj
import utm
lat = 10.269558
lon = 25.234
coordsUtm = utm.from_latlon(lat,lon)
crs = CRS.from_dict({'proj': 'utm', 'zone': coordsUtm[2], 'south': False})
I want, ...
0
votes
0
answers
40
views
pyproj crs definition lacking the towgs84 parameter
I am trying to transform from ED50 UTM32 to Euref89 UTM32 using pyproj. With just using the crs 23032 for ED50 and 25832 for Euref89 I get an error at about 76 meters in East-West and 52 in South-...
3
votes
2
answers
66
views
Convert geodetic to topocentric coordinates in pyproj
I'm trying to convert between topocentric coordinates and geographic coordinates with pyproj.
First, I made a topocentric CRS using the proj4 string from the example here. Then, I made a geodetic CRS ...
0
votes
0
answers
47
views
ITRF2014 current epoch -> CSRS Epoch 2017.50 transformation
I need help transforming coordinates from ITRF2014 current epoch to CSRS Epoch 2017.50 (http://geoweb99.ucsd.edu/index.php/epoch2017/) (hopefully using pyproj python library).
Until this point, I've ...
4
votes
1
answer
84
views
Analysis between coordinate transformation libraries: Pyproj (Transformers Groups ) versus GeoPandas
When using the Pyproj function "TransformerGroup", I detected that for the CRS: "Camacupa 1948 / TM 12 SE - EPSG:22092" there is the possibility of executing the coordinate ...
1
vote
2
answers
98
views
How to create a NetCDF file with Albers conical equal area projection in Python
I was wondering how to create a NetCDF file with the following dimensions and variables;
<class 'netCDF4._netCDF4.Dataset'>
root group (NETCDF4 data model, file format HDF5):
Conventions: CF-...
5
votes
0
answers
47
views
Function and meaning of parameter lat_0 in Transverse Mercator Projection in PROJ String
One may specify a custom Transverse Mercator in PROJ library string with something like:
proj +proj=tmerc +lat_0=-25 +lon_0=-49
For me the function of the parameter lon_0 is clear, is the Central ...
0
votes
0
answers
73
views
Basemap npstere to cartopy NorthPolarStereo CRS
Somebody has given me the following code to convert north-polar stereographic (x,y) coordinates to WGS84 (lon,lats):
m = Basemap(projection='npstere',boundinglat=60,lon_0=0,resolution='l')
lon,lat = m(...
0
votes
1
answer
45
views
Merge two proj transforms into one (rotated lat/lon to EPSG)
I have a question that I assumed would be straightforward, but I'm unable to properly solve it. I have points on a rotated lat/lon grid, and I want to get their coordinates in another CRS. Currently, ...
3
votes
1
answer
71
views
Is there a difference in transformations betweeen pyproj 2.6.1post1 and 3.0.0?
I've got the following Python Script:
from pyproj import Transformer, transform
transformer = Transformer.from_crs(31468, 25832, always_xy=True)
x_coords = 4359995
y_coords = 5295525
transformer....
1
vote
1
answer
103
views
Using a specific transform on GeoPandas 'to_crs' function
I have a GeoDataFrame with CRS epsg:4326 and want to convert to epsg:32066
Such as:
gdf.to_crs(epsg=32066)
I know that GeoPandas is selecting the optimal transformation and it works.
But I want to ...
2
votes
2
answers
131
views
Is there a way to get/use a specific Transformation in Pyproj?
I have a specific transformation code that I would like to employ to transform one set of coordinates to another. Specifically the EPSG:15851 transformation. Is there a way to create a new Transform ...
6
votes
1
answer
1k
views
Convert GPS coordinates into 3-dimensional cartesian coordinates (x,y,z)
In a nutshell:
What is a valid EPSG code for an earth fixed 3-dimensional cartesian coordinate system?
If it is 6500: How can I trick the python library pyproj into using this 3D coordinate system ...
0
votes
1
answer
710
views
ImportError: cannot import name 'CRS' from 'pyproj'
I am getting the following error message when I am importing the rioxarray library.
In my conda env I have installed the pyproj version 3.1.0
Has anyone came across the same issue?
How can I fix it?
...
1
vote
0
answers
89
views
Helmert transformation in pyproj
I have a set of coordinate points projected in Web Mercator (EPSG:3857) and a raster specific coordinate system and have calculated the translation, rotation and scale for a Helmert transformation (P' ...
0
votes
0
answers
37
views
Python: Unexpected area results after converting lat/long coordinates to wkid:3857
My end-goal is to be able to calculate the areas of small polygons (between 1000 and 5000 sq ft) with lat/long coordinates. I am having some unexpected results when doing this and decided to switch to ...
2
votes
0
answers
100
views
How do I dump towgs84 conversions for PROJ strings?
Building off of the awesome answer by mikewatt here:
How do I dump PROJ EPSG database to PROJ4JS-compatible PROJ strings?
How would one dump the towgs84 conversion from the PROJ database for a given ...
1
vote
3
answers
223
views
Transforming EPSG:26918 to EPSG:4236 in GeoPandas
I am trying to transform a shapefile of polygons projected on CRS: EPSG:26918 to EPSG:4326 so that I can perform a spatial join in GeoPandas over two shapefiles.
My previous code allowed me to simply ...
1
vote
1
answer
123
views
How do I dump PROJ EPSG database to PROJ4JS-compatible PROJ strings?
I would like to know how I could dump the entire current/latest PROJ database of EPSG codes to PROJ4JS-compatible strings?
I have interrogated the proj.db using DBeaver and found that most of what I ...
1
vote
1
answer
175
views
How to choose and reference the PyProj 3.x Transformer that's consistent with PyProj 1.x?
I have a database with many coordinates that were transformed using PyProj 1.9.6 (with PROJ 4.9.3 in wheels). I want to ensure that the positioning remains consistent after ugprading to PyProj 3.0.1 (...
0
votes
1
answer
58
views
Coordinate conversion using Python and filename
I'm trying to create a Python function to recognise which coordinate conversion to execute based on the last part of the filename - either BNG for British National Grid or ```IG`` for Irish Grid.
The ...
1
vote
0
answers
89
views
Pyproj returns inf when coordinates are inside bounds
I'm trying to parse the data from GHSL-POP, converting coordinates to real-world latitudes and longitudes. But pyproj returns inf value for some coordinates that are inside bounds. Here is my code:
...
2
votes
2
answers
344
views
Python function which recognises when to convert coordinate system
How do I write Python code for an AWS lambda function which will convert easting and northings to longitude and latitude?
For example, if a CSV is uploaded into an S3 bucket it may contain either ...
0
votes
0
answers
48
views
Choosing the right projection using PyProj
I'm starting with GIS work trying to analyze movement of cars on a track.
I've understood that in order to use a library like shapely I need to transform from GPS spherical coordinates to Cartesian ...
2
votes
1
answer
304
views
How to calculate the corner points of a grid if centre points are know
I am working with a file which has the coordinates in WGS84 format. From this file I have calculated the Cartesian coordinates using the following code:
import numpy as np
import pyproj
from netCDF4 ...
0
votes
1
answer
360
views
Converting latitude/longitude to UTM using GDA2020 datum with Pyproj
I want to convert a pair of (latitude, longitude) values that represent a location in Australia to UTM values within the GDA2020 datum.
I tried to do something similar to what I usually do with North ...
1
vote
1
answer
53
views
How convert lat lon to another format? [closed]
Input data
47,4792010000765
42,989255000241
Output data
5285360.478599999
5310336.491400003
But i receive
3643985.9453798616
5539030.168736918
Whats incorrect in my code?
import pyproj
Lat = 47....
4
votes
3
answers
560
views
I am getting the wrong result for north coordinate
from pyproj import Proj
#converting lat/long - UTM
lats = -22.818009494
longs = -47.059235202
alt = 644.2332
myProj = Proj("+proj=utm +zone=23K, +south +ellps=WGS84 +datum=WGS84 +units=m +...
1
vote
1
answer
291
views
How to get the affine matrix between 2 projection using pyproj?
I'm struggling getting the affine matrix (or crs_transform) using pyproj. The Transformerobject is full of functions to actually transform coordinates but I just want to check the matrix:
I'm stuck ...
1
vote
1
answer
112
views
QGIS custom coordinate reference system of a local site
I am creating a geo database for an archaeological excavation. We want to put data from a local system and from UTM35 in the same QGIS-project. I have Ground Control Points in both systems.
I setted ...
2
votes
1
answer
86
views
How to convert Australia related EPSG in pyproj?
I want to convert longitude (151.209900) and latitude (-33.865143) into Australia related EPSG (4283 and 7844) by using pyproj library.
I have tried:
from pyproj import CRS, Transformer
transformer = ...
2
votes
1
answer
176
views
PostGIS ST_Transform seems to treat the vertical datum but not the equivalent pyproj Transformer, even so they both rely on Proj
I've narrowed down a problem I met when processing some points having altitude values to the following:
It seems that PostGIS and pyproj do not treat the vertical datum in the same way but both are ...
2
votes
1
answer
262
views
Getting Projected bounds information in pyproj
I'm building an API where user can insert a number (3857, 27700,etc.) and my API will give the projected bounds.
I'm using pyproj's
crs_number = 27700
crs_custom = CRS.from_user_input(crs_number)
...
1
vote
0
answers
657
views
how to convert X, Y coordinates pixel of the screenshot image.png from the map to really Long, lat
I need to convert the x,y coordinate of the PNG image from the map into Latitude and Longitude. I took an image from google-map that map image is cut from the part of the city here is a sample image ...
0
votes
1
answer
93
views
Cassini (Soldner) in pyproj
So there is the cassini projection in Proj. It is possible to use it in the OSGeo4WShell.
example: +proj=cass +lon_0=.... +lat_0=.... +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs
Is there a way to ...
1
vote
0
answers
78
views
Special relationship between EPSG:4326 and EPSG:4369
This is a follow-up question to a previous one (Projection between EPSG:4326 and EPSG:4269 using pyproj does nothing).
When using pyproj (python 3.8.8 and pyproj 3.0.1 on windows) to project a point ...
1
vote
0
answers
264
views
Projection between EPSG:4326 and EPSG:4269 using pyproj does nothing [duplicate]
According to this quite thorough answer :
Is re-projection needed from SRID 4326 (WGS 84) to SRID 4269 (NAD 83)?
the crs EPSG:4326 and EPSG:4269 are slightly different, due to a difference in one of ...
2
votes
1
answer
358
views
Problem transforming coordinates with PyProj
I would like to plot a marker using the Folium library but the data I have is in ETRS89 and Folium does not accept that projection. I am having problems transforming from EPSG25830 (ETRS89) to ...
0
votes
1
answer
264
views
Use custom projection in MapProxy
I'm trying to use the proj_data_dir config setting in MapProxy to add support for a custom projection. So far I've been unsuccessful and suspect I'm almost there, but not quite...
I've created a file ...
1
vote
1
answer
3k
views
Setting CRS of point using shapely
I am working on a tool, which transfers data, including geometries, from different legacy databases to postgis.
Currently this means I have a MS-access Database, which contains point geometries, but ...