Questions tagged [pyproj]
A Python interface to the PROJ library to perform cartographic transformations and geodetic computations.
279
questions
1
vote
0
answers
26
views
Transforming from ESRI:102173 to EPSG:4326 returning wrong results [closed]
I am trying to convert a set of coordinates using ESRI:102173 system to a standard EPSG:4326 to be able to compare them with other data sets. The issue I am having is than when converting the values ...
0
votes
1
answer
46
views
EPSG code has stopped working with pyproj.Transformer.from_crs, but still works with pyproj.transform and pyproj.Proj
My code:
from pyproj import Proj, Transformer
EASE_Proj = 'EPGS:3409'
WGS_Proj = 'EPSG:4326'
transformer = Transformer.from_crs(WGS_Proj, EASE_Proj)
Suddenly produces the following error after ...
0
votes
3
answers
108
views
Creating geometry from lat/lon column using Python
I used the code:
import geopandas as gpd
geom = gpd.points_from_xy(dat['lon'], dat['lat'], crs=4326)
dat = gpd.GeoDataFrame(data=dat[['value']], geometry=geom)
but I receive the error:
CRSError: ...
4
votes
1
answer
84
views
Why does GeoPandas behave differently on Windows and Linux (and is there a work-around)?
I am using Python Geopandas 0.12.2 to read and reproject a shapefile. My code works on Windows 10 but does not produce the correct results on Linux. Specifically, the Linux implementation produces a ...
1
vote
3
answers
118
views
Identifying the EPSG code for projection
I'm trying to convert a dataset that has projection parameters in meters to lat/long coordinates. After researching online and on stack exchange, I came up with a code. I used the input EPSG as 3857 ...
2
votes
0
answers
73
views
How to use an affine transformation pipepline with GDAL Python API?
I am trying to transform coordinates from a local grid to a projected coordinate system (UTM) to ultimately reproject raster or vector data.
I am using :
Python 3.9
GDAL 3.6.0
Pyproj 3.4
I generated ...
0
votes
1
answer
118
views
Converting contours in an image to lines in shapefile using Python
I have processed a screenshot from Google Maps using OpenCV and identified some contours for the red road sections, and I want to project these contours to a shapefile. I have searched but couldn't ...
1
vote
0
answers
42
views
How to display a map using a new projection (new latitude/longitude to XY conversion formula) [closed]
I have constructed a new formula for planar projection that converts latitude and longitude into XY coordinates, a projection that is completely new and not derived from some projection.
def transform(...
0
votes
1
answer
146
views
Lat/lon after moving x meters to a specified direction
I have recently been working with coordinate systems in Python with pyproj package. I'm facing the following problem: I know my current position from a GPS receiver as EPSG:4326 latitude/longitude ...
0
votes
1
answer
50
views
Pyproj transformation of a geopandas does not match QGIS reprojection
I have a file in British National Grid coordinates (EPSG 27700) which I'm trying to convert to WGS84 (EPSG 4326)
My first attempt was to transform in the usual way
import geopandas as gpd
file = '...
0
votes
0
answers
19
views
Reproject raster from rectilinear LCC to rectilinear GK
I have many climate raster (netcdf) in a rectilinear grid in LCC projection (EPSG 3034) and I want to reproject it with python to a local Gauß Kryger projection (31467).
Reprojecting every raster ...
0
votes
0
answers
62
views
Datum conversion from NAD27 + NGVD29 height (ftUS) to NAD27 + NAVD88 height (ftUS) using python
I am using Python pyproj to convert xyz values of Louisiana, USA region from NAD27 + NGVD29 height (ftUS) to NAD27 + NAVD88 height (ftUS). So, I am not changing the horizontal projection (because it's ...
2
votes
1
answer
83
views
Return used transformation from GDAL warp (or similar)
I would like to identify/confirm the transformation used when reprojecting a raster with gdalwarp (or gdal.warp in python).
I already tried to find possible transformations with pyproj.Transformer, ...
0
votes
1
answer
53
views
How to transform X and Y from LV95 to Lat Long with pyproj
I am trying to convert data from
LV95 (Berne = 2600 / 1200 km)
to
WGS84 (~ETRS89)
Is this possible with pyproj.
I'm trying like this
from pyproj import Proj, transform
inProj = Proj(init='CH:1903_LV03'...
0
votes
2
answers
100
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
38
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
vote
1
answer
38
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
103
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
129
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
19
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....
3
votes
2
answers
164
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
513
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 ...
1
vote
1
answer
2k
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 ...
1
vote
1
answer
257
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
156
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 ...
0
votes
1
answer
640
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
129
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 ...
0
votes
0
answers
89
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....
2
votes
2
answers
1k
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
73
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
70
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
2
answers
69
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
145
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
497
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
359
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
76
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 ...
0
votes
1
answer
514
views
Euclidean Coordinates to Lat Long Based on Reference Location in Python
Goal
Convert Euclidean Coordinates to Latitude and Longitude given the Latitude and Longitude of euclidean origin using Python. To give a sense of scale and accuracy for my application, the ...
2
votes
2
answers
141
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
393
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
132
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, ...
3
votes
2
answers
342
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 ...
4
votes
1
answer
210
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
214
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
140
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
108
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
116
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
97
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
326
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
300
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
2k
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 ...