Coder Social home page Coder Social logo

adding new epsg codes about pyproj HOT 12 CLOSED

pyproj4 avatar pyproj4 commented on May 16, 2024
adding new epsg codes

from pyproj.

Comments (12)

micahcochran avatar micahcochran commented on May 16, 2024

The epsg codes are provided by the C library PROJ.4, which the source is included in this project. The "epsg" file is located under lib/pyproj/data/

In the PROJ.4 this same file is located under the nad directory.

There has been an one update to the epsg file on the PROJ.4 repository in January 2016 to make it in line with EPSG version 8.8 that has not be reflected in pyproj. Also, it looks like there is an EPSG database version 8.9 has been released.

If you need one of those projections that are in the new version of the epsg, you could update your epsg file locally. My understanding is the epsg file (and similar lists of epsg codes) are updated by some scripts based on the EPSG database.

There is a time lag for new projections to show up after an EPSG code is assigned.

from pyproj.

KAMI911 avatar KAMI911 commented on May 16, 2024

Hi,

I usually use this website:
http://epsg.io/
You can always use full proj4 parameter string as listed at each EPSG code.

Kami
On Jun 14, 2016 3:07 PM, "mirlip" [email protected] wrote:

Hi,
First of all thank you for this lib :)
Would it be possible to add more epsg codes? Or at least give a good
source for those codes and how to add them with the right transformation
parameters in the "epsg" file.
Regards


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#87, or mute the thread
https://github.com/notifications/unsubscribe/AFDA6PvNA9DWL8jfMKSXsCCMIk5-CzCMks5qLqeFgaJpZM4I1TPW
.

from pyproj.

ocefpaf avatar ocefpaf commented on May 16, 2024

Hi,

I usually use this website:
http://epsg.io/
You can always use full proj4 parameter string as listed at each EPSG
code.

BTW pyepsg wraps that site API in a nice lightweight python library.

from pyproj.

mirlip avatar mirlip commented on May 16, 2024

Thanks for the links. The projection I'm looking for is "transverse mercator germany zone 2" EPSG:31492. But it's not in the new version of the database. QGIS and ArcGIS both have it and it exist since pretty long. So it looks like the EPSG database is not complete which sounds strange?
But epsg.io has it. Thanks a lot KAMI911. Would it be possible to include epsg.io in pyproj :) ? I mean the database, not the API which is already available through pyepsg.

from pyproj.

mirlip avatar mirlip commented on May 16, 2024

actually their is a file including this code, but it's not "epsg", it's "esri". It's distributed with pyproj, but somehow not used when calling proj(init=x) ?
https://github.com/jswhit/pyproj/blob/master/lib/pyproj/data/esri

from pyproj.

micahcochran avatar micahcochran commented on May 16, 2024

Try this:

In [2]: p=pyproj.Proj(init="esri:31492")

In [3]: p.definition_string()
Out[3]: ' +units=m +init=esri:31492 +proj=tmerc +lat_0=0 +lon_0=6 +k=1.000000 +x_0=2500000 +y_0=0 +ellps=bessel +no_defs'

(Note: definition_string is a new feature in the repository that is not in a released version. You don't have to try that part.)

The ESRI file hasn't been updated in 13 years.

from pyproj.

mirlip avatar mirlip commented on May 16, 2024

yes it works with esri:31492 :) The problem was with epsg:31492. Problem is, QGIS and ArcGIS name it epsg code, not esri code. Are their any numbers that are in both esri and epsg making it impossible to pass only one number instead of the esri:code/epsg:code ?

from pyproj.

micahcochran avatar micahcochran commented on May 16, 2024

I can see the problem:

QGIS 2.14.3.

image

ArcGIS Desktop 10.3

image

QGIS stores its projection information qgis/resources/srs.db That is a sqlite3 database. I am not sure if the authority code "EPSG" or "ESRI" is stored in the database.

Are their any numbers that are in both esri and epsg making it impossible to pass only one number instead of the esri:code/epsg:code ?

I don't know the answer to that question.

pyproj doesn't have much of any control over QGIS or ESRI ArcGIS products. (There seem to be a few QGIS plugins that use pyproj.) I'm not much help with that.

You could open a bug report or feature request with QGIS on its Issue Tracker.

from pyproj.

mirlip avatar mirlip commented on May 16, 2024

Hi micahcochran,
Thank you for your answer. What I meant was more if it was possible for pyproj to support
proj(init=31492) instead of proj(init=EPSG:31492). I guess those numbers are unique, because it works in QGIS and ArcGIS with only EPSG: whatever the code number is.

from pyproj.

micahcochran avatar micahcochran commented on May 16, 2024

it was possible for pyproj to support proj(init=31492) instead of proj(init=EPSG:31492)

I prefer the behavior of pyproj and PROJ.4 over how QGIS and ArcGIS treats the ESRI codes.

Proj(init="esri:31492") is a shorthand for a PROJ.4 string that looks like "+init=esri:31492" in this case. pyproj is suppose to be the python equivalent to PROJ.4. There should not be much departure from how PROJ.4 deals with this. In my opinion, someone who knows how to use PROJ.4 should be able to pick up pyproj without too much trouble.

If you want a way to do this in your own project you could add this proj_code function (this has not been thoroughly debugged):

import pyproj
def proj_code(code, **kwargs):
    try:
        # Is this an epsg code?
        return pyproj.Proj(init='epsg:{}'.format(code), **kwargs)
    except RuntimeError:
        try:
            # Is this an esri code?
            return pyproj.Proj(init='esri:{}'.format(code), **kwargs)
        except RuntimeError:
            raise RuntimeError('could not find projection code: {}'.format(code))

from pyproj.

mirlip avatar mirlip commented on May 16, 2024

Ok I can understand. Thank you for the snippet :) I'll try it.

from pyproj.

micahcochran avatar micahcochran commented on May 16, 2024

Some of the above information is out of date with PROJ version 6. Therefore, I am closing this.

PROJ and other geospatial libraries had a cooperative effort (GDAL Coordinate System Barn Raising) to move from all the different ways that they were storing coordinate/spatial systems into a combined SQLite database.

from pyproj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.