question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consistency of crs.is_geographic between different EPSG representations

See original GitHub issue

When creating an EPSG:4326 projection using a proj4 string, the value of the proj.crs.is_geographic property depends on whether definition_string() or crs.to_proj4(4) was used for initialization.

In [1]: import pyproj                                                                                                                                                                                                                        

In [2]: pyproj.Proj('EPSG:4326').crs.is_geographic                                                                                                                                                                                           
Out[2]: True

In [4]: pyproj.Proj('EPSG:4326').crs.to_proj4(4)                                                                                                                                                                                             
Out[4]: '+proj=longlat +datum=WGS84 +no_defs +type=crs'

In [5]: pyproj.Proj('EPSG:4326').definition_string()                                                                                                                                                                                         
Out[5]: 'proj=longlat datum=WGS84 no_defs ellps=WGS84 towgs84=0,0,0'

In [6]: pyproj.Proj(pyproj.Proj('EPSG:4326').crs.to_proj4(4)).crs.is_geographic                                                                                                                                                              
Out[6]: True

In [7]: pyproj.Proj(pyproj.Proj('EPSG:4326').definition_string()).crs.is_geographic                                                                                                                                                          
Out[7]: False

It seems like the extra towgs84=0,0,0 parameter in the definition_string causes the problem. Shouldn’t this be consistent? Or is this just another example of losing information when converting CRSes to proj4 strings?

pyproj version is 2.1.3.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
snowman2commented, Apr 23, 2019

Not a problem 👍. The solution is in master now if you want to give it a try.

0reactions
sfinkenscommented, Apr 23, 2019

@snowman2 Thanks for looking into it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Well-known text representation of coordinate reference systems
A coordinate transformation operates between two coordinate reference ... of the geodetic CRS to which the prime meridian is an attribute is geographic, ......
Read more >
Understand EPSG, WKT and Other CRS Definition Styles
Well-known Text ( WKT ) is a for compact machine- and human-readable representation of geometric objects. It defines elements of coordinate ...
Read more >
Earth, Ellipsoid, Datum, Coordinate Reference System (CRS ...
An ellipsoid has different ways to position itself relative to Earth ... This type of CRS is Geographic Coordinate System with coordinate unit...
Read more >
Well-known text representation of coordinate reference systems
Well-known text representation of coordinate reference systems (WKT or WKT-CRS) is a text markup language for representing spatial reference systems and ...
Read more >
OGR Coordinate Reference Systems and Coordinate ... - GDAL
Furthermore, any geographic CRS in the EPSG database can be set by its GCS code number if ... class is used for translating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found