Questions tagged [pyproj]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
19 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
63 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
60 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 ...
2
votes
1answer
60 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-...
0
votes
1answer
40 views

Is it possible to use ESRI:54009 (World_Mollweid) proj with rasterIo?

In a python environment I try to project from EPSG:4326 to ESRI:54009 to compute surfaces. The ESRI description doesn't seem to be recognise by rasterio lib : from rasterio.crs import CRS CRS....
2
votes
1answer
58 views

First call to transform() fails with inf, all subsequent calls are OK - what could be the reason?

I'm trying to get to the bottom of the following (weird) problem. When applying pyproj.Transformer transformation to a certain polygon, it fails the first time with (inf,inf) throughout. Second and ...
0
votes
0answers
24 views

Python pyproj converting from WGS84 to Israel Grid IG 05/12 [duplicate]

Now I see this is duplicate and is answered in Pyproj projection 0.5 meter differnce from official results (IGD05/12,IG05/12) Israel Grid I am trying to translate coords from WGS84 (file collected ...
1
vote
1answer
333 views

UserWarning when trying to get centroid from a polygon GeoPandas

I have this geopandas dataframe: df1 = gpd.GeoDataFrame(df,crs=rasterio.crs.CRS.from_string("epsg:4326"), geometry=df['geojson'].apply(json_load)) df1 = df1.set_crs(epsg=4326) print (df1....
2
votes
1answer
171 views

Translating EPSG:4326 lon lat coordinates to xy using pyproj

I'm trying to work out the details of using pyproj to translate the lat lon coordinates from the USGS Earthquake feed to xy coordinates corresponding to those positions on a basemap of a determined ...
2
votes
1answer
55 views

Pyproj giving negative UTM northing

I have a location off of the coast of Madagascar with longitude and latitude: X = 43.28191425 Y = -22.49701687 This point also has a Z value (height). I want to convert the lat,lon to UTM co-ords ...
1
vote
1answer
61 views

Coordinate Transformation Difference between QGIS and Proj

I transformed coordinates on PyQgis and Proj command line and there is 3.8 meters difference between the transformations. I used the same EPSG codes. For Proj 6.3: echo 35.53 38.75 | cs2cs +init=epsg:...
0
votes
1answer
54 views

Need a simple python program to convert EPSG/SRID 102002 (LCC) to WGS84

I'm going to convert some coordinates from Canada LCC (EPSG/SRID 102002) into WGS84 (EPSG/SRID 4326). I found a python package for this purpose which is pyproj. However, seems it doesn't support ...
0
votes
0answers
49 views

Convert cct and cs2cs scripts to pyproj

I am working on a RTK application where I use proj7.1 to make necessary transformations. The application is written in python3.7 using subprocess.Popen to call cct and cs2cs which may have performance ...
0
votes
0answers
39 views

Issue with circular patterns showing up after orthographic projection

For a project I'm working on, I'm trying to project a GOES-16 image to an orthographic projection centred at the continental United States. In a later stage, I found these odd circular patterns appear ...
0
votes
1answer
45 views

Converting from Local Coordinate to lat/long and vice verse gives out different results

I am trying to convert a set of local co ordinates into lat/long and vice versa and I have the code for it taken from this site itself , the issue is When I do these conversions they are not resulting ...
1
vote
1answer
36 views

Trying to project GeoPandas geodataframe geometry to new CRS is not working as expected

I am working with GeoPandas and a Point GeoDataFrame. I have data points in WGS84 (EPSG=4326) that are located in New Zealand. I am trying to project them to a local UTM, but I cannot get the geometry ...
1
vote
0answers
21 views

Distance difference between Pyproj and Haversine

I'm measuring the distance between two points with two different methods. This results in two very different results. Please have a look: from pyproj import Transformer from haversine import haversine,...
1
vote
1answer
47 views

Using pyproj inverse transform with GeoPandas and GroupBy + SortBy constraints

I am using pyproj inverse transform to add azimuth and distance "info" to a grouped and ordered geodataframe. I asked a similar question earlier here, but I didn't realize grouping was a ...
0
votes
1answer
28 views

Pyproj switching output coordinates

I'm trying to project from ED50 31N to WGS 84. I'm using script below but when I generate the outputs they are inverted from the coordinates I would expect. I expect x_out to be 4.031819616199967 and ...
1
vote
1answer
76 views

Pyproj inverse transform returns NaN with EPSG that is not 4326

I am using pyproj inverse transform to add azimuth and distance "info" to an ordered geodataframe and keep getting unexpected NaN results when I use a local UTM-based EPSG. It works fine in ...
2
votes
1answer
85 views

Adding EPSG codes to Pyproj

I am trying to correct ellipsoid heights to orthometric height, transforming from WGS84 to EGM2008 using the EPSG code 3855. I have tried with pyroj, as in this question: import pyproj EGM2008height = ...
0
votes
1answer
57 views

Proj/PyProj Convert between ocentric and ographic latitudes

I am trying to use Pyproj to perform the conversion between ocentric and ographic latitudes. I can do this using the cct command line tool: echo 0 45 | cct -z0 +proj=geoc +a=3396190 +b=3376200 0....
0
votes
1answer
35 views

How to extract CRS ellipsiod info in correct format for pyproj inverse

I am using pyproj inverse transform to add azimuth and distance "info" to an ordered geodataframe (gdf), but my datasets are in different locations around the world. I need to use a local ...
1
vote
1answer
50 views

Using pyproj inverse transform to get azimuth, row iteration and lambda apply (I'm close to the answer!)

I am using pyproj inverse transform to add azimuth and distance "info" to an ordered geodataframe. I am trying to iterate over all the rows in the geodataframe to add the "info" as ...
0
votes
0answers
105 views

Matplotlib Basemap how to set EPSG to be consistent with new version of pyrpoj

I am getting a Matplotlib Basemap error related to pyproj and setting the EPSG. (I know Basemap is being depreciated, but this is what I am working in for now.) As a result, I can't plot the ...
1
vote
0answers
30 views

How correctly convert WGS84 to Pulkovo 1942 with height?

I have next python code: import pyproj import sys import logging from pyproj import Transformer from pyproj import CRS lat = sys.argv[2] lon = sys.argv[3] z = sys.argv[4] transg = Transformer....
0
votes
0answers
39 views

Conversion of (lat, lon, height) to another CRS with pyproj results in no transformation

I have latitude, longitude, and ellipsoidal_height measurements in the IGS14 CRS. I want to convert/transform/project this data into latitude, longitude, and ellipsoidal_height measurements in the ...
0
votes
1answer
170 views

PYPROJ: Transformation from crs epsg:3857 to ESRI:54009

I am trying to convert from epsg:3857 to ESRI:54009 and facing some issues (pyproj version -2.6.1). ERROR 1: PROJ: proj_create_from_database: crs not found ERROR 1: PROJ: proj_create: unrecognized ...
0
votes
1answer
92 views

Reprojecting unequal number of latitude and longitude: pyproj.exceptions.ProjError: x, y, z, and time must be same size

I have a rectangular matrix of geographic climate data with a 1d row of latitude coordinates (size=834) and a 1d column with longitude coordinates (size=1115). They are both in unit of m (EPSG:32630) ...
2
votes
1answer
159 views

Why does pyproj give a different point location compared to ordnance survey when I convert from WGS84 to EPSG:27700 (BNG)

I get different results using 2 methods to convert co-ordinates from WGS84, epsg:4326 to BNG (British National Grid) epsg:27700. The differences in the plotted eastings and northings values are very ...
2
votes
1answer
512 views

ImportError: cannot import name 'CRS' from 'pyproj'?

I have installed pyproj version 1.9.6. using the command prompt window. However, when trying to import CRS (from pyproj import CRS), I receive the following ImportError: ImportError: cannot import ...
0
votes
0answers
38 views

Accommodate for tectonic shift

Given a set of coordinates of landmarks to a specific time how could one accommodate for the change of those coordinates over time via pyproj. I found that Pyproj recommends using the time component ...
0
votes
1answer
152 views

Initalize pyproj correctly

I'm trying to initialize the pyproj transformer as laid out here: Repeated transformations. This seems like it should be pretty easy. I'm trying to go from NC stateplane to lon/lat. https://epsg.io/...
0
votes
1answer
36 views

EPSG Error Trap

I'm using pyproj and I'd like to run an error trap on the EPSG code. Specifically, if the user enters a EPSG code that is not in the proj database, it would provide a Boolean flag I can check before ...
3
votes
1answer
50 views

What is the best way to handle CRSs in Geopandas so that both versions <0.7 and >=0.7 are handled?

I am developing a python package called RivGraph. I've recently run into an issue related to geopandas' decision to overhaul CRS representation, as described here and here. The short of it is that in ...
0
votes
0answers
56 views

Converting QGIS X,Y info to lat, long using Python

I am trying to convert QGIS x,y points into the lat, long coordinates. I have (335687.7471962841, 4487822.535352517) supposedly point to somewhere in the Chicago metropolitan area. I tried the ...
0
votes
1answer
49 views

pyproj gives inf instead of values

I want to convert the coordinates (639117.49, 6865775.92) from EPSG:4326 to EPSG: 3949, by using the following code: from pyproj import Proj, transform P4326 = Proj(init='epsg:4326') P3949 = Proj(...
1
vote
1answer
34 views

How can I transform X Y coordinates of NAD83 Texas North Central to latitude and longitude, preferably in Python?

I am at my wit's end here! For a project at work, I am plotting a simple map in Power BI that pinpoints some of our internal utility permitting activity. One of the datasets I have been given appears ...
2
votes
1answer
34 views

Geodesic distance discrepancies using proj

I have two positions represented as latitude,longitude pairs, and I'm trying to get the distance between them. I've 3 methods that all yield different results, where I think they should be VERY close. ...
1
vote
0answers
48 views

Error while reprojecting CSV-file with pyproj

I am trying to reproject a csv-file and here's the error i get. File "C:\Users\jonat\Anaconda3\lib\csv.py", line 98, in fieldnames self._fieldnames = next(self.reader) Error: iterator ...
0
votes
1answer
29 views

Errors relating to merging point shapefiles

I have created two different point shapefiles which represent towns within a state. However I want to know the distance between both towns, but first I want to draw a line between them. Is this ...
1
vote
1answer
259 views

Calculate area of polygons in square meters when CRS is EPSG:25833

I have EPSG:28533 coordinates and would like to calculate its area in square meters and then transform these coordinates to EPSG:3857. I have taken the code from here to calculate the area but it does ...
1
vote
1answer
87 views

PyProj incorrect transformation from EPSG:25832 to EPSG:4326

I have the following code to transform coordinates: from pyproj import Proj, transform def transform_coordinates(coordinates): (x, y) = coordinates inProj = Proj('EPSG:25832') outProj = ...
0
votes
0answers
56 views

name 'pyproj' is not defined

I am trying to use pyproj and transform but I have an error name 'pyproj' is not defined. I check my environment and I can see the pyproj version 2.6.0. My python version is 3.7.3. So, what's going ...
0
votes
1answer
78 views

What is the order of parameter (lat/long) in python UTM package for conversion into x, y coordinate?

Currently, I am trying to convert (lat, long) into (x, y) coordinates in Python. There are some packages like pyproj or utm to do that. For example: import utm lat = 41.8836718276551 lon = 12....
2
votes
2answers
313 views

Use Proj (Proj4) to convert UTM coordinate to Cartesian coordinate relative to an Earth tangent plane with its origin define as lon/lat? [closed]

I may have asked in the wrong place here, https://stackoverflow.com/questions/61147814. Then I discovered http://gis.stackexchange.com, so I decided to ask again here: I have a UTM coordinate (zone, ...
1
vote
1answer
94 views

Creating (x,y) coordinates in .nc from .grib2

I have to use a .nc file as input in a model and such model requires projection_x_coordinate and projection_y_coordinate as variables but I don't have them. Is it possible to create them using pyproj, ...
2
votes
1answer
116 views

Converting Ellipsoidal height to Orthometric height in Python

I would like to convert Ellipsoidal height to Orthometric height in Python. I tried below: import pyproj EGM2008height = pyproj.Proj("EPSG:3855") wgs84_ll = pyproj.Proj("EPSG:4326") print(pyproj....
0
votes
0answers
53 views

Datum Transformation from WGS84 UTM Zone 35N to ED50UTM Zone 35N with a grid shift file (.gsb file)

I would like to transform WGS84 UTM Zone 35N coordinates to ED50UTM Zone 35N coordinates with a grid shift file (.gsb file I have) in python using pyproj. I tried below code but it gives failed to ...
1
vote
1answer
158 views

Shapely/Pyproj converts all polygon coordinates to inf [duplicate]

After some libraries got updated, I can't convert a polygon between CRS in shapely/pyproj. Everything seems to be done according to the documentation. Pyproj version 2.4.2.post1, Shapely version 1.7....