Questions tagged [pyproj]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
37 views

Python script converts UTM to northern hemisphere fine, but I need southern hemisphere

I'll start off by saying that I do not know how to code, and I have been using this Python script to convert building models from lat-long into UTM for many years. The problem is that in all of these ...
0 votes
0 answers
17 views

Converting NAD83 to WGS84 using pyproj [duplicate]

I'm trying to convert lat&lon under NAD83 to WGS84 using pyproj. But the code seems not working. I got the same values as what I input. How can I get the right answer? from pyproj import CRS, ...
  • 1
1 vote
1 answer
33 views

Proj R_A discrepancy with computed authalic radius

Using Pyproj, I attempted to create a spherical CRS using the authalic radius from WGS84: import pyproj wgs84_spherical = pyproj.CRS.from_proj4('+proj=latlon +ellps=sphere +R_A=WGS84') print(...
0 votes
1 answer
23 views

How to convert WGS84 to NAD27 in pygeodesy?

Using PROJ, this command will convert / reproject / transform a WGS84 latlon point to NAD27 CONUS, UTM zone 11: cs2cs.exe +proj=latlong +init=EPSG:4326 +to +init=EPSG:26711 -120 39 240281.39 ...
0 votes
1 answer
36 views

Convert GeoPandas linestring from lat long to UTM

I can convert points from lat long to UTM OK using the following code from shapely.geometry import LineString from shapely.ops import transform from functools import partial import pyproj wgs84=...
1 vote
1 answer
10 views

pyproj return meridian_convergence of -0.0 degrees for given point in 4326

I am trying to get the correct meridian_convergence for my given point in EPSG:4326 When I try to run the following code I am getting -0.0 were expecting I 0.6 degrees. import pyproj lat, long = 30....
  • 1,409
3 votes
2 answers
81 views

Test validity of CRS for a single coordinate in python

Does anyone know if there is a simple way to check if a CRS (given by EPSG code) is valid for a single coordinate (lon, lat)?
1 vote
2 answers
93 views

How to convert lat/lon to x/y in Lambert conformal conic projection using Python

I am trying to convert some lat and lon to x and y with projection Lambert conformal conic. I am trying the Python package pyproj for that but getting the wrong values. The issue is that the ...
  • 323
1 vote
1 answer
162 views

Draw a line between pairs of points with calculating the distance using Folium

I'm trying to achieve the exact transformation explained in this post. Basically, I have a pair of XY coordinates (in EPSG 2154) and by using Folium, I need to : display those points in a map draw a ...
  • 125
1 vote
1 answer
64 views

Converting X/Y coordinates using pyproj giving incorrect results

I have two CSV files which I have to merge and the only thing common I found was one of them has coordinates of six points for polygon. and the second file has x, y coordinates which is the only ...
1 vote
1 answer
54 views

Transforming EPSG:4979 to given WKT (~EPSG:6654)

I am setting up a GIS to transform points defined in lon/lat/z (referenced to WGS84, or in EPSG:4979) to an input .laz/.las file coordinate system. I've handled reading the wkt from laz/las files with ...
  • 13
0 votes
1 answer
185 views

Convert coordinates to decimal degree in Python

I am having coordinates from EPSG:4647, these are e.g. sample_x = 32695710.12 sample_y = 5726463.327 In order to plot them on a map (using plotly) I need to convert them into decimal latitude/...
1 vote
0 answers
66 views

How to convert osmium.osm.location cordinates to normal format coordinates in python(Pyosmium)

I have extracted the coordinates data from nodes using pyosmium. Though I was successful in extracting the data but the coordinates which osmium is giving is not in normal format, I tried to convert ...
  • 11
0 votes
0 answers
52 views

Receiving Infinity in LineString using shapely and pyproj

I am try get linestring so I can measure the distance and time. Here in this linestring I am getting nan distance and time. data: path = [[29.87819, 121.54944999999998], [24.23111845, 119....
  • 101
2 votes
2 answers
362 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
33 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
52 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
51 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 ...
  • 683
0 votes
1 answer
90 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 ...
  • 171
0 votes
2 answers
258 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 ...
  • 11
2 votes
1 answer
225 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 ...
  • 33
0 votes
1 answer
43 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 ...
  • 163
2 votes
2 answers
97 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
235 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
86 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, ...
  • 41
0 votes
0 answers
48 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
193 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
74 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
130 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
155 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
88 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
88 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
65 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, ...
  • 175
3 votes
1 answer
82 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....
  • 115
1 vote
1 answer
205 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
205 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 ...
7 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
938 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
116 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
43 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 ...
  • 101
2 votes
0 answers
126 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 ...
  • 2,639
1 vote
3 answers
339 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 ...
  • 11
1 vote
1 answer
158 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 ...
  • 2,639
1 vote
1 answer
240 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 (...
  • 11.8k
0 votes
1 answer
102 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
137 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
433 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 ...
  • 21
0 votes
0 answers
65 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
476 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
580 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 ...
  • 272

1
2 3 4 5 6