Questions tagged [pyproj]

A Python interface to the PROJ library to perform cartographic transformations and geodetic computations.

Filter by
Sorted by
Tagged with
1
vote
2answers
39 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-...
4
votes
0answers
24 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
0answers
30 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
1answer
28 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
1answer
52 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
1answer
50 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
2answers
49 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
1answer
542 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
1answer
279 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
0answers
53 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
0answers
35 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
0answers
62 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
3answers
109 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
1answer
83 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
1answer
101 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
1answer
41 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
0answers
52 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
2answers
185 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
0answers
38 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
1answer
81 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
1answer
157 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
1answer
51 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
3answers
527 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
1answer
173 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
1answer
66 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
1answer
68 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
1answer
116 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
1answer
154 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
0answers
536 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
1answer
50 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
0answers
48 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
0answers
190 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
1answer
162 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
1answer
156 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 ...
0
votes
1answer
1k 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 ...
0
votes
0answers
101 views

geopandas.to_crs(epsg=3395) does not work in jupyter notebook. it seems some mismatch with pyproj & geopandas versions?

After importing geopandas df , with epsg =4326, I tried to re project it to epsg =3395 using gdf.to_crs(epsg =3395) in jupyter python note book. I got error "RuntimeError: b'no arguments in ...
2
votes
1answer
245 views

Converting from EPSG:4978 to EPSG:4326 using pyproj always produces 0.0 latitude

I am trying to convert between EPSG 4326 and 4978. I have wrote the following codes: import pyproj lon = -74.6604194 lat = 40.3450248 transformer = pyproj.Transformer.from_crs("EPSG:4326", &...
3
votes
3answers
270 views

What is EPSG number for NZTM?

I am trying to follow the solution posted at Converting projected coordinates to lat/lon using Python to convert NZTM coordinates into WGS84. I wrote following script to covert NZTM to WGS84: from ...
2
votes
0answers
548 views

Pyproj Invalid projection: +init=epsg:25832

In my Python Pandas project I have a .csv file with geographic coordinates and want to transform it into lat,lon format. the last weeks I successfully used the following code to make it work. import ...
0
votes
0answers
68 views

Converting LCC crs to another format

I collected metadata about POIs which I want to visualize. The original data however makes use of a projected CRS ("LCC projection") which I want to transform to lat/lon (WGS84): "crs&...
1
vote
1answer
730 views

Unable to install proj related Python packages in a Linux alpine environment

I'm unable to install pyproj or any proj related Python packages such as geopandas, in an alpine dockerized environment, e.g. [python:3.9.1-alpine3.12][1]. Error is, e.g. for pyproj itself here: # pip ...
3
votes
1answer
164 views

Converting Individual Points Instead of Entire Geometries Causes Different Transformation Results in GeoPandas and PyProj

I am working with geospatial data to be used to make calls to the Foursquare API and conduct cluster analysis on extracted data. To do this, it is helpful if I can project data using both GeoPandas....
4
votes
1answer
373 views

Converting NetCDF WRF weather forecasts from a custom Lambert Conformal Conical projection to WSG84

I'm having some trouble reading a WRF weather forecast prediction file where the coordinates are in a custom Lambert Conformal Conical projection. My final goal is to get the weather forecast a a ...
0
votes
0answers
47 views

Get projection parameters from Leaflet

I have a Leaflet map that is customized by an end-user by panning and zooming to an area of interest. I'd like to then take all of the relevant parameters (projection, zoom level, bounds, etc) and ...
0
votes
1answer
86 views

Using vgridshift from Python

When running the following code:- outProj = Proj("+proj=vgridshift +grids=dvr90.gtx") I am getting the following error: pyproj.exceptions.CRSError: Input is not a CRS: +proj=vgridshift +...
1
vote
1answer
52 views

Large scale map projection (ca. 20 km) in pyproj results in wrong distance

I would like to transform from lon/lat (EPSG:4326) to a local x/y coordinate system for large scale equidistant maps with a map size of ca. 20 km. I need to do this mapping all over the globe apart ...
2
votes
1answer
935 views

How to project Lambert Conformal Conic to WGS84 in Python?

I am using pyproj to re-project Canada's Census Tract boundary shapefiles that are currently in "PCS Lambert Conformal Conic" system. I want to convert them to latitude and longitude WGS84 ...
2
votes
1answer
112 views

Unexpected Conversion Result using Pyproj

I am trying to use Pyproj to convert a location in Boston from State Plane to Latitude and Longitude. However, the result did not turn out as I expected. Here is my snippet: from pyproj import Proj, ...
0
votes
2answers
122 views

Why are the 500 meters not 500 meters? And how do I add 500 meters in x/y direction to a lat/lon point?

I wanted to create a square cell on a map with size 500m times 500m. Therefore, I wrote the following code: from pyproj import Transformer bl_lat, bl_lon = 40.64423086189233, -74.0307935018417 ...
3
votes
1answer
2k views

Shapely flips lat/long coordinate

I have a pandas dataframe containing a Shapely geometry object. The shapely object (circle) was computed from the following SO https://stackoverflow.com/questions/27431528/find-the-intersection-...

1
2 3 4 5