~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to swig/python/scripts/epsg_tr.py

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
#******************************************************************************
3
 
#  $Id: epsg_tr.py 18953 2010-02-28 12:00:54Z rouault $
 
3
#  $Id: epsg_tr.py 19102 2010-03-15 23:41:44Z warmerdam $
4
4
5
5
#  Project:  CFS OGC MapServer
6
6
#  Purpose:  Script to create WKT and PROJ.4 dictionaries for EPSG GCS/PCS
115
115
                proj4text = gdal.EscapeString(proj4text,scheme=gdal.CPLES_SQL)
116
116
                print('INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (%s,\'EPSG\',%s,\'%s\',\'%s\');' % \
117
117
                      (str(code),str(code),wkt,proj4text))
 
118
 
 
119
        # INGRES COPY command input.
 
120
        if output_format == '-copy':
118
121
            
 
122
            try:
 
123
                wkt = prj_srs.ExportToWkt()
 
124
                proj4text = prj_srs.ExportToProj4()
 
125
 
 
126
                print( '%d\t%d%s\t%d\t%d%s\t%d%s\n' \
 
127
                       % (code,4,'EPSG',code,len(wkt),wkt,
 
128
                          len(proj4text),proj4text))
 
129
            except:
 
130
                pass
 
131
 
119
132
# =============================================================================
120
133
 
121
134
if __name__ == '__main__':
137
150
        arg = argv[i]
138
151
 
139
152
        if arg == '-wkt' or arg == '-pretty_wkt' or arg == '-proj4' \
140
 
           or arg == '-postgis' or arg == '-xml':
 
153
           or arg == '-postgis' or arg == '-xml' or arg == '-copy':
141
154
            output_format = arg
142
155
 
143
156
        elif arg[:5] == '-skip':